flatcar-scripts/pkg_auto/generate_reports.sh
Krzesimir Nowak 4c5e550055 pkg-auto: Add package automation scripts
This adds some scripts I have been using for over a year to deal with
the weekly package updates.

It comes with a `README.md` which describes a workflow similar to my
own.

The `sync_packages.sh` and `update_packages.sh` scripts are currently
not used anywhere. The idea behind them was to use them for Github
Action, but that will come as a follow-up PR.
2024-11-27 16:00:57 +01:00

57 lines
966 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
##
## Generates reports.
##
## Parameters:
## -w: path to use for workdir
## -h: this help
##
## Positional:
## 1: config file
##
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/impl/util.sh"
source "${PKG_AUTO_IMPL_DIR}/pkg_auto_lib.sh"
workdir=''
while [[ ${#} -gt 0 ]]; do
case ${1} in
-h)
print_help
exit 0
;;
-w)
if [[ -z ${2:-} ]]; then
fail 'missing value for -w'
fi
workdir=${2}
shift 2
;;
--)
shift
break
;;
-*)
fail "unknown flag '${1}'"
;;
*)
break
;;
esac
done
if [[ ${#} -ne 1 ]]; then
fail 'expected one positional parameter: a config file'
fi
config_file=${1}; shift
setup_workdir_with_config "${workdir}" "${config_file}"
generate_package_update_reports