#!/bin/sh # source-tools - Manage Git repositories effectively and efficiently # Copyright (C) 2014-2017 Daniel Baumann # # 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 . set -e FEATURE_BRANCH="progress-linux" MAINTAINER="Progress Linux Maintainers " 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 ${@}