diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-04 22:49:31 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-09-04 22:49:31 +0200 |
| commit | 36aaf7a6e85328bad2e330ddb2d0f12554602f4f (patch) | |
| tree | 69e1f9c4ddfca6d3fe1fbfb3ddc7cc04666359be | |
| parent | 57397ade71171c8ac03aa1de592ba67b50d1db87 (diff) | |
| parent | dd6de6768890b0aaf21ceac12f835f9157e438a9 (diff) | |
| download | python-apt-36aaf7a6e85328bad2e330ddb2d0f12554602f4f.tar.gz | |
* merged from Sebastian
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 39 | ||||
| -rw-r--r-- | UpdateManager/Common/aptsources.py | 11 | ||||
| -rw-r--r-- | software-properties | 7 |
3 files changed, 52 insertions, 5 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 38b55ef5..042a0c4c 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -377,6 +377,42 @@ class SoftwareProperties(SimpleGladeApp): else: self.treeview_cdroms.set_sensitive(True) + if self.options.debug == True or self.options.massive_debug == True: + print "ENABLED COMPS: %s" % self.distro.enabled_comps + print "INTERNET COMPS: %s" % self.distro.download_comps + print "MAIN SOURCES" + for source in self.distro.main_sources: + self.print_source_entry(source) + print "CHILD SOURCES" + for source in self.distro.child_sources: + self.print_source_entry(source) + print "CDROM SOURCES" + for source in self.distro.cdrom_sources: + self.print_source_entry(source) + print "SOURCE CODE SOURCES" + for source in self.distro.source_code_sources: + self.print_source_entry(source) + print "DISABLED SOURCES" + for source in self.distro.disabled_sources: + self.print_source_entry(source) + print "ISV" + for source in self.sourceslist_visible: + self.print_source_entry(source) + + def print_source_entry(self, source): + """Print the data of a source entry to the command line""" + print source.dist + for (label, value) in [("URI:", source.uri), + ("Comps:", source.comps), + ("Enabled:", not source.disabled), + ("Valid:", not source.invalid)]: + print " %s %s" % (label, value) + if source.template: + for (label, value) in [("MatchURI:", source.template.match_uri), + ("BaseURI:", source.template.base_uri)]: + print " %s %s" % (label, value) + print "\n" + def on_combobox_server_changed(self, combobox): """ Replace the servers used by the main and update sources with @@ -629,7 +665,8 @@ class SoftwareProperties(SimpleGladeApp): def modified_sourceslist(self): """The sources list was changed and now needs to be saved and reloaded""" - self.massive_debug_output() + if self.options.massive_debug == True: + self.massive_debug_output() self.modified = True self.button_revert.set_sensitive(True) self.save_sourceslist() diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py index 38b1bd92..1fa080da 100644 --- a/UpdateManager/Common/aptsources.py +++ b/UpdateManager/Common/aptsources.py @@ -537,12 +537,15 @@ class Distribution: self.source_code_sources.append(source) elif source.type.endswith("-src") and source.disabled == True: self.disabled_sources.append(source) - if source.template in self.source_template.children: - #print "yeah! child found: %s" % source.template.name - if source.type == "deb": + if source.invalid == False and\ + source.template in self.source_template.children: + if source.disabled == False and source.type == "deb": self.child_sources.append(source) - elif source.type == "deb-src": + elif source.disabled == False and source.type == "deb-src": self.source_code_sources.append(source) + else: + self.disabled_sources.append(source) + self.download_comps = set(comps) self.cdrom_comps = set(cdrom_comps) enabled_comps.extend(comps) diff --git a/software-properties b/software-properties index 129c3085..af1f80ff 100644 --- a/software-properties +++ b/software-properties @@ -45,6 +45,13 @@ if __name__ == "__main__": # Begin parsing of options parser = OptionParser() + parser.add_option ("-d", "--debug", action="store_true", + dest="debug", default=False, + help="Print some debug information to the command line") + parser.add_option ("-m", "--massive-debug", action="store_true", + dest="massive_debug", default=False, + help="Print a lot of debug information to the " + "command line") parser.add_option ("-n", "--no-update", action="store_true", dest="no_update", default=False, help="No update on repository change (usefull if called "\ |
