From 656952760c1bc022a0caab1fd370740dd952a8d4 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 12 May 2020 13:38:32 +0200 Subject: [PATCH] Move update_version.sh to contrib/ Change-Id: I26218cd512a739fc26ba04be05f01260152d785f --- .gitignore | 2 +- Makefile | 2 +- update_version.sh => contrib/update_version.sh | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) rename update_version.sh => contrib/update_version.sh (50%) diff --git a/.gitignore b/.gitignore index a0c40883..ad9b4235 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ __pycache__ pid .*.sw? -version +.version _version.py tags set_pythonpath diff --git a/Makefile b/Makefile index 38ff6c8c..558f7390 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ deps: ./contrib/check_dependencies.py version: - ./update_version.sh + ./contrib/update_version.sh manual: $(MAKE) -C doc/manuals diff --git a/update_version.sh b/contrib/update_version.sh similarity index 50% rename from update_version.sh rename to contrib/update_version.sh index 3d5fe427..ab2674a8 100755 --- a/update_version.sh +++ b/contrib/update_version.sh @@ -1,10 +1,11 @@ #!/bin/sh set -e -git describe --abbrev=8 --dirty | sed 's/v\([^-]*\)-\([^-]*\)-\(.*\)/\1.dev\2.\3/' > version -cat version +ROOTDIR=$(git rev-parse --show-toplevel) +git describe --abbrev=8 --dirty | sed 's/v\([^-]*\)-\([^-]*\)-\(.*\)/\1.dev\2.\3/' > $ROOTDIR/.version +cat $ROOTDIR/.version echo "# osmo-gsm-tester version. # Automatically generated by update_version.sh. # Gets imported by __init__.py. -_version = '$(cat version)'" \ - > src/osmo_gsm_tester/_version.py +_version = '$(cat $ROOTDIR/.version)'" \ + > $ROOTDIR/src/osmo_gsm_tester/_version.py