blob: b4d5869f2bb28e8703ca9d78ec9762f8e840fc5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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 ${@}
|