Changeset View
Changeset View
Standalone View
Standalone View
Tools/scripts/bump-revision.sh
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | echo -n > $tempfile | ||||
fi | fi | ||||
;; | ;; | ||||
1) | 1) | ||||
# If the exit code is 1 then PORTREVISION wasn't found, so we need to add one with value of 1 | # If the exit code is 1 then PORTREVISION wasn't found, so we need to add one with value of 1 | ||||
printc "INFO: $1 PORTREVISION not found, adding PORTREVISION= 1" "green" | printc "INFO: $1 PORTREVISION not found, adding PORTREVISION= 1" "green" | ||||
rm -f $tempfile && awk '/^(PORT|DIST)VERSION\??=\t/{ print; print "PORTREVISION=\t1"; next } { print }' "$1/Makefile" > $tempfile \ | rm -f $tempfile && awk '/^(PORT|DIST)VERSION\??=\t/{ print; print "PORTREVISION=\t1"; next } { print }' "$1/Makefile" > $tempfile \ | ||||
&& cat $tempfile > "$1/Makefile" | && cat $tempfile > "$1/Makefile" | ||||
# If there is not PORTREVISION line, maybe it is a slave port, try | # If there is not PORTREVISION line, maybe it is a slave port, try | ||||
# to add it before a CATEGORIES, PKGNAMESUFFIX or PKGNAMEPREFIX line: | # to add it before a PORTEPOCH, CATEGORIES, PKGNAMESUFFIX or | ||||
for line in CATEGORIES PKGNAMEPREFIX PKGNAMESUFFIX; do | # PKGNAMEPREFIX line: | ||||
for line in PORTEPOCH CATEGORIES PKGNAMEPREFIX PKGNAMESUFFIX; do | |||||
if ! grep -q "^PORTREVISION?\?=" $1/Makefile; then | if ! grep -q "^PORTREVISION?\?=" $1/Makefile; then | ||||
rm -f $tempfile && awk '/^'${line}'\??=\t/{ print "PORTREVISION=\t1"; print; next } { print }' "$1/Makefile" > $tempfile \ | rm -f $tempfile && awk '/^'${line}'\??=\t/{ print "PORTREVISION=\t1"; print; next } { print }' "$1/Makefile" > $tempfile \ | ||||
&& cat $tempfile > "$1/Makefile" | && cat $tempfile > "$1/Makefile" | ||||
fi | fi | ||||
done | done | ||||
# If it still is not there, bail out | # If it still is not there, bail out | ||||
if ! grep -q "^PORTREVISION?\?=" $1/Makefile; then | if ! grep -q "^PORTREVISION?\?=" $1/Makefile; then | ||||
printc "ERROR: $1 PORTREVISION not found and failed to add it!" "red" | printc "ERROR: $1 PORTREVISION not found and failed to add it!" "red" | ||||
Show All 13 Lines |