mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
This version is more logical, less ugly, and incorporates and as described in the Debian manual.
This commit is contained in:
parent
86b5ea39cb
commit
8508f7c594
67
debian/dch-generate.sh
vendored
67
debian/dch-generate.sh
vendored
@ -8,56 +8,59 @@
|
|||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# version 2 as published by the Free Software Foundation.
|
# version 2 as published by the Free Software Foundation.
|
||||||
|
|
||||||
# note: the following file has CRLF line endings (Windows)
|
# warning: the following file has CRLF line endings (Windows)
|
||||||
cbuild="../src/CurrentBuild.txt"
|
cbuild="../src/CurrentBuild.txt"
|
||||||
|
|
||||||
# required for debian packaging
|
# required for debian packaging
|
||||||
package="softether-vpn"
|
package="softether-vpn"
|
||||||
status="UNRELEASED"
|
status="UNRELEASED"
|
||||||
# timezone in +hh:mm from GMT
|
# timezone in +hh:mm from UTC (+9 UTC)
|
||||||
# assuming the orij. author is in Japan: +9 GMT
|
|
||||||
tzone="+09:00"
|
tzone="+09:00"
|
||||||
# builder name, builder email
|
|
||||||
builder="John Q. Sample"
|
|
||||||
email="tamade@example.org"
|
|
||||||
# static changelog entry
|
# static changelog entry
|
||||||
entry="* See: http://www.softether.org/5-download/history"
|
entry="* See: http://www.softether.org/5-download/history"
|
||||||
|
|
||||||
|
# are you a debian maintainer?
|
||||||
|
if [ ! -e "$DEBFULLNAME" ]; then
|
||||||
|
DEBFULLNAME="John Q. Sample"
|
||||||
|
fi
|
||||||
|
if [ ! -e "$DEBEMAIL" ]; then
|
||||||
|
DEBEMAIL="tamade@example.org"
|
||||||
|
fi
|
||||||
|
|
||||||
# check if ./changelog exists, check if $cbuild exists
|
# check if ./changelog exists, check if $cbuild exists
|
||||||
if [ ! -e ./changelog ]; then
|
if [ ! -e ./changelog ]; then
|
||||||
/bin/echo -ne "Are you in debian/? I can't find: ./changelog\n"
|
echo "Am I in debian/? I can't find changelog"
|
||||||
|
echo "Maybe run: touch debian/changelog ?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -e "$cbuild" ]; then
|
||||||
|
echo "This doesn't look like the SoftEtherVPN source tree. I can't find ""$cbuild"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $cbuild ]; then
|
# version and date info from $cbuild are put into array ${cbuildarray[@]}
|
||||||
/bin/echo -ne "This doesn't look like the SoftEtherVPN source tree. I can't find: src/CurrentBuild.txt\n"
|
# build "${cbuildarray[0]}", major version "${cbuildarray[1]}",
|
||||||
exit 1
|
# release type "${cbuildarray[2]}", and date "${cbuildarray[3]}"
|
||||||
fi
|
while IFS=$'\r\n' read -r line_data; do
|
||||||
|
cbuildarray[i]="${line_data##*[A-Z]\ }"
|
||||||
# parse version and date -- formatted in RFC 2822 format -- from ../src/CurrentBuild.txt
|
|
||||||
while IFS=$'\ ' read -r line_data; do
|
|
||||||
cbuildarray[i]=$(echo "${line_data}"| sed -e s/\\r// -e s/.*\ //)
|
|
||||||
((++i))
|
((++i))
|
||||||
done < $cbuild
|
done < "$cbuild"
|
||||||
|
|
||||||
#buildnumber="${cbuildarray[0]}"
|
# "${cbuildarray[1]}" is converted from "406" to "4.06" using GNU awk
|
||||||
#majorversion="${cbuildarray[1]}"
|
majorversion="$(echo "${cbuildarray[1]}" | awk '{sub(/[0-9]/,"&.",$0);print $0}')"
|
||||||
#releasetype="${cbuildarray[2]}"
|
|
||||||
#unparseddate="${cbuildarray[3]}"
|
|
||||||
|
|
||||||
# "${cbuildarray[1]}" needs to be converted
|
# "${cbuildarray[3]}" is split and the second half is converted from
|
||||||
# from "406" to "4.06"
|
# from "131655" to "13:16:55" using GNU awk then it's put back together
|
||||||
# this is really ugly and requires GNU awk (afaik)
|
# (like humpty dumpty) and sent to GNU date for conversion to UTC
|
||||||
version="$(echo "$(echo "${cbuildarray[1]}" | awk '{sub(/[0-9]/,"&.",$0);print $0}' )"".""${cbuildarray[0]}""-""${cbuildarray[2]}")"
|
time="$(echo ${cbuildarray[3]#*_} | awk '{gsub(/[0-9][0-9]/,"&:",$0);print $0}')"
|
||||||
|
date="$(date -R --date="$(echo "${cbuildarray[3]%_*}"" ""${time%?}""$tzone")")"
|
||||||
# "${cbuildarray[3]}" \needs\ to be converted
|
|
||||||
# from "20140321_131655" to "20140321 13:16:55+0900"
|
|
||||||
# this is really really ugly and requires GNU date and GNU awk (afaik)
|
|
||||||
convertformat="$(echo "$(echo "${cbuildarray[3]}" | sed s/_.*//)"" ""$(echo "${cbuildarray[3]}" | sed s/.*_// | awk '{gsub(/[0-9][0-9]/,"&:",$0);print $0}' | sed s/\:$//)")"
|
|
||||||
# now we send $convertformat and $tzone to `date` and have it automagically reformat it for us
|
|
||||||
date="$(date -R --date="$(echo "$convertformat""$tzone")")"
|
|
||||||
|
|
||||||
# print the new debian changelog
|
# print the new debian changelog
|
||||||
/bin/echo -ne "$package ($version) $status; urgency=low\n\n $entry\n\n -- $builder <$email> $date\n"
|
echo "$package"" (""$majorversion"".""${cbuildarray[0]}""-""${cbuildarray[2]}"") ""$status""; urgency=low"
|
||||||
|
echo
|
||||||
|
echo " ""$entry"
|
||||||
|
echo
|
||||||
|
echo " --"" ""$DEBFULLNAME"" <""$DEBEMAIL""> ""$date"
|
||||||
|
echo
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user