diff options
Diffstat (limited to 'subcmds/selfupdate.py')
-rw-r--r-- | subcmds/selfupdate.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/subcmds/selfupdate.py b/subcmds/selfupdate.py index d5d0a838..00376b66 100644 --- a/subcmds/selfupdate.py +++ b/subcmds/selfupdate.py | |||
@@ -18,6 +18,11 @@ import sys | |||
18 | from command import Command, MirrorSafeCommand | 18 | from command import Command, MirrorSafeCommand |
19 | from subcmds.sync import _PostRepoUpgrade | 19 | from subcmds.sync import _PostRepoUpgrade |
20 | from subcmds.sync import _PostRepoFetch | 20 | from subcmds.sync import _PostRepoFetch |
21 | from error import RepoExitError | ||
22 | |||
23 | |||
24 | class SelfupdateError(RepoExitError): | ||
25 | """Exit error for failed selfupdate command.""" | ||
21 | 26 | ||
22 | 27 | ||
23 | class Selfupdate(Command, MirrorSafeCommand): | 28 | class Selfupdate(Command, MirrorSafeCommand): |
@@ -58,9 +63,10 @@ need to be performed by an end-user. | |||
58 | _PostRepoUpgrade(self.manifest) | 63 | _PostRepoUpgrade(self.manifest) |
59 | 64 | ||
60 | else: | 65 | else: |
61 | if not rp.Sync_NetworkHalf().success: | 66 | result = rp.Sync_NetworkHalf() |
67 | if result.error: | ||
62 | print("error: can't update repo", file=sys.stderr) | 68 | print("error: can't update repo", file=sys.stderr) |
63 | sys.exit(1) | 69 | raise SelfupdateError(aggregate_errors=[result.error]) |
64 | 70 | ||
65 | rp.bare_git.gc("--auto") | 71 | rp.bare_git.gc("--auto") |
66 | _PostRepoFetch(rp, repo_verify=opt.repo_verify, verbose=True) | 72 | _PostRepoFetch(rp, repo_verify=opt.repo_verify, verbose=True) |