summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-03-02 13:00:08 +0100
committerRemi Collet <fedora@famillecollet.com>2017-03-02 13:00:08 +0100
commitd8765c9f4ef477d2eec9501cc4d8abd9cdf05e2c (patch)
tree8b4c96bede017b0c927427f85142d020043ff279
parent11c5bf7322ab13303e939084b4d483bead65d3f4 (diff)
tools: pkgup helper
-rwxr-xr-xpearup1
-rwxr-xr-xpkgup21
2 files changed, 22 insertions, 0 deletions
diff --git a/pearup b/pearup
index fbef42d..857ce82 100755
--- a/pearup
+++ b/pearup
@@ -2,6 +2,7 @@
vendor="Remi Collet <remi@remirepo.net>"
rpmdate=$(LC_ALL="C" date +"%a %b %d %Y")
+rpmdate=${rpmdate/ 0/ }
name=$(basename $PWD)
if [ $# -lt 2 ]; then
diff --git a/pkgup b/pkgup
new file mode 100755
index 0000000..fb03148
--- /dev/null
+++ b/pkgup
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+vendor="Remi Collet <remi@remirepo.net>"
+rpmdate=$(LC_ALL="C" date +"%a %b %d %Y")
+rpmdate=${rpmdate/ 0/ }
+name=$(basename $PWD)
+
+if [ $# -lt 2 ]; then
+ echo "usage $0 version commit"
+ exit 1
+fi
+name=${3:$(basename $PWD)}
+
+sed --regexp-extended \
+ --expression "/^Version:/s/[0-9.]+$/$1/" \
+ --expression "/github_version/s/[0-9.]+$/$1/" \
+ --expression "/(github|gh)_commit/s/[0-9a-f]{40}$/$2/" \
+ --expression '/^Release:/s/[0-9.]+/1/' \
+ --expression "s/%changelog/%changelog\n* $rpmdate $vendor - $1-1\n- Update to $1\n/" \
+ --in-place *spec
+