#!/bin/sh # 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 # the Free Software Foundation, version 3. # 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 . # Original author: Maciej Barć # Copyright (c) 2020, src_prepare group # Licensed under the GNU GPL v3 License trap 'exit 128' INT set -e export PATH FEATURES="sign" export FEATURES package_directory="$(git rev-parse --show-prefix)" package="${package_directory%/}" error_no_version() { printf "%s\n" \ "[ERROR]: No version given" \ " Ran with option: ${1}" >> /dev/stderr exit 1 } git add . case "${1}" in "" ) printf "%s\n" "[DEBUG]: no additional arguments/options given" >> /dev/stderr repoman commit ;; -b | --bump ) printf "%s\n" "[DEBUG]: to be: ${package}: bump to ${2}" if [ -n "${2}" ] then repoman commit -m "${package}: bump to ${2}" else error_no_version "${1}" fi ;; -d | --drop ) printf "%s\n" "[DEBUG]: to be: ${package}: drop old ${2}" if [ -n "${2}" ] then repoman commit -m "${package}: drop old ${2}" else error_no_version "${1}" fi ;; -* ) printf "%s\n" "[ERROR]: Unknown option ${1}" >> /dev/stderr exit 1 ;; * ) printf "%s\n" "[DEBUG]: to be: ${package}: ${*}" repoman commit -m "${package}: ${*}" ;; esac