[PATCH] update_version.sh: also update version in snapcraft.yaml

Colin King colin.king at canonical.com
Fri May 18 10:44:39 UTC 2018


From: Colin Ian King <colin.king at canonical.com>

We need to keep the snapcraft version in-sync too, so use sed
to edit this and keep it up to date.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 update_version.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/update_version.sh b/update_version.sh
index 3d4d0517..675f53bf 100755
--- a/update_version.sh
+++ b/update_version.sh
@@ -26,8 +26,14 @@ cat << EOF > src/lib/include/fwts_version.h
  *
  */
 EOF
+# Update fwts_version
 echo '#define FWTS_VERSION "'$version'"' >> src/lib/include/fwts_version.h
 echo '#define FWTS_DATE    "'`date --utc "+%F %T"`'"' >> src/lib/include/fwts_version.h
+# Update snapcraft version
+oldsnap_version=$(grep "version: " snapcraft.yaml | cut -d' ' -f2)
+sed -i "s/version: ${oldsnap_version}/version: ${version}/" snapcraft.yaml
+# Update git repo
 git add src/lib/include/fwts_version.h
+git add snapcraft.yaml
 git commit -s -m"lib: fwts_version.h - update to $version"
 git tag -m'"Version '$1'"' $1
-- 
2.17.0




More information about the fwts-devel mailing list