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

« back to all changes in this revision

Viewing changes to softwareproperties/AptAuth.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-07-25 18:15:30 UTC
  • Revision ID: james.westby@ubuntu.com-20110725181530-ckdbew4yh0ef7xrt
Tags: 0.81.3
* softwareproperties/gtk/SimpleGtkbuilderApp.py:
  - remove unneeded debug output for gobjects without a get_name()
    function
* softwareproperties/gtk/SoftwarePropertiesGtk.py:
  - do not crash if update-notifier is not installed (LP: #815016)
* softwareproperties/AptAuth.py:
  - do not access ~/.gnupg from AptAuth() (LP: #815034)
* softwareproperties/SoftwareProperties.py:
  - add CDROM add support into the dbus backend (LP: #815860)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20
20
#  USA
21
21
 
 
22
import gettext
22
23
import os
23
24
import subprocess
24
 
import gettext
 
25
import tempfile
 
26
 
25
27
from subprocess import PIPE
26
28
 
27
29
# gettext convenient
39
41
        self.base_opt = self.gpg + [
40
42
            "--no-options", 
41
43
            "--no-default-keyring",
 
44
            "--trust-model", "always",
42
45
            "--keyring", os.path.join(rootdir, "etc/apt/trusted.gpg"),
43
46
            ]
44
 
        secring = os.path.join(rootdir, "etc/apt/secring.gpg")
45
 
        trustdb = os.path.join(rootdir, "etc/apt/trustdb.gpg")
46
 
        if (os.access(secring, os.W_OK) or 
47
 
            os.access(os.path.dirname(secring), os.W_OK)):
48
 
            self.base_opt += ["--secret-keyring", secring]
49
 
        if (os.access(trustdb, os.W_OK) or
50
 
            os.access(os.path.dirname(trustdb), os.W_OK)):
51
 
            self.base_opt += ["--trustdb-name", trustdb]
 
47
        self.tmpdir = tempfile.mkdtemp()
 
48
        self.secring = tempfile.NamedTemporaryFile()
 
49
        self.base_opt += ["--secret-keyring", self.secring.name]
52
50
        self.list_opt = self.base_opt + ["--with-colons",
53
51
                                         "--batch",
54
52
                                         "--list-keys"]