diff options
| author | glatzor@ubuntu.com <> | 2006-08-02 18:37:59 +0200 |
|---|---|---|
| committer | glatzor@ubuntu.com <> | 2006-08-02 18:37:59 +0200 |
| commit | 0a5aacc19bfe31eda221e2f6476712097d693a06 (patch) | |
| tree | 8995ea136686477cc31a4e240b6464ea0c6d6ed0 /software-properties | |
| parent | 70bf03a91044f338aed8acd819c15dc8d5968103 (diff) | |
| parent | dde2af913b3f26958f93f604d7a75e61e64ec7f1 (diff) | |
| download | python-apt-0a5aacc19bfe31eda221e2f6476712097d693a06.tar.gz | |
* merge with main
Diffstat (limited to 'software-properties')
| -rw-r--r-- | software-properties | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/software-properties b/software-properties index d447ebbc..129c3085 100644 --- a/software-properties +++ b/software-properties @@ -34,6 +34,8 @@ import sys from optparse import OptionParser +import UpdateManager.Common.aptsources as aptsources + #sys.path.append("@prefix@/share/update-manager/python") from SoftwareProperties import SoftwareProperties @@ -51,6 +53,10 @@ if __name__ == "__main__": action="store", type="string", dest="toplevel", help="Set x-window-id of the toplevel parent for the "\ "dialog (usefull for embedding)") + parser.add_option("-e", "--enable-component", + action="store", type="string", dest="enable_component", + help="Enable the specified component of the distro's "\ + "repositories") (options, args) = parser.parse_args() @@ -74,7 +80,14 @@ if __name__ == "__main__": #data_dir="/tmp/xxx/share/update-manager/" file = None if len(args) > 0: - file = args[0] - app = SoftwareProperties.SoftwareProperties(data_dir, options, file) - app.run() - sys.exit(app.modified) + file = args[0] + if options.enable_component: + sourceslist = aptsources.SourcesList() + distro = aptsources.Distribution() + distro.get_sources(sourceslist) + distro.enable_component(sourceslist, options.enable_component) + sourceslist.save() + else: + app = SoftwareProperties.SoftwareProperties(data_dir, options, file) + app.run() + sys.exit(app.modified) |
