Skip to content

Commit

Permalink
Update deb/rpm to new dmd versioning scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordi committed Jan 27, 2014
1 parent 88e98fc commit 52a1e55
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 22 deletions.
10 changes: 7 additions & 3 deletions linux/build_all.sh
Expand Up @@ -89,15 +89,19 @@ fi


# check version parameter
if ! [[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]$ || $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]]
VER_TYPE=0
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-b"[0-9]+$ ]] && VER_TYPE=1
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-rc"[0-9]+$ ]] && VER_TYPE=2
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]] && VER_TYPE=10
if [ $VER_TYPE -eq 0 ]
then
ferror "incorrect version number" "try '`basename $0` -h' for more information."
elif test ${VER:0:1} -ne 2
then
ferror "for dmd v2 only" "try '`basename $0` -h' for more information."
elif test ${VER:0:1}${VER:2:3} -lt 2063
elif test ${VER:0:1}${VER:2:3} -lt 2065
then
ferror "dmd v2.063 and newer only" "try '`basename $0` -h' for more information."
ferror "dmd v2.065 and newer only" "try '`basename $0` -h' for more information."
fi


Expand Down
17 changes: 11 additions & 6 deletions linux/dmd_deb.sh
Expand Up @@ -46,15 +46,19 @@ if test "${1:0:2}" != "-v" ;then
ferror "Unknown first argument (-v)" "Exiting..."
else
VER="${1:2}"
if ! [[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]$ || $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]]
VER_TYPE=0
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-b"[0-9]+$ ]] && VER_TYPE=1
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-rc"[0-9]+$ ]] && VER_TYPE=2
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]] && VER_TYPE=10
if [ $VER_TYPE -eq 0 ]
then
ferror "incorrect version number" "Exiting..."
ferror "incorrect version number" "try '`basename $0` -h' for more information."
elif test ${VER:0:1} -ne 2
then
ferror "for dmd v2 only" "Exiting..."
elif test ${VER:0:1}${VER:2:3} -lt 2063
ferror "for dmd v2 only" "try '`basename $0` -h' for more information."
elif test ${VER:0:1}${VER:2:3} -lt 2065
then
ferror "dmd v2.063 and newer only" "Exiting..."
ferror "dmd v2.065 and newer only" "try '`basename $0` -h' for more information."
fi
fi

Expand Down Expand Up @@ -107,6 +111,7 @@ DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
UNZIPDIR="dmd2"
DMDURL="http://ftp.digitalmars.com/dmd.$VERSION.zip"
VERSION=$(sed 's/-/~/' <<<$VERSION) # replace dash by tilde
if test "$2" = "-m64" ;then
ARCH="amd64"
elif test "$2" = "-m32" ;then
Expand Down Expand Up @@ -301,7 +306,7 @@ else
Installed-Size: '$(du -ks usr/ | awk '{print $1}')'
Depends: '$DEPENDS'
Suggests: '$SUGGESTS'
Provides: dmd'$MINOR'
Provides: '$UNZIPDIR-$MINOR'
Section: devel
Priority: optional
Homepage: http://dlang.org/
Expand Down
19 changes: 12 additions & 7 deletions linux/dmd_phobos.sh
Expand Up @@ -46,15 +46,19 @@ if test "${1:0:2}" != "-v" ;then
ferror "Unknown first argument (-v)" "Exiting..."
else
VER="${1:2}"
if ! [[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]$ || $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]]
VER_TYPE=0
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-b"[0-9]+$ ]] && VER_TYPE=1
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-rc"[0-9]+$ ]] && VER_TYPE=2
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]] && VER_TYPE=10
if [ $VER_TYPE -eq 0 ]
then
ferror "incorrect version number" "Exiting..."
ferror "incorrect version number" "try '`basename $0` -h' for more information."
elif test ${VER:0:1} -ne 2
then
ferror "for dmd v2 only" "Exiting..."
elif test ${VER:0:1}${VER:2:3} -lt 2063
ferror "for dmd v2 only" "try '`basename $0` -h' for more information."
elif test ${VER:0:1}${VER:2:3} -lt 2065
then
ferror "dmd v2.063 and newer only" "Exiting..."
ferror "dmd v2.065 and newer only" "try '`basename $0` -h' for more information."
fi
fi

Expand Down Expand Up @@ -107,6 +111,7 @@ DESTDIR=`pwd`
TEMPDIR='/tmp/'`date +"%s%N"`
UNZIPDIR="dmd2"
DMDURL="http://ftp.digitalmars.com/dmd.$VERSION.zip"
VERSION=$(sed 's/-/~/' <<<$VERSION) # replace dash by tilde
if test "$2" = "-m64" ;then
ARCH="amd64"
elif test "$2" = "-m32" ;then
Expand Down Expand Up @@ -210,8 +215,8 @@ else
Installed-Size: '$(du -ks usr/ | awk '{print $1}')'
Pre-Depends: multiarch-support
Depends: '$DEPENDS'
Conflicts: dmd'$MINOR'
Replaces: dmd'$MINOR'
Conflicts: '$UNZIPDIR-$MINOR'
Replaces: '$UNZIPDIR-$MINOR'
Section: libs
Priority: optional
Multi-Arch: same
Expand Down
17 changes: 11 additions & 6 deletions linux/dmd_rpm.sh
Expand Up @@ -46,15 +46,19 @@ if test "${1:0:2}" != "-v" ;then
ferror "Unknown first argument (-v)" "Exiting..."
else
VER="${1:2}"
if ! [[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]$ || $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]]
VER_TYPE=0
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-b"[0-9]+$ ]] && VER_TYPE=1
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$"-rc"[0-9]+$ ]] && VER_TYPE=2
[[ $VER =~ ^[0-9]"."[0-9][0-9][0-9]"."[0-9]+$ ]] && VER_TYPE=10
if [ $VER_TYPE -eq 0 ]
then
ferror "incorrect version number" "Exiting..."
ferror "incorrect version number" "try '`basename $0` -h' for more information."
elif test ${VER:0:1} -ne 2
then
ferror "for dmd v2 only" "Exiting..."
elif test ${VER:0:1}${VER:2:3} -lt 2063
ferror "for dmd v2 only" "try '`basename $0` -h' for more information."
elif test ${VER:0:1}${VER:2:3} -lt 2065
then
ferror "dmd v2.063 and newer only" "Exiting..."
ferror "dmd v2.065 and newer only" "try '`basename $0` -h' for more information."
fi
fi

Expand Down Expand Up @@ -107,6 +111,7 @@ do
TEMPDIR='/tmp/'`date +"%s%N"`
UNZIPDIR="dmd2"
DMDURL="http://ftp.digitalmars.com/dmd.$VERSION.zip"
VERSION=$(sed 's/-/~/' <<<$VERSION) # replace dash by tilde
if test "$2" = "-m64" ;then
ARCH="x86_64"
FARCH="x86-64"
Expand All @@ -121,7 +126,7 @@ do


# check if destination rpm file already exist
if `rpm -qip $DESTDIR"/"$RPMFILE &>/dev/null` && test "$3" != "-f" ;then
if [ -f $DESTDIR"/"$RPMFILE ] && `rpm -qip $DESTDIR"/"$RPMFILE &>/dev/null` && test "$3" != "-f" ;then
echo -e "$RPMFILE - already exist"
else
# remove bad formated rpm file
Expand Down

0 comments on commit 52a1e55

Please sign in to comment.