Files
demus-packaging/go2rpm-vendor-update.sh
T
demus bc57e1c0d2
Build and provide rpm of demus-packaging / Start build on COPR (f43) (release) Successful in 4m45s
Build and provide rpm of demus-packaging / Start build on COPR (rawhide) (release) Successful in 4m46s
Build and provide rpm of demus-packaging / Start build on COPR (f44) (release) Successful in 5m31s
Make ignoring unlicensed mods optional
2026-06-10 18:42:20 +02:00

31 lines
1018 B
Bash

#!/bin/bash
# Update go vendor archive and config using the options go2rpm uses
usage() {
echo "Usage: $0 [OPTION]... <SPEC_FILE>"
echo "Update go vendor archive and config for the <SPEC_FILE> using the options go2rpm."
echo
echo "Options:"
echo " -u Ignore unlicensed mods"
echo " -h Print this message and exit"
exit ${1:0}
}
while getopts "uh" flag; do
case "$flag" in
u) IGNORE_UNLICENSED_ARG=" --ignore-unlicensed-mods";;
h) usage;;
*) echo "Option $flag is unrecognized"; usage 1;;
esac
done
SPEC_FILE="${@:$OPTIND:1}"
if [ "$SPEC_FILE" == "" ] || ! [[ "$SPEC_FILE" =~ .*.\.spec$ ]] || [ ! -f "$SPEC_FILE" ]; then
echo "Required spec parameter missing or not a readable file ending in .spec"
usage 1
fi
go_vendor_archive create --config go-vendor-tools.toml --write-config "$SPEC_FILE"
go_vendor_license --config go-vendor-tools.toml --path "$SPEC_FILE" report --write-config --prompt --autofill auto --update-spec$IGNORE_UNLICENSED_ARG