42 """ returns of the good and bad signatures""" |
43 """ returns of the good and bad signatures""" |
43 sigfile = datafile = None |
44 sigfile = datafile = None |
44 try: |
45 try: |
45 # create temporary files |
46 # create temporary files |
46 fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig") |
47 fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig") |
47 fp = os.fdopen(fd, 'wb') |
48 fp = os.fdopen(fd, pycompat.sysstr('wb')) |
48 fp.write(sig) |
49 fp.write(sig) |
49 fp.close() |
50 fp.close() |
50 fd, datafile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".txt") |
51 fd, datafile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".txt") |
51 fp = os.fdopen(fd, 'wb') |
52 fp = os.fdopen(fd, pycompat.sysstr('wb')) |
52 fp.write(data) |
53 fp.write(data) |
53 fp.close() |
54 fp.close() |
54 gpgcmd = ("%s --logger-fd 1 --status-fd 1 --verify " |
55 gpgcmd = ("%s --logger-fd 1 --status-fd 1 --verify " |
55 "\"%s\" \"%s\"" % (self.path, sigfile, datafile)) |
56 "\"%s\" \"%s\"" % (self.path, sigfile, datafile)) |
56 ret = util.filter("", gpgcmd) |
57 ret = util.filter("", gpgcmd) |