diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-05-09 04:21:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-05-09 04:21:55 +0000 |
commit | 453cc058d9ee6d7cb47529d99061216e72149a5f (patch) | |
tree | 38e3683d9cb52c2f181d65ba513554a5e1387f20 /bin/git-debian-check | |
parent | Initial commit. (diff) | |
download | progress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.tar.xz progress-linux-tools-453cc058d9ee6d7cb47529d99061216e72149a5f.zip |
Adding bin.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/git-debian-check')
-rwxr-xr-x | bin/git-debian-check | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/bin/git-debian-check b/bin/git-debian-check new file mode 100755 index 0000000..b4d5869 --- /dev/null +++ b/bin/git-debian-check @@ -0,0 +1,132 @@ +#!/bin/sh + +# source-tools - Manage Git repositories effectively and efficiently +# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# +# This program 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, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. + +set -e + +FEATURE_BRANCH="progress-linux" +MAINTAINER="Progress Linux Maintainers <maintainers@lists.progress-linux.org>" + +Main () +{ + REPOSITORY="$(basename $(git config --get remote.origin.url) .git)" + + echo "Checking ${REPOSITORY} repository:" + + # repository checks + for CHECK in /usr/lib/git-tools/repository-check.d/repository_* + do + ./${CHECK} + done + + ORIGINAL_BRANCH="$(git branch | awk '/^\* / { print $2 }')" + + case "${ORIGINAL_BRANCH}" in + ${FEATURE_BRANCH}) + ;; + + *) + git checkout ${FEATURE_BRANCH} + ;; + esac + + DISTRIBUTION="$(dpkg-parsechangelog | awk '/Distribution: / { print $2 }')" + + case ${DISTRIBUTION} in + *-extras) + BRANCHES="upstream ${FEATURE_BRANCH}" + ;; + + *) + BRANCHES="upstream debian ${FEATURE_BRANCH}" + ;; + esac + + # repository checks + for CHECK in /usr/lib/git-tools/repository-check.d/branch_* + do + ./${CHECK} + done + + BRANCHES="$(git branch | sed -e 's|^\* ||')" + + for BRANCH in ${BRANCHES} + do + case "${BRANCH}" in + upstream) + Branch_has_initial_empty_commit + ;; + esac + + # repository checks + for CHECK in /usr/lib/git-tools/repository-check.d/commit_* + do + ./${CHECK} + done + + # repository checks + for CHECK in /usr/lib/git-tools/repository-check.d/tag_* + do + ./${CHECK} + done + + # TODO: + # * git commits and tags have ever increasing commit date + done + + RELEASE="$(echo ${DISTRIBUTION} | sed -e 's|-extras||' -e 's|-security||' -e 's|-updates||')" + + VCS_BROWSER="https://sources.progress-linux.org/cgit/releases/${RELEASE}/packages" + VCS_GIT="git://sources.progress-linux.org/git/releases/${RELEASE}/packages" + + case "${REPOSITORY}" in + apt|dpkg|debian-archive-keyring|debian-keyring|clzip|lunzip|lzd|lzip|lziprecover|lzlib|pdlzip|plzip|zutils) + COMPRESSION="xz" + ;; + + *) + COMPRESSION="lzip" + ;; + esac + + # repository checks + for CHECK in /usr/lib/git-tools/repository-check.d/packaging_* + do + ./${CHECK} + done + + # TODO: + # * debian version + # * debian distribution + # * debian changelog entries + # * release tags only modify debian/changelog + + CURRENT_BRANCH="$(git branch | awk '/^\* / { print $2 }')" + + case "${CURRENT_BRANCH}" in + ${ORIGINAL_BRANCH}) + ;; + + *) + git checkout ${ORIGINAL_BRANCH} + ;; + esac + + echo "done." +} + +Main ${@} |