~ubuntu-branches/ubuntu/oneiric/software-properties/oneiric-updates

« back to all changes in this revision

Viewing changes to add-apt-repository

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Michael Vogt, Martin Pitt
  • Date: 2011-05-18 09:59:32 UTC
  • Revision ID: james.westby@ubuntu.com-20110518095932-wy61p72qg8tm6o6a
Tags: 0.80.10
[ Michael Vogt ]
* merged lp:~hodgestar/software-properties/configurable-key-server,
  many thanks

[ Martin Pitt ]
* software-properties-gtk: Stop forcing GTK 2, we want to use GTK 3 now.
  Update gir dependency accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import locale
7
7
 
8
8
from softwareproperties.SoftwareProperties import SoftwareProperties
9
 
from softwareproperties.ppa import expand_ppa_line
 
9
from softwareproperties.ppa import DEFAULT_KEYSERVER, expand_ppa_line
10
10
from aptsources.sourceslist import SourceEntry
11
11
from optparse import OptionParser
12
12
from gettext import gettext as _
41
41
    parser = OptionParser(usage)
42
42
    # FIXME: provide a --sources-list-file= option that 
43
43
    #        puts the line into a specific file in sources.list.d
 
44
    parser.add_option ("-m", "--massive-debug", action="store_true",
 
45
        dest="massive_debug", default=False,
 
46
        help="Print a lot of debug information to the command line")
44
47
    parser.add_option("-r", "--remove", action="store_true",
45
48
        dest="remove", default=False,
46
49
        help="remove repository from sources.list.d directory")
 
50
    parser.add_option("-k", "--keyserver",
 
51
        dest="keyserver", default=DEFAULT_KEYSERVER,
 
52
        help="URL of keyserver. Default: %default")
47
53
    (options, args) = parser.parse_args()
48
54
 
49
55
    if os.geteuid() != 0:
57
63
    # force new ppa file to be 644 (LP: #399709)
58
64
    os.umask(0022)
59
65
 
60
 
    sp = SoftwareProperties()   
 
66
    sp = SoftwareProperties(options=options)
61
67
    line = args[0]
62
68
    if options.remove:
63
69
        (line, file) = expand_ppa_line(line.strip(), sp.distro.codename)