aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2013-09-03 15:55:18 +0000
committercassiopc <cassiopc@gmail.com>2013-09-03 15:55:18 +0000
commita322767d55859d63f229b86856a77b4a7b218275 (patch)
treecd68776831fac6d281cc8d0d1d0023c6628fe366 /tools
parent58fa2b0b160fc5599c961735017244cf24666dbc (diff)
downloadboca-a322767d55859d63f229b86856a77b4a7b218275.tar.gz
boca-a322767d55859d63f229b86856a77b4a7b218275.zip
fixed genpack to work with any directory name and included an extra pack in installv2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genpackage.sh18
-rwxr-xr-xtools/installv2.sh8
2 files changed, 18 insertions, 8 deletions
diff --git a/tools/genpackage.sh b/tools/genpackage.sh
index 9cfee7c..0f041c7 100755
--- a/tools/genpackage.sh
+++ b/tools/genpackage.sh
@@ -17,13 +17,20 @@
# ////////////////////////////////////////////////////////////////////////////////
# // Last modified 03/sep/2013 by cassio@ime.usp.br
cdir=`pwd`
+bocadir=$(dirname $cdir)
basen=`basename $cdir`
if [ ! -f "$cdir/genpackage.sh" -o "$basen" != "tools" ]; then
echo "Please run this script from its own directory in tools/ of the BOCA directory"
else
-ver=$(basename $(dirname $cdir) | cut -d'-' -f2-)
+if [ "$1" == "" ]; then
+ ver=$(basename $(dirname $cdir) | cut -d'-' -f2-)
+else
+ ver=$1
+fi
echo "*** Processing version $ver"
-cd ../..
+cd /tmp
+cp -a $bocadir boca-$ver
+rm -rf /tmp/boca-$ver/.git
if [ "$ver" != "" -a -d "boca-$ver" ]; then
echo "boca-$ver" > boca-$ver/src/version
echo -e "<?php\n\$BOCAVERSION='boca-$ver';\n\$YEAR='2013';\n?>\n" > boca-$ver/src/versionnum.php
@@ -40,10 +47,11 @@ rm boca-$ver/.temp `find boca-$ver/ -name "*~"`
touch boca-$ver/.temp
rm boca-$ver/.temp `find boca-$ver/ -name ".\#*"`
cd boca-$ver/tools/etc
-tar cvzf ../icpc.etc.tgz *
+tar czf ../icpc.etc.tgz *
cd ../../..
-tar czf boca-$ver.tgz boca-$ver/
-echo "*** file generated: `pwd`/boca-$ver.tgz"
+tar czf $cdir/boca-$ver.tgz boca-$ver/
+rm -rf /tmp/boca-$ver
+echo "*** file generated: $cdir/boca-$ver.tgz"
else
echo "*** boca-$ver not found"
fi
diff --git a/tools/installv2.sh b/tools/installv2.sh
index 85886b6..e35ce1a 100755
--- a/tools/installv2.sh
+++ b/tools/installv2.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# ////////////////////////////////////////////////////////////////////////////////
# //BOCA Online Contest Administrator
-# // Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
+# // Copyright (C) 2003-2013 by BOCA Development Team (bocasystem@gmail.com)
# //
# // This program is free software: you can redistribute it and/or modify
# // it under the terms of the GNU General Public License as published by
@@ -15,12 +15,14 @@
# // You should have received a copy of the GNU General Public License
# // along with this program. If not, see <http://www.gnu.org/licenses/>.
# ////////////////////////////////////////////////////////////////////////////////
-# // Last modified 06/aug/2012 by cassio@ime.usp.br
+# // Last modified 03/sep/2013 by cassio@ime.usp.br
#///////////////////////////////////////////////////////////////////////////////////////////
echo "#############################################################"
-echo "### installv2.sh of 06/Aug/2012 (A) by cassio@ime.usp.br ###"
+echo "### installv2.sh of 03/Sept/2013 (A) by cassio@ime.usp.br ###"
echo "#############################################################"
+apt-get install python-software-properties software-properties-common
+
for i in id chown chmod cut awk tail grep cat sed mkdir rm mv sleep apt-get add-apt-repository update-alternatives; do
p=`which $i`
if [ -x "$p" ]; then