diff mbox series

update_version.sh: also update version in snapcraft.yaml

Message ID 20180518104439.25656-1-colin.king@canonical.com
State Accepted
Headers show
Series update_version.sh: also update version in snapcraft.yaml | expand

Commit Message

Colin Ian King May 18, 2018, 10:44 a.m. UTC
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(+)

Comments

Ivan Hu May 21, 2018, 9:34 a.m. UTC | #1
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>
Alex Hung May 21, 2018, 6:39 p.m. UTC | #2
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 mbox series

Patch

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