Message ID | 20180518104439.25656-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | update_version.sh: also update version in snapcraft.yaml | expand |
On 05/18/2018 06:44 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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 Acked-by: Ivan Hu <ivan.hu@canonical.com>
On 2018-05-18 03:44 AM, Colin King wrote: > From: Colin Ian King <colin.king@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@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 > Acked-by: Alex Hung <alex.hung@canonical.com>
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