git-update: fixes for running on windows
authorScott D Phillips <scott.d.phillips@intel.com>
Thu, 17 Nov 2016 18:55:44 +0000 (10:55 -0800)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Thu, 17 Nov 2016 20:49:17 +0000 (17:49 -0300)
when running git-update as `py git-update` (which is convenient on
windows), SCRIPTDIR is '' instead of '.'. Fix that with normpath.

Printing emdash (U+2014) doesn't work on windows because it isn't in
cp437. Change it to hyphen.

https://bugzilla.gnome.org/show_bug.cgi?id=774636

git-update

index 32a085a..3a4ea2a 100755 (executable)
@@ -9,7 +9,7 @@ from common import Colors
 from common import accept_command
 
 
-SCRIPTDIR = os.path.dirname(__file__)
+SCRIPTDIR = os.path.normpath(os.path.dirname(__file__))
 
 
 def manifest_get_commits(manifest):
@@ -84,7 +84,7 @@ def update_repo(repo_name, repo_dir, revision, no_interaction, recurse_i=0):
 
 
     commit_message = git("show", repository_path=repo_dir).split("\n")
-    print(u"  -> %s%s%s  %s" % (Colors.HEADER, commit_message[0][7:14], Colors.ENDC,
+    print(u"  -> %s%s%s - %s" % (Colors.HEADER, commit_message[0][7:14], Colors.ENDC,
                                     commit_message[4].strip()))
 
     return True