[SCM] Installer for game data files branch, master, updated. efd46d96e303f4a3f010a93ae2ee1d6c68315639
Jon Dowland
jmtd at debian.org
Tue Sep 11 21:08:35 UTC 2012
The following commit has been merged in the master branch:
commit 8593ed5b840b3cd0c7cafffe4f8d2199706f5928
Author: Jon Dowland <jmtd at debian.org>
Date: Fri Sep 7 21:14:26 2012 +0100
fixup/clarify slipstream's behaviour + fix tests
The slipstream() method was used inconsistently between supported games.
The original implementation (with doom) would take a path and a file, and
put the file into a .deb package at the path supplied - /including the
filename/, e.g.
slipstream $deb foo/bar/baz/doom2.wad doom2.wad
=> file ./foo/bar/baz/doom2.wad
slipstream $deb foo/bar/baz/doom2.wad DOOM2.WAD
=> file ./foo/bar/baz/doom2.wad
slipstream $deb foo/bar/baz doom2.wad
=> file ./foo/bar/baz
Later, slipstream was adjusted to support multiple file arguments, which
meant the path was interpreted as a parent directory, rather than a final
path name for one file. The quake games needed this behaviour, and
slipstream was hacked to behave each way depending on the presence of a
'/' suffix.
This patch adjusts slipstream to always behave wiht the supplied path
being a directory, rather than a final pathname for the file. The
/-suffix behaviour switch is no longer needed. Adjust all callers as
necessary.
This introduces a bug for the doom packages: the filename of the wad
file is not canonicalized to doom.wad (or tnt.wad or whatever), so some
extra code is needed to resolve that.
Finally, fix the slipstream test in the testsuite. Slipstream now also
creates the path if it does not already exist.
diff --git a/doc/bugs/slipstream.mdwn b/doc/bugs/slipstream.mdwn
deleted file mode 100644
index 56677c5..0000000
--- a/doc/bugs/slipstream.mdwn
+++ /dev/null
@@ -1,28 +0,0 @@
-slipstream documentation is as follows
-
- slipstream(deb,relpath,file1,file2...)
- insert file1,file2... into the deb, under the
- path 'relpath', relative to the package root, e.g.:
- slipstream(deb, 'usr/share/doc', 'README', 'copyright')
- => /usr/share/doc/README
- => /usr/share/doc/copyright
-
-However, the relpath argument is passed through to `slipstream_file`,
-which names it locally `destpath`, copies the file to that location
-and invokes md5sum on it.
-
-Thus, if relpath is a directory, md5sum will be called for it and will
-fail.
-
-It is actually used by the doom code as relative file path, i.e.
-
- slipstream(deb,src,file1,file2...)
- insert file1,file2... into the deb, as filename
- 'src', relative to the package root, e.g.:
- slipstream(deb, 'usr/share/doc/file', 'README', 'copyright')
- => /usr/share/doc/file
-
-The file contents will be that of the last argument, 'copyright'.
-
-Both quake3 and rott need to insert multiple files. Each branch has solved
-this bug in a different way.
diff --git a/lib/doom-common b/lib/doom-common
index 2a5520f..88d1064 100644
--- a/lib/doom-common
+++ b/lib/doom-common
@@ -29,7 +29,7 @@ go() {
debug "WADFILE=$WADFILE"
check_for_v19
- DEST=`echo $WADDIR | sed 's,^/,,'`/$SHORTNAME.wad
+ DEST=`echo $WADDIR | sed 's,^/,,'`
OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
cp -p "$DEB" "$OUTFILE"
diff --git a/lib/game-data-packager-shared b/lib/game-data-packager-shared
index 2e33571..f37318f 100644
--- a/lib/game-data-packager-shared
+++ b/lib/game-data-packager-shared
@@ -121,14 +121,13 @@ slipstream() {
slipstream_permcheck "$DEB"
slipstream_unpack "$DEB"
+ if [ ! -d "$RELPATH" ]; then
+ mkdir -p "./slipstream.unpacked/$RELPATH"
+ fi
+
while [ "$#" -gt 0 ]; do
file="$1"
- destpath="$RELPATH"
- if [ "x${RELPATH%/}" != "x${RELPATH}" ]; then
- # RELPATH ends with /; append the basename of the
- # file (e.g. pak0.pk3)
- destpath="${RELPATH}${file##*/}"
- fi
+ destpath="${RELPATH}/${file##*/}"
slipstream_file "$file" "$destpath"
shift
done
diff --git a/supported/quake b/supported/quake
index b3887de..a471e52 100644
--- a/supported/quake
+++ b/supported/quake
@@ -227,10 +227,10 @@ common_method() {
[ "$pak1" = "" ] || ln -s "$pak1" "$WORKDIR/pak1.pak"
if [ "$pak1" = "" ]; then
- slipstream "$OUTFILE" "usr/share/games/quake/${folder}/" \
+ slipstream "$OUTFILE" "usr/share/games/quake/${folder}" \
"$WORKDIR/pak0.pak"
else
- slipstream "$OUTFILE" "usr/share/games/quake/${folder}/" \
+ slipstream "$OUTFILE" "usr/share/games/quake/${folder}" \
"$WORKDIR/pak0.pak" "$WORKDIR/pak1.pak"
fi
[ -d "$WORKDIR/${folder}" ] && rm -rf "$WORKDIR/${folder}"
diff --git a/supported/quake3 b/supported/quake3
index 7437a7e..42f3ac9 100644
--- a/supported/quake3
+++ b/supported/quake3
@@ -111,8 +111,7 @@ go() {
check_sums
unpack_point
- # the trailing / tells slipstream to treat it as a directory
- DEST="${BASEQ3#/}"/
+ DEST="${BASEQ3#/}"
# smcv FIXME: copied from lib/doom-common
if [ "" = "$OUTDIR" ]; then
diff --git a/tests/runtests b/tests/runtests
index 139bc53..c9e6747 100755
--- a/tests/runtests
+++ b/tests/runtests
@@ -73,7 +73,7 @@ test_slipstream() {
cp -p "$debsrc" "$deb"
WORKDIR="$wd"
slipstream "$deb" "foo/bar/baz" "$file"
- dpkg-deb -c "$deb" | grep "/foo/bar/baz$" >/dev/null
+ dpkg-deb -c "$deb" | grep "/foo/bar/baz/testfile$" >/dev/null
assertEquals $? 0
rm "$deb"
--
Installer for game data files
More information about the Pkg-games-commits
mailing list