Skip to content

Commit

Permalink
Remove hardcoded version from grml2usb
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Hofstaedtler committed Dec 19, 2011
1 parent 894eef9 commit fdc186c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion debian/rules
Expand Up @@ -9,14 +9,16 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }')

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
dh_testdir

# Add here commands to compile the package.
egrep -q "PROG_VERSION='\*\*\*UNRELEASED\*\*\*'" grml2usb || (echo "PROG_VERSION in grml2usb wrong." && exit 2)
$(MAKE)
cd mbr && $(MAKE) && cd ..
touch build-stamp
Expand All @@ -39,6 +41,7 @@ install: build

# Add here commands to install the package into debian/grml2usb.
install -m 755 grml2usb debian/grml2usb/usr/sbin/grml2usb
sed -i -e "s/PROG_VERSION='\*\*\*UNRELEASED\*\*\*'/PROG_VERSION='$(VERSION)'/" debian/grml2usb/usr/sbin/grml2usb
install -m 755 grml2iso debian/grml2usb/usr/sbin/grml2iso
install -m 644 mbr/mbrmgr debian/grml2usb/usr/share/grml2usb/mbr/mbrmgr
install -m 644 mbr/mbrldr debian/grml2usb/usr/share/grml2usb/mbr/mbrldr
Expand Down
4 changes: 3 additions & 1 deletion grml2usb
Expand Up @@ -21,8 +21,10 @@ import glob
import uuid
import struct

# The line following this line is patched by debian/rules and tarball.sh.
PROG_VERSION='***UNRELEASED***'

# global variables
PROG_VERSION = "0.9.31"
MOUNTED = set() # register mountpoints
TMPFILES = set() # register tmpfiles
DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg
Expand Down
4 changes: 2 additions & 2 deletions tarball.sh
Expand Up @@ -8,8 +8,7 @@

set -e

VERSION="$(awk '/^PROG_VERSION/ { print $3}' grml2usb | tr -d \")"

VERSION=$(dpkg-parsechangelog | awk '/Version: / { print $2 }')
DIR="grml2usb-${VERSION}"
[ -d "$DIR" ] || mkdir "$DIR"

Expand Down Expand Up @@ -117,6 +116,7 @@ rm grml2usb-$VERSION/grml2iso.8.txt

# binaries, grub
cp grml2usb grml2iso mbr/mbrldr mbr/mbrmgr grub/* grml2usb-$VERSION/
sed -i -e "s/PROG_VERSION='\*\*\*UNRELEASED\*\*\*'/PROG_VERSION='${VERSION}'/" grml2usb-$VERSION/grml2usb

tar zcf grml2usb.tgz "${DIR}"

Expand Down

0 comments on commit fdc186c

Please sign in to comment.