From 096d7b0170a16597dd3c7e470ea6e23c8cf5da65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 26 Jan 2021 17:10:20 +0100 Subject: Add update.sh to automatically update to new versions --- update.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..8920e2d --- /dev/null +++ b/update.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +if [ -z "$1" ] +then + echo "Missing argument" 1>&2 + exit 1 +fi + +NEW=$1 +VAR=`echo $NEW | sed "s/^\([^.]*\).*/\1/"` +OLD=`grep -o "^$VAR := .*$" -- early-plugins.mk | sed 's/.* \([a-zA-Z0-9.-]*$\)$/\1/'` + +echo Variable: $VAR +echo Old version: $OLD +echo New version: $NEW + +sed "s/\(^$VAR := .*\) [a-zA-Z0-9.-]*$/\1 $NEW/" -- early-plugins.mk > early-plugins.1.tmp +sed "/^$VAR-DROPPED := .*\\\\$/ { : again; /\\\\$/ { N; b again }; s/$/ $OLD/ }" -- early-plugins.1.tmp > early-plugins.2.tmp + +rm early-plugins.1.tmp +mv early-plugins.2.tmp early-plugins.mk +wget https://erlang.org/download/$NEW.README -O release-notes/$NEW.README.txt + +git add early-plugins.mk release-notes/$NEW.README.txt +git diff --cached +echo Press Enter to commit and push, Ctrl+C to abort, Ctrl+Z to pause +read + +git commit -m "$NEW" +git push upstream master -- cgit v1.2.3