launcher/version: include OS/CPU info in output

We often ask users what OS/version they're running when debugging.
Include that in the version output to simplify the process.

Change-Id: Ie480b6d1c874e6f4c6f4996a03795077b844f858
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256732
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2020-02-25 15:09:01 -05:00
parent b0fbc7fb58
commit 5f11eac147
2 changed files with 11 additions and 0 deletions

4
repo
View File

@ -993,6 +993,10 @@ def _Version():
print(' (from %s)' % (__file__,)) print(' (from %s)' % (__file__,))
print('git %s' % (ParseGitVersion().full,)) print('git %s' % (ParseGitVersion().full,))
print('Python %s' % sys.version) print('Python %s' % sys.version)
uname = platform.uname()
print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
print('CPU %s (%s)' %
(uname.machine, uname.processor if uname.processor else 'unknown'))
sys.exit(0) sys.exit(0)

View File

@ -15,7 +15,10 @@
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import platform
import sys import sys
from command import Command, MirrorSafeCommand from command import Command, MirrorSafeCommand
from git_command import git, RepoSourceVersion, user_agent from git_command import git, RepoSourceVersion, user_agent
from git_refs import HEAD from git_refs import HEAD
@ -52,3 +55,7 @@ class Version(Command, MirrorSafeCommand):
print('git %s' % git.version_tuple().full) print('git %s' % git.version_tuple().full)
print('git User-Agent %s' % user_agent.git) print('git User-Agent %s' % user_agent.git)
print('Python %s' % sys.version) print('Python %s' % sys.version)
uname = platform.uname()
print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
print('CPU %s (%s)' %
(uname.machine, uname.processor if uname.processor else 'unknown'))