common-updater-scripts: add --print-changes flag
Printing the changed file and new version can be used to commit the changes to git.gstqt5
parent
5adbeb13c5
commit
d351cea9f3
|
@ -11,7 +11,7 @@ die() {
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $scriptName <attr> <version> [<new-source-hash>] [<new-source-url>]"
|
echo "Usage: $scriptName <attr> <version> [<new-source-hash>] [<new-source-url>]"
|
||||||
echo " [--version-key=<version-key>] [--system=<system>] [--file=<file-to-update>]"
|
echo " [--version-key=<version-key>] [--system=<system>] [--file=<file-to-update>]"
|
||||||
echo " [--ignore-same-hash]"
|
echo " [--ignore-same-hash] [--print-changes]"
|
||||||
}
|
}
|
||||||
|
|
||||||
args=()
|
args=()
|
||||||
|
@ -33,6 +33,9 @@ for arg in "$@"; do
|
||||||
--ignore-same-hash)
|
--ignore-same-hash)
|
||||||
ignoreSameHash="true"
|
ignoreSameHash="true"
|
||||||
;;
|
;;
|
||||||
|
--print-changes)
|
||||||
|
printChanges="true"
|
||||||
|
;;
|
||||||
--help)
|
--help)
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -102,6 +105,9 @@ fi
|
||||||
|
|
||||||
if [[ "$oldVersion" = "$newVersion" ]]; then
|
if [[ "$oldVersion" = "$newVersion" ]]; then
|
||||||
echo "$scriptName: New version same as old version, nothing to do." >&2
|
echo "$scriptName: New version same as old version, nothing to do." >&2
|
||||||
|
if [ -n "$printChanges" ]; then
|
||||||
|
printf '[]\n'
|
||||||
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -197,3 +203,7 @@ fi
|
||||||
|
|
||||||
rm -f "$nixFile.bak"
|
rm -f "$nixFile.bak"
|
||||||
rm -f "$attr.fetchlog"
|
rm -f "$attr.fetchlog"
|
||||||
|
|
||||||
|
if [ -n "$printChanges" ]; then
|
||||||
|
printf '[{"attrPath":"%s","oldVersion":"%s","newVersion":"%s","files":["%s"]}]\n' "$attr" "$oldVersion" "$newVersion" "$nixFile"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue