2020-12-19 13:28:47 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
2020-12-29 21:21:17 +01:00
|
|
|
# This file is part of scripts.
|
|
|
|
|
|
|
|
# scripts is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2021-03-29 13:02:30 +02:00
|
|
|
# the Free Software Foundation, version 3.
|
2020-12-29 21:21:17 +01:00
|
|
|
|
|
|
|
# scripts is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2021-04-18 02:02:15 +02:00
|
|
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
2020-12-22 01:52:05 +01:00
|
|
|
# Copyright (c) 2020, src_prepare group
|
2020-12-29 21:21:17 +01:00
|
|
|
# Licensed under the GNU GPL v3 License
|
2020-12-22 01:52:05 +01:00
|
|
|
|
|
|
|
|
2020-12-19 13:28:47 +01:00
|
|
|
trap 'exit 128' INT
|
|
|
|
set -e
|
|
|
|
export PATH
|
|
|
|
|
|
|
|
|
|
|
|
FEATURES="sign"
|
|
|
|
export FEATURES
|
|
|
|
|
|
|
|
|
2021-04-08 23:57:45 +02:00
|
|
|
package_directory="$(git rev-parse --show-prefix)"
|
|
|
|
package="${package_directory%/}"
|
|
|
|
|
2020-12-19 13:28:47 +01:00
|
|
|
|
2021-04-08 23:57:45 +02:00
|
|
|
error_no_version() {
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" \
|
|
|
|
"[ERROR]: No version given" \
|
|
|
|
" Ran with option: ${1}" >> /dev/stderr
|
2021-04-08 23:57:45 +02:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
git add .
|
2020-12-19 13:28:47 +01:00
|
|
|
|
2021-04-08 23:57:45 +02:00
|
|
|
case "${1}"
|
|
|
|
in
|
|
|
|
"" )
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" "[DEBUG]: no additional arguments/options given" >> /dev/stderr
|
2021-04-08 23:57:45 +02:00
|
|
|
repoman commit
|
|
|
|
;;
|
|
|
|
-b | --bump )
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" "[DEBUG]: to be: ${package}: bump to ${2}"
|
2021-04-08 23:57:45 +02:00
|
|
|
if [ -n "${2}" ]
|
|
|
|
then
|
|
|
|
repoman commit -m "${package}: bump to ${2}"
|
|
|
|
else
|
|
|
|
error_no_version "${1}"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
-d | --drop )
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" "[DEBUG]: to be: ${package}: drop old ${2}"
|
2021-04-08 23:57:45 +02:00
|
|
|
if [ -n "${2}" ]
|
|
|
|
then
|
|
|
|
repoman commit -m "${package}: drop old ${2}"
|
|
|
|
else
|
|
|
|
error_no_version "${1}"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
-* )
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" "[ERROR]: Unknown option ${1}" >> /dev/stderr
|
2021-04-08 23:57:45 +02:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
* )
|
2021-06-04 10:19:26 +02:00
|
|
|
printf "%s\n" "[DEBUG]: to be: ${package}: ${*}"
|
2021-04-08 23:57:45 +02:00
|
|
|
repoman commit -m "${package}: ${*}"
|
|
|
|
;;
|
|
|
|
esac
|