Ansgar pushed to branch master at Debian FTP Team / dak
Commits:
-
f74dfe7d
by Ansgar at 2022-06-30T09:58:41+02:00
-
22f60fb5
by Ansgar at 2022-06-30T10:00:24+02:00
-
d517ab99
by Ansgar at 2022-06-30T10:00:49+02:00
1 changed file:
Changes:
... | ... | @@ -138,6 +138,10 @@ class SignedFile: |
138 | 138 | stderr = self.stderr.decode('ascii', errors='replace')
|
139 | 139 | raise GpgException("No status output from GPG. (GPG exited with status code %s)\n%s" % (exit_code, stderr))
|
140 | 140 | |
141 | + if exit_code not in (0, 1):
|
|
142 | + stderr = self.stderr.decode('ascii', errors='replace')
|
|
143 | + raise GpgException(f"GPG exited with a fatal error (exit code {exit_code})\n{stderr}")
|
|
144 | + |
|
141 | 145 | for line in self.status.splitlines():
|
142 | 146 | self._parse_status(line)
|
143 | 147 | |
... | ... | @@ -288,7 +292,13 @@ class SignedFile: |
288 | 292 | |
289 | 293 | os.execvp(self.gpg, args)
|
290 | 294 | finally:
|
291 | - os._exit(1)
|
|
295 | + try:
|
|
296 | + print("Failed to execute gpg.", file=sys.stderr)
|
|
297 | + sys.stderr.flush()
|
|
298 | + except:
|
|
299 | + # Ignore errors, we want to reach the `exit` call below.
|
|
300 | + pass
|
|
301 | + os._exit(2)
|
|
292 | 302 | |
293 | 303 | def contents_sha1(self):
|
294 | 304 | return apt_pkg.sha1sum(self.contents)
|