generated from demus/basic-rpm-template
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
31 lines
1018 B
Bash
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
|