launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #27485
[Merge] ~cjwatson/launchpad:py3-update-version-info into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-update-version-info into launchpad:master.
Commit message:
Switch generated version-info.py to Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/408009
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-update-version-info into launchpad:master.
diff --git a/scripts/update-version-info.sh b/scripts/update-version-info.sh
index 73a1c3d..f76b927 100755
--- a/scripts/update-version-info.sh
+++ b/scripts/update-version-info.sh
@@ -22,19 +22,19 @@ branch_nick="$(git rev-parse --abbrev-ref HEAD | sed "s/'/\\\\'/g")"
revision_id="$(git rev-parse HEAD)"
date="$(git show -s --format=%ci HEAD)"
cat > $newfile <<EOF
-#! /usr/bin/env python
+#! /usr/bin/env python3
version_info = {
- 'branch_nick': u'$branch_nick',
- 'date': u'$date',
- 'revision_id': u'$revision_id',
+ 'branch_nick': '$branch_nick',
+ 'date': '$date',
+ 'revision_id': '$revision_id',
}
if __name__ == '__main__':
print('revision id: %(revision_id)s' % version_info)
EOF
-revision_id=$(python $newfile | sed -n 's/^revision id: //p')
+revision_id=$(python3 $newfile | sed -n 's/^revision id: //p')
if ! [ -f version-info.py ]; then
echo "Creating version-info.py at revision $revision_id"
mv ${newfile} version-info.py