]>
git.ipfire.org Git - thirdparty/sarg.git/blob - archive.sh
6 # check version number in every file
7 Version
=$
(sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p' "$Sources/CMakeLists.txt")
8 if [ -z "$Version" ] ; then
9 echo "No version found in CMakeLists.txt"
12 Revision
=$
(sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p' "$Sources/CMakeLists.txt")
13 if [ -z "$Revision" ] ; then
14 echo "No revision found in CMakeLists.txt"
17 Version
="$Version.$Revision"
19 VersionCheck
=$
(sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p' "$Sources/configure.in")
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"
29 if [ ! -f "$Sources/configure" ] ; then
30 echo "Configure script not created"
34 ConfigureCheck
=$
(sed -n -e "s/^PACKAGE_VERSION='\([0-9][0-9]*\.[0-9][0-9]*.*\)'/\1/p" "$Sources/configure")
35 if [ "x$Version" != "x$ConfigureCheck" ] ; then
36 echo "Configure script not updated"
42 ReleaseDate
=$
(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' "$Sources/CMakeLists.txt")
43 if [ -z "$ReleaseDate" ] ; then
44 echo "No release date found or release date is invalide in CMakeLists.txt"
48 ReleaseDateCheck
=$
(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' "$Sources/include/info.h")
49 if [ -z "$ReleaseDateCheck" ] ; then
50 echo "No release date found or release date is invalide in include/info.h"
53 if [ "x$ReleaseDate" != "x$ReleaseDateCheck" ] ; then
54 echo "CMakeLists and include/info.h doesn't refer to the same release date"
58 # make sure the ChangeLog has been updated
59 LogEntry
=$
(sed -n -e "1,5{;/^$ReleaseDate Version $Version$/p;}" $Sources/ChangeLog
)
60 if [ -z "$LogEntry" ] ; then
61 echo "ChangeLog not up to date"
62 echo "It should contain an entry for \"$ReleaseDate Version $Version\""
67 if ( ! make update-po
) ; then
68 echo "Failed to update the po files"
72 # is the git repository dirty?
73 if [[ $
(git
diff --shortstat 2> /dev
/null
) != "" ]] ; then
74 echo "Git repository is dirty"
78 # check the working tree
79 if ( ! git diff-files
--quiet ) ; then
80 echo "Uncommitted changes in working tree"
84 # check the index for uncommitted changes
85 if ( ! git diff-index
--quiet --cached HEAD
) ; then
86 echo "Uncommitted changes in the index"
90 # check for untracked files
91 Untracked
="$(git ls-files --exclude-standard --others)"
92 if [[ -n "$Untracked" ]] ; then
93 echo "Untracked files in directory"
99 # a valid tag can be v2.3.3 or v2.3.3_da to indicate version 2.3.3 with the Danish translation
100 GitVersion
=$
(git describe |
sed -e 's/^\(v[0-9][0-9.]*\)_.*/\1/')
101 if [[ "$GitVersion" != "v$Version" ]] ; then
102 echo "Git tag not set for version $Version. Use command:"
103 echo "git tag -a \"v$Version\" -m \"v$Version\""
107 # prepare the archive
108 SargList
="$Target/sarglist.txt.unsort"
109 SortList
="$Target/sarglist.txt"
110 DirList
="$Target/sargdir.txt"
111 ExcludeList
="$Target/sargexclude.txt"
112 ArchiveFile
="$Target/sarg-$Version.tar"
114 SedSources
=$
(echo "$Sources" |
sed -e 's/\./\\./')
115 ls $Sources/*.c |
sed -e "s/^$SedSources\///" > $SargList
116 ls $Sources/include
/*.h |
sed -e "s/^$SedSources\///" >> $SargList
117 ls $Sources/po
/*.
{po
,gmo
,pot
} |
sed -e "s/^$SedSources\///" >> $SargList
150 po/remove-potcdate.sin
159 po/en@boldquot.header
162 sorttable/sorttable.js
165 [ -f "$DirList" ] && rm "$DirList"
166 cat $SargList |
while read file
168 [ -z "$file" ] && continue
169 if [ -f "$file" ] ; then
170 echo "$file" >> "$DirList"
171 elif [ -d "$file" ] ; then
172 find "$file" -type f
>> "$DirList"
174 echo "Unknown file type $file"
180 sort -u "$DirList" |
sed -e '/^$/d' > "$SortList"
191 tar cf
"$ArchiveFile" -C "$Sources" --files-from="$SortList" --exclude-from="$ExcludeList" --no-recursion --transform="s,^,sarg-$Version/," --owner root
--group root
--mode 644
192 tar rf
"$ArchiveFile" -C "$Sources" "configure" --exclude-from="$ExcludeList" --transform="s,^,sarg-$Version/," --owner root
--group root
--mode 755
193 gzip -f "$ArchiveFile"
194 CompressFile
="$ArchiveFile.gz"
196 md5sum $CompressFile > "$Target/sarg-$Version.md5sum"
198 cat "$Target/sarg-$Version.md5sum"
200 sha1sum $CompressFile > "$Target/sarg-$Version.sha1sum"
202 cat "$Target/sarg-$Version.sha1sum"
204 sha256sum
$CompressFile > "$Target/sarg-$Version.sha256sum"
206 cat "$Target/sarg-$Version.sha256sum"