summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-26 16:21:08 -0500
committerDavid Pursehouse <dpursehouse@collab.net>2020-02-26 23:20:10 +0000
commiteea23b44a97ad84b5a81bd969a04a8b9822448f1 (patch)
tree461577fd7ef069ff675d8989b49d461f165605e4
parent5f11eac1478fb4797766ca4f5225a7f60d9cb993 (diff)
downloadgit-repo-eea23b44a97ad84b5a81bd969a04a8b9822448f1.tar.gz
main: improve launcher update messaging wrt system installs
Some users get repo from their distro (e.g. /usr/bin/repo), so the suggestion to copy over top of it makes people uneasy, if it's even possible in the first place. Bug: https://crbug.com/gerrit/12335 Change-Id: I9a0c83d6ba0f466fa8e6d61f674ee13396f9a968 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256893 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
-rwxr-xr-xmain.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/main.py b/main.py
index 06cd1108..98234cbf 100755
--- a/main.py
+++ b/main.py
@@ -348,12 +348,20 @@ repo: error:
348 sys.exit(1) 348 sys.exit(1)
349 349
350 if exp > ver: 350 if exp > ver:
351 print(""" 351 print('\n... A new version of repo (%s) is available.' % (exp_str,),
352... A new version of repo (%s) is available. 352 file=sys.stderr)
353 if os.access(repo_path, os.W_OK):
354 print("""\
353... You should upgrade soon: 355... You should upgrade soon:
354
355 cp %s %s 356 cp %s %s
356""" % (exp_str, WrapperPath(), repo_path), file=sys.stderr) 357""" % (WrapperPath(), repo_path), file=sys.stderr)
358 else:
359 print("""\
360... New version is available at: %s
361... The launcher is run from: %s
362!!! The launcher is not writable. Please talk to your sysadmin or distro
363!!! to get an update installed.
364""" % (WrapperPath(), repo_path), file=sys.stderr)
357 365
358 366
359def _CheckRepoDir(repo_dir): 367def _CheckRepoDir(repo_dir):