From 588819da30d1e4875a3460b3f59c5b809af01373 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 5 Feb 2024 09:02:45 +0100 Subject: helpers for noarch using 8.2 --- pkgup | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pkgup') diff --git a/pkgup b/pkgup index 0cdbc52..4ae31ce 100755 --- a/pkgup +++ b/pkgup @@ -6,13 +6,18 @@ rpmdate=${rpmdate/ 0/ } name=$(basename $PWD) if [ $# -lt 2 ]; then - echo "usage $0 version commit" + echo "usage $0 version commit [ date [ spec ]]" exit 1 fi if [ x$3 = x ]; then + date=$(date +%Y-%m-%d) +else + date=$3 +fi +if [ x$4 = x ]; then name=$(basename $PWD) else - name=$(basename $3 .spec) + name=$(basename $4 .spec) fi sed --regexp-extended \ @@ -20,6 +25,7 @@ sed --regexp-extended \ --expression "/github_version/s/[0-9.]+$/$1/" \ --expression "/upstream_version/s/[0-9.]+$/$1/" \ --expression "/(github|gh)_commit/s/[0-9a-f]{40}$/$2/" \ + --expression "/(github|gh)_date/s/[0-9\-]{10}$/$date/" \ --expression '/^Release:/s/[0-9.]+/1/' \ --expression "s/%changelog/%changelog\n* $rpmdate $vendor - $1-1\n- update to $1\n/" \ --in-place $name.spec -- cgit