From 32dcbf7747741ca361e07a4538fd2d886f956370 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 4 Feb 2010 09:55:28 +0000 Subject: [PATCH] separate out the process of installing a game pack into a .sh file, for later "adding gamepacks to binary releases" git-svn-id: svn://svn.icculus.org/netradiant/trunk@421 61c419a2-8eb2-4b30-bcec-8cead039b335 --- Makefile | 14 +------------- download-gamepacks.sh | 41 +++++++++++++++++++++++++++++++++++------ install-gamepack.sh | 23 +++++++++++++++++++++++ 3 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 install-gamepack.sh diff --git a/Makefile b/Makefile index e0de1809..3bfdfa19 100644 --- a/Makefile +++ b/Makefile @@ -958,19 +958,7 @@ install-data: binaries [ "$(OS)" != "Darwin" ] || $(CP_R) setup/data/osx/NetRadiant.app/* $(INSTALLDIR_BASE)/NetRadiant.app/ set -ex; \ for GAME in games/*; do \ - if [ x"$$GAME" = x"games/*" ]; then \ - echo; echo "*** NO GAME PACKS FOUND ***"; echo "Please run download-gamepacks.sh and try again."; echo; echo; \ - continue; \ - fi; \ - if [ -d "$$GAME/tools" ]; then \ - GAME=$$GAME/tools; \ - fi; \ - for GAMEFILE in $$GAME/games/*.game; do \ - $(CP) "$$GAMEFILE" $(INSTALLDIR)/games/; \ - done; \ - for GAMEDIR in $$GAME/*.game; do \ - $(CP_R) "$$GAMEDIR" $(INSTALLDIR)/; \ - done; \ + CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepack.sh "$$GAME" "$(INSTALLDIR)"; \ done $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR diff --git a/download-gamepacks.sh b/download-gamepacks.sh index 89cfe0c6..710dc021 100644 --- a/download-gamepacks.sh +++ b/download-gamepacks.sh @@ -4,6 +4,8 @@ # sh download-gamepack.sh # LICENSEFILTER=GPL BATCH=1 sh download-gamepack.sh +set -e + pack() { pack=$1; shift @@ -17,6 +19,18 @@ pack() svn) svn update "games/$pack" "$@" ;; + zip1) + rm -rf zipdownload + mkdir zipdownload + cd zipdownload + wget "$source" "$@" + unzip * + cd .. + rm -rf "games/$pack" + mkdir "games/$pack" + mv zipdownload/*/* "games/$pack/" + rm -rf zipdownload + ;; esac return fi @@ -70,13 +84,28 @@ pack() svn) svn checkout "$source" "games/$pack" "$@" ;; + zip1) + rm -rf zipdownload + mkdir zipdownload + cd zipdownload + wget "$source" "$@" + unzip * + cd .. + mkdir "games/$pack" + mv zipdownload/*/* "games/$pack/" + rm -rf zipdownload + ;; esac } mkdir -p games -pack NexuizPack GPL svn svn://svn.icculus.org/nexuiz/trunk/misc/netradiant-NexuizPack -pack Quake2WorldPack GPL svn svn://jdolan.dyndns.org/quake2world/trunk/gtkradiant -pack DarkPlacesPack GPL svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/DarkPlacesPack/branches/1.5/ -pack WarsowPack GPL svn http://opensvn.csie.org/warsowgamepack/netradiant/games/WarsowPack/ -pack Q3Pack proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Pack/trunk/ -r29 -pack UFOAIPack proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/branches/1.5/ +pack DarkPlacesPack GPL svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/DarkPlacesPack/branches/1.5/ +pack NexuizPack GPL svn svn://svn.icculus.org/nexuiz/trunk/misc/netradiant-NexuizPack +pack OpenArenaPack unknown zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/OpenArenaPack.zip +pack Q3Pack proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/Q3Pack/trunk/ -r29 +pack Quake2Pack proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/Quake2Pack.zip +pack Quake2WorldPack GPL svn svn://jdolan.dyndns.org/quake2world/trunk/gtkradiant +pack QuakePack proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/QuakePack.zip +pack TremulousPack proprietary zip1 http://ingar.satgnu.net/files/gtkradiant/gamepacks/TremulousPack.zip +pack UFOAIPack proprietary svn https://zerowing.idsoftware.com/svn/radiant.gamepacks/UFOAIPack/branches/1.5/ +pack WarsowPack GPL svn http://opensvn.csie.org/warsowgamepack/netradiant/games/WarsowPack/ diff --git a/install-gamepack.sh b/install-gamepack.sh new file mode 100644 index 00000000..4073d401 --- /dev/null +++ b/install-gamepack.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# installs a game pack +# Usage: +# install-gamepack.sh gamepack installdir + +set -ex + +: ${CP:=cp} +: ${CP_R:=cp -r} + +pack=$1 +dest=$2 + +if [ -d "$pack/tools" ]; then + pack="$pack/tools" +fi +for GAMEFILE in "$pack/games"/*.game; do + $CP "$GAMEFILE" "$dest/games/" +done +for GAMEDIR in "$pack"/*.game/; do + $CP_R "$GAMEDIR" "$dest/" +done -- 2.39.2