]>
git.ipfire.org Git - thirdparty/sarg.git/blob - archive.sh
6 # check version number in every file
7 Version
=$
(cat "$Sources/CMakeLists.txt" |
sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p')
8 if [ -z "$Version" ] ; then
9 echo "No version found in CMakeLists.txt"
12 Revision
=$
(cat "$Sources/CMakeLists.txt" |
sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p')
13 if [ -z "$Revision" ] ; then
14 echo "No revision found in CMakeLists.txt"
17 Version
="$Version.$Revision"
19 VersionCheck
=$
(cat "$Sources/configure.in" |
sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p')
20 if [ -z "$VersionCheck" ] ; then
21 echo "No version found in configure.in"
24 if [ "x$Version" != "x$VersionCheck" ] ; then
25 echo "CMakeLists and configure doesn't refer to the same version"
30 ReleaseDate
=$
(cat "$Sources/CMakeLists.txt" |
sed -n -e 's/^SET(sarg_BUILDDATE "\([A-Z][a-z][a-z]-[0-3][0-9]-2[0-1][0-9][0-9]\)")/\1/p')
31 if [ -z "$ReleaseDate" ] ; then
32 echo "No release date found or release date is invalide in CMakeLists.txt"
36 ReleaseDateCheck
=$
(cat "$Sources/include/info.h" |
sed -n -e 's/^#define VERSION PACKAGE_VERSION" \([A-Z][a-z][a-z]-[0-3][0-9]-2[0-1][0-9][0-9]\)"/\1/p')
37 if [ -z "$ReleaseDateCheck" ] ; then
38 echo "No release date found or release date is invalide in include/info.h"
41 if [ "x$ReleaseDate" != "x$ReleaseDateCheck" ] ; then
42 echo "CMakeLists and include/info.h doesn't refer to the same release date"
47 if ( ! make update-po
) ; then
48 echo "Failed to update the po files"
52 # is the git repository dirty?
53 if [[ $
(git
diff --shortstat 2> /dev
/null
) != "" ]] ; then
54 echo "Git repository is dirty"
58 # check the working tree
59 if ( ! git diff-files
--quiet ) ; then
60 echo "Uncommitted changes in working tree"
64 # check the index for uncommitted changes
65 if ( ! git diff-index
--quiet --cached HEAD
) ; then
66 echo "Uncommitted changes in the index"
70 # check for untracked files
71 Untracked
="$(git ls-files --exclude-standard --others)"
72 if [[ -n "$Untracked" ]] ; then
73 echo "Untracked files in directory"
79 # a valid tag can be v2.3.3 or v2.3.3_da to indicate version 2.3.3 with the Danish translation
80 GitVersion
=$
(git describe |
sed -e 's/^\(v[0-9][0-9.]*\)_.*/\1/')
81 if [[ "$GitVersion" != "v$Version" ]] ; then
82 echo "Git tag not set for version $Version. Use command:"
83 echo "git tag -a \"v$Version\" -m \"v$Version\""
88 SargList
="$Target/sarglist.txt.unsort"
89 SortList
="$Target/sarglist.txt"
90 DirList
="$Target/sargdir.txt"
91 ExcludeList
="$Target/sargexclude.txt"
92 ArchiveFile
="$Target/sarg-$Version.tar"
94 SedSources
=$
(echo "$Sources" |
sed -e 's/\./\\./')
95 ls $Sources/*.c |
sed -e "s/^$SedSources\///" > $SargList
96 ls $Sources/include
/*.h |
sed -e "s/^$SedSources\///" >> $SargList
97 ls $Sources/po
/*.
{po
,gmo
,pot
} |
sed -e "s/^$SedSources\///" >> $SargList
130 po/remove-potcdate.sin
139 po/en@boldquot.header
142 sorttable/sorttable.js
145 [ -f "$DirList" ] && rm "$DirList"
146 cat $SargList |
while read file
148 [ -z "$file" ] && continue
149 if [ -f "$file" ] ; then
150 echo "$file" >> "$DirList"
151 elif [ -d "$file" ] ; then
152 find "$file" -type f
>> "$DirList"
154 echo "Unknown file type $file"
160 sort -u "$DirList" |
sed -e '/^$/d' > "$SortList"
171 tar cf
"$ArchiveFile" -C "$Sources" --files-from="$SortList" --exclude-from="$ExcludeList" --no-recursion --transform="s,^,sarg-$Version/," --owner root
--group root
--mode 644
172 tar rf
"$ArchiveFile" -C "$Sources" "configure" --exclude-from="$ExcludeList" --transform="s,^,sarg-$Version/," --owner root
--group root
--mode 755
173 gzip -f "$ArchiveFile"
174 CompressFile
="$ArchiveFile.gz"
176 md5sum $CompressFile > "$Target/sarg-$Version.md5sum"
178 cat "$Target/sarg-$Version.md5sum"
180 sha1sum $CompressFile > "$Target/sarg-$Version.sha1sum"
182 cat "$Target/sarg-$Version.sha1sum"
184 sha256sum
$CompressFile > "$Target/sarg-$Version.sha256sum"
186 cat "$Target/sarg-$Version.sha256sum"