summaryrefslogtreecommitdiff
path: root/scripts/cptarget
authorbrad <brad>2004-04-12 09:29:38 (UTC)
committer brad <brad>2004-04-12 09:29:38 (UTC)
commit837277f90e7e197ac60e99fb9b15fa0dbebaa4f5 (patch) (side-by-side diff)
tree6dc7c92a8fb8dad4d60699fd111810ea60f79503 /scripts/cptarget
parent2c087dc52d50eb9b13670254f70347d7b1147b20 (diff)
downloadopie-837277f90e7e197ac60e99fb9b15fa0dbebaa4f5.zip
opie-837277f90e7e197ac60e99fb9b15fa0dbebaa4f5.tar.gz
opie-837277f90e7e197ac60e99fb9b15fa0dbebaa4f5.tar.bz2
Script to create an rsyncable directory tree from an compiled opie source directory.
Kinda like a make install would do but with a couple of added features.
Diffstat (limited to 'scripts/cptarget') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/cptarget76
1 files changed, 76 insertions, 0 deletions
diff --git a/scripts/cptarget b/scripts/cptarget
new file mode 100755
index 0000000..66f049c
--- a/dev/null
+++ b/scripts/cptarget
@@ -0,0 +1,76 @@
+#!/bin/sh
+# This script creates a full destination copy of Opie ready to be rsynced
+# across to your handheld. It creates $TARGET/list which is a list of control
+# files it sees as valid packages from your compiled tree and by commenting
+# out a package from this file it will not be copied to your dest dir.
+# As new packages are compiled and seen as valid and complete it will append
+# these to the end of the existing list file. You can comment out as required.
+# I generally do a make && ./scripts/cptarget && /opt/target/load to do
+# crash and burn testing on my iPAQ.
+# /opt/target/load is a script that uses ssh to stop Opie, rsync to update it
+# it then re-generates the font-config files and restarts Opie.
+# Hope this is of some use to other people. Probably not though.
+# Most of it was ripped out of the mkipks script
+
+TARGET=/opt/target
+QTE_BASEVERSION=2.3.7
+rm -rf $TARGET/etc $TARGET/usr $TARGET/opt
+cd $OPIEDIR
+for i in `find . -name "*.control"` ; do
+ FILES=$(eval echo $(sed -n -e "s/^Files://p" $i))
+ RES=0
+ echo $i
+ for x in $FILES ; do
+ test -e $x || RES=1
+ echo $x $RES
+ done;
+if [ "$RES" -eq "0" ] ; then
+ control=`basename $i`
+ if [ -z "`sed -n /^$control/p $TARGET/list`" ] && [ -z "`sed -n /^#$control/p $TARGET/list`" ] ; then
+ echo $control >> $TARGET/list
+ fi;
+ if [ ! -z "`sed -n /^#$control/p $TARGET/list`" ] ; then
+ echo Aborting on comment $control
+ continue
+ fi;
+ for x in $FILES ; do
+ case $x in
+ */CVS/*)
+ continue
+ ;; *~)
+ continue
+ ;; *.control)
+ continue
+ ;; $QTDIR/*)
+ BASE=$(dirname /opt/QtPalmtop/${x#$QTDIR/})
+ ;; etc/*.d/*)
+ BASE=$(dirname /$x)
+ ;; root/*)
+ BASE=$(dirname ${x#root})
+ ;; lib/*)
+ BASE=$(dirname /opt/QtPalmtop/$x)
+ ;; $OPIEDIR/lib/*)
+ BASE=$(dirname /opt/QtPalmtop/${x#$OPIEDIR/})
+ ;; $OPIEDIR/root/*)
+ BASE=$(dirname /${x#$OPIEDIR/root/})
+ ;; *)
+ # For SHARP ROM compatibility. Should change to Qtopia.
+ BASE=/opt/QtPalmtop/$(dirname $x)
+ esac
+ t=`basename $x`
+ if [ "$t" = "CVS" ] ; then
+ continue
+ fi;
+ y=$BASE
+ echo $x $t $TARGET/$y
+ test -d $TARGET/$y || mkdir -p $TARGET/$y
+ touch -d "1/2/2004 12:00pm" $TARGET/$y
+ if [ -d $x ] ; then
+ cp -a $x $TARGET/$y/$t
+ else
+ cp -p --no-dereference $x $TARGET/$y/$t
+ fi;
+ done;
+fi;
+done;
+rm `find $TARGET -name CVS -type d` -rf