-rwxr-xr-x | scripts/cptarget | 76 |
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 @@ | |||
1 | #!/bin/sh | ||
2 | # This script creates a full destination copy of Opie ready to be rsynced | ||
3 | # across to your handheld. It creates $TARGET/list which is a list of control | ||
4 | # files it sees as valid packages from your compiled tree and by commenting | ||
5 | # out a package from this file it will not be copied to your dest dir. | ||
6 | # As new packages are compiled and seen as valid and complete it will append | ||
7 | # these to the end of the existing list file. You can comment out as required. | ||
8 | # I generally do a make && ./scripts/cptarget && /opt/target/load to do | ||
9 | # crash and burn testing on my iPAQ. | ||
10 | # /opt/target/load is a script that uses ssh to stop Opie, rsync to update it | ||
11 | # it then re-generates the font-config files and restarts Opie. | ||
12 | # Hope this is of some use to other people. Probably not though. | ||
13 | # Most of it was ripped out of the mkipks script | ||
14 | |||
15 | TARGET=/opt/target | ||
16 | QTE_BASEVERSION=2.3.7 | ||
17 | rm -rf $TARGET/etc $TARGET/usr $TARGET/opt | ||
18 | cd $OPIEDIR | ||
19 | for i in `find . -name "*.control"` ; do | ||
20 | FILES=$(eval echo $(sed -n -e "s/^Files://p" $i)) | ||
21 | RES=0 | ||
22 | echo $i | ||
23 | for x in $FILES ; do | ||
24 | test -e $x || RES=1 | ||
25 | echo $x $RES | ||
26 | done; | ||
27 | if [ "$RES" -eq "0" ] ; then | ||
28 | control=`basename $i` | ||
29 | if [ -z "`sed -n /^$control/p $TARGET/list`" ] && [ -z "`sed -n /^#$control/p $TARGET/list`" ] ; then | ||
30 | echo $control >> $TARGET/list | ||
31 | fi; | ||
32 | if [ ! -z "`sed -n /^#$control/p $TARGET/list`" ] ; then | ||
33 | echo Aborting on comment $control | ||
34 | continue | ||
35 | fi; | ||
36 | for x in $FILES ; do | ||
37 | case $x in | ||
38 | */CVS/*) | ||
39 | continue | ||
40 | ;; *~) | ||
41 | continue | ||
42 | ;; *.control) | ||
43 | continue | ||
44 | ;; $QTDIR/*) | ||
45 | BASE=$(dirname /opt/QtPalmtop/${x#$QTDIR/}) | ||
46 | ;; etc/*.d/*) | ||
47 | BASE=$(dirname /$x) | ||
48 | ;; root/*) | ||
49 | BASE=$(dirname ${x#root}) | ||
50 | ;; lib/*) | ||
51 | BASE=$(dirname /opt/QtPalmtop/$x) | ||
52 | ;; $OPIEDIR/lib/*) | ||
53 | BASE=$(dirname /opt/QtPalmtop/${x#$OPIEDIR/}) | ||
54 | ;; $OPIEDIR/root/*) | ||
55 | BASE=$(dirname /${x#$OPIEDIR/root/}) | ||
56 | ;; *) | ||
57 | # For SHARP ROM compatibility. Should change to Qtopia. | ||
58 | BASE=/opt/QtPalmtop/$(dirname $x) | ||
59 | esac | ||
60 | t=`basename $x` | ||
61 | if [ "$t" = "CVS" ] ; then | ||
62 | continue | ||
63 | fi; | ||
64 | y=$BASE | ||
65 | echo $x $t $TARGET/$y | ||
66 | test -d $TARGET/$y || mkdir -p $TARGET/$y | ||
67 | touch -d "1/2/2004 12:00pm" $TARGET/$y | ||
68 | if [ -d $x ] ; then | ||
69 | cp -a $x $TARGET/$y/$t | ||
70 | else | ||
71 | cp -p --no-dereference $x $TARGET/$y/$t | ||
72 | fi; | ||
73 | done; | ||
74 | fi; | ||
75 | done; | ||
76 | rm `find $TARGET -name CVS -type d` -rf | ||