src/commit-ebuild: rework; add options to quickly bump or drop pkgs

Signed-off-by: Maciej Barć <xgqt@riseup.net>
This commit is contained in:
Maciej Barć 2021-04-08 23:57:45 +02:00
parent 8945817ba4
commit e2cd817f72
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A

View File

@ -25,21 +25,53 @@ set -e
export PATH export PATH
pdir="$(git rev-parse --show-prefix)"
FEATURES="sign" FEATURES="sign"
export FEATURES export FEATURES
package_directory="$(git rev-parse --show-prefix)"
package="${package_directory%/}"
error_no_version() {
echo "[ERROR]: No version given"
echo " Ran with option: ${1}"
exit 1
}
git add . git add .
if [ -z "${1}" ] case "${1}"
then in
"" )
echo "[DEBUG]: no additional arguments/options given"
repoman commit repoman commit
;;
-b | --bump )
echo "[DEBUG]: to be: ${package}: bump to ${2}"
if [ -n "${2}" ]
then
repoman commit -m "${package}: bump to ${2}"
else else
repoman commit -m "${pdir%/}: ${*}" error_no_version "${1}"
fi fi
;;
git pull --verbose -d | --drop )
git push --verbose echo "[DEBUG]: to be: ${package}: drop old ${2}"
if [ -n "${2}" ]
then
repoman commit -m "${package}: drop old ${2}"
else
error_no_version "${1}"
fi
;;
-* )
echo "[ERROR]: Unknown option ${1}"
exit 1
;;
* )
echo "[DEBUG]: to be: ${package}: ${*}"
repoman commit -m "${package}: ${*}"
;;
esac