summaryrefslogtreecommitdiff
path: root/scripts
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /scripts
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'scripts') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/README26
-rwxr-xr-xscripts/mkPackages24
-rwxr-xr-xscripts/mkconfigs9
-rwxr-xr-xscripts/mkmakefile23
-rwxr-xr-xscripts/pack58
-rwxr-xr-xscripts/q_add_application49
-rwxr-xr-xscripts/q_add_class36
-rwxr-xr-xscripts/q_add_function88
-rwxr-xr-xscripts/q_add_variable70
-rwxr-xr-xscripts/q_cvs_add17
-rwxr-xr-xscripts/q_cvs_edit17
-rwxr-xr-xscripts/q_cvs_submit17
-rwxr-xr-xscripts/q_functions232
-rwxr-xr-xscripts/updateipks29
14 files changed, 695 insertions, 0 deletions
diff --git a/scripts/README b/scripts/README
new file mode 100644
index 0000000..54295bb
--- a/dev/null
+++ b/scripts/README
@@ -0,0 +1,26 @@
1
2These scripts are for convienence only.
3
4Use them at your own risk.
5
6Especially q_add_variable and q_add_function,
7however when used they should leave behind a backup copy of the
8header file it has tried to modify. Sometimes those two scripts
9find headers that it decides it can't parse and leaves it up to
10the user to edit them manually.
11
12But even still I would highly recommend backing up your files
13or using this in conjuction with some kind of CVS like system.
14
15The script to add a new application is the most useful script
16and creates a very basic QPE app from a template with most of
17the files you need.
18
19Currently these scripts don't integrate with a CVS system and
20add or edit the created/modified files with the repository, you
21have to do that manually, however I have started to make a few
22scripts that are generic repository accessing scripts that
23could be made to work with either p4 or cvs or something else.
24
25John
26
diff --git a/scripts/mkPackages b/scripts/mkPackages
new file mode 100755
index 0000000..5734f1c
--- a/dev/null
+++ b/scripts/mkPackages
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3for i in *.ipk
4do
5 packagename=${i%%_*}
6 #echo >&2 "$packagename..."
7 GOOD=y
8 for other in ${packagename}_*
9 do
10 if [ $i != $other -a $other -nt $i ]
11 then
12 GOOD=
13 break
14 fi
15 done
16 if [ -n "$GOOD" ]
17 then
18 tar xfOz $i ./control.tar.gz | tar xfOz - ./control
19 echo
20 else
21 echo >&2 "Skipped old file: $i ($other is newer)"
22 #mv $i old
23 fi
24done >Packages
diff --git a/scripts/mkconfigs b/scripts/mkconfigs
new file mode 100755
index 0000000..6a2e6a2
--- a/dev/null
+++ b/scripts/mkconfigs
@@ -0,0 +1,9 @@
1#!/usr/bin/perl
2
3system('rm -f configs/linux-*');
4for $p ( split /\s+/, `\$QTDIR/util/scripts/mkconfigs -p qws` ) {
5 system("cp \$QTDIR/$p configs");
6 if ( $ARGV[0] eq '-v' ) {
7 print "$p\n";
8 }
9}
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
new file mode 100755
index 0000000..1d21a2e
--- a/dev/null
+++ b/scripts/mkmakefile
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3if [ $# -lt 1 ]
4then
5 echo "Usage: mkmakefile <dir> ..."
6 exit 1
7fi
8
9while [ $# -gt 0 ]
10do
11 DIR=`echo $1 | sed -e 's/\/$//'`
12 echo "Making $DIR/Makefile.in..."
13 H=`pwd`
14 cd $DIR
15 FILE=`basename $DIR`
16 TMAKEPATH=$QTDIR/tmake:$TMAKEPATH tmake CONFIG+=embedded -t $H/qt/tmake/propagate.t -o Makefile.in $FILE.pro
17 echo "Done."
18 shift
19 cd -
20done
21
22exit 0
23
diff --git a/scripts/pack b/scripts/pack
new file mode 100755
index 0000000..26a530a
--- a/dev/null
+++ b/scripts/pack
@@ -0,0 +1,58 @@
1#!/usr/bin/perl
2
3$QTDIR=$ENV{QTDIR};
4$base=`pwd`;
5
6# Directory structure
7system("rm -rf usr-ipaq/lib/qt/*/*");
8system("mkdir -p usr-ipaq/lib/qt/etc/fonts");
9system("mkdir -p usr-ipaq/lib/qt/apps");
10system("mkdir -p usr-ipaq/lib/qt/bin");
11system("mkdir -p usr-ipaq/lib/qt/docs");
12system("mkdir -p usr-ipaq/lib/qt/lib");
13system("mkdir -p usr-ipaq/lib/qt/pics");
14system("mkdir -p usr-ipaq/lib/qt/video");
15
16# The app
17#system("cp single/qpe usr-ipaq/lib/qt/bin/");
18system("cp -r bin usr-ipaq/lib/qt/");
19system("cp -a $QTDIR/lib/libqte.so* usr-ipaq/lib/");
20system("cp -a $QTDIR/lib/libqpe.so* usr-ipaq/lib/");
21
22# Media
23system("cp -r apps usr-ipaq/lib/qt");
24system("cp -a docs usr-ipaq/lib/qt");
25system("cp -r pics usr-ipaq/lib/qt");
26system("cp -r i18n usr-ipaq/lib/qt; rm usr-ipaq/lib/qt/i18n/*/*.po");
27system("cp -r video usr-ipaq/lib/qt");
28system("cp -r sounds usr-ipaq/lib/qt");
29
30# This is for future use when a library will need to be included
31# Library
32# system("cd usr-ipaq/lib/qt/lib ; ".
33# "cp -r $QTDIR/lib/libqte.so.2.2 ./ ; ".
34# "ln -s libqte.so.2.2 libqte.so.2 ; ".
35# "ln -s libqte.so.2.2 libqte.so ; ".
36# "cd -");
37
38# Fonts
39system("cp $QTDIR/etc/fonts/fontdir ".
40 "$QTDIR/etc/fonts/helvetica_* ".
41 "$QTDIR/etc/fonts/fixed_* ".
42 "$QTDIR/etc/fonts/micro_* ".
43 "$QTDIR/etc/fonts/smallsmooth_* ".
44 "$QTDIR/etc/fonts/cyberbit_120_50_t10.qpf ".
45 "$QTDIR/etc/fonts/smoothtimes_{170,100}_50*.qpf ".
46 "usr-ipaq/lib/qt/etc/fonts/");
47system("mkdir -p usr-ipaq/lib/qt/etc/dict/");
48
49# IM files
50system("cp etc/dict/*dawg* usr-ipaq/lib/qt/etc/dict/");
51system("cp -r etc/qimpen usr-ipaq/lib/qt/etc/");
52
53# Themery
54system("cp -r etc/colors usr-ipaq/lib/qt/etc/");
55
56# Clean
57system("find usr-ipaq -name CVS | xargs rm -r");
58system("find usr-ipaq -name '*~' | xargs rm ");
diff --git a/scripts/q_add_application b/scripts/q_add_application
new file mode 100755
index 0000000..f9d259f
--- a/dev/null
+++ b/scripts/q_add_application
@@ -0,0 +1,49 @@
1#!/bin/sh
2#
3# Script to add a new application to the Qtopia Environment
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9# load the helper functions
10. q_functions
11
12
13if [ $# -lt 2 ]
14then
15echo "Usage: q_add_application NewAppName NewAppsMainClassName [MenuItemName] [Description]"
16print_example_usage
17exit
18fi
19
20
21NEW_APP_NAME=$1
22NEW_CLASS_NAME=$2
23NEW_APP_MENU_NAME=$NEW_CLASS_NAME
24NEW_APP_DESCRIPTION=$NEW_CLASS_NAME
25[ $# -lt 3 ] || NEW_APP_MENU_NAME=$3
26[ $# -lt 4 ] || NEW_APP_DESCRIPTION=$4
27
28
29NEW_APP_FOLDER=$NEW_APP_NAME
30NEW_APP_PRO_FILE="$NEW_APP_NAME".pro
31NEW_APP_DESKTOP_FILE="$NEW_APP_NAME".desktop
32NEW_APP_ICON_FILE="$NEW_APP_NAME"_icon.xpm
33NEW_APP_MAIN_FILE=main.cpp
34NEW_CLASS_HEADER_FILE="$NEW_APP_NAME".h
35NEW_CLASS_SOURCE_FILE="$NEW_APP_NAME".cpp
36NEW_CLASS_HEADER_DEFINE=__`echo $NEW_APP_NAME | tr [a-z] [A-Z]`_H__
37
38
39[ -d $NEW_APP_FOLDER ] || mkdir $NEW_APP_FOLDER
40print_source_file >> $NEW_APP_FOLDER/$NEW_CLASS_SOURCE_FILE
41print_header_file >> $NEW_APP_FOLDER/$NEW_CLASS_HEADER_FILE
42print_main_file >> $NEW_APP_FOLDER/$NEW_APP_MAIN_FILE
43print_pro_file >> $NEW_APP_FOLDER/$NEW_APP_PRO_FILE
44print_desktop_file >> $NEW_APP_FOLDER/$NEW_APP_DESKTOP_FILE
45print_icon_file >> $NEW_APP_FOLDER/$NEW_APP_ICON_FILE
46print_install_file >> $NEW_APP_FOLDER/install
47chmod u+x $NEW_APP_FOLDER/install
48
49
diff --git a/scripts/q_add_class b/scripts/q_add_class
new file mode 100755
index 0000000..6146e1e
--- a/dev/null
+++ b/scripts/q_add_class
@@ -0,0 +1,36 @@
1#!/bin/sh
2#
3# Script to add a new class to an existing application
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9# load the helper functions
10. q_functions
11
12
13if [ $# -lt 2 ]
14then
15echo "Usage: q_add_class ExistingAppName NewClassName"
16print_example_usage
17exit
18fi
19
20
21EXISTING_APP_NAME=$1
22NEW_CLASS_NAME=$2
23
24
25NEW_CLASS_NAME_LOWER=`echo $NEW_CLASS_NAME | tr [A-Z] [a-z]`
26NEW_CLASS_HEADER_FILE="$NEW_CLASS_NAME_LOWER".h
27NEW_CLASS_SOURCE_FILE="$NEW_CLASS_NAME_LOWER".cpp
28NEW_CLASS_HEADER_DEFINE=__`echo $NEW_CLASS_NAME | tr [a-z] [A-Z]`_H__
29EXISTING_PRO_FILE="$EXISTING_APP_NAME".pro
30
31
32 print_source_file>> $NEW_CLASS_SOURCE_FILE
33 print_header_file>> $NEW_CLASS_HEADER_FILE
34 add_class_to_pro_file>> $EXISTING_PRO_FILE
35
36
diff --git a/scripts/q_add_function b/scripts/q_add_function
new file mode 100755
index 0000000..cc14db7
--- a/dev/null
+++ b/scripts/q_add_function
@@ -0,0 +1,88 @@
1#!/bin/sh
2#
3# Script to add a new function to an existing class
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9# load the helper functions
10. q_functions
11
12
13if [ $# -lt 4 ]
14then
15echo "Usage: q_add_function AccessModifier RetType ExistingClassName NewFunctionName ArgList"
16print_example_usage
17exit
18fi
19
20
21ACCESS_MODIFIER=$1
22RET_TYPE=$2
23EXISTING_CLASS_NAME=`echo $3 | cut -d ":" -f 1`
24NEW_FUNCTION_NAME=`echo $3 | cut -d ":" -f 3`
25ARG_LIST=$4
26
27
28EXISTING_CLASS_NAME_LOWER=`echo $EXISTING_CLASS_NAME | tr "[A-Z]" "[a-z]"`
29EXISTING_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h
30EXISTING_CLASS_SOURCE_FILE="$EXISTING_CLASS_NAME_LOWER".cpp
31ORIGINAL_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h.orig
32
33
34function print_source_file
35{
36cat << END
37
38
39$RET_TYPE $EXISTING_CLASS_NAME::$NEW_FUNCTION_NAME$ARG_LIST
40{
41}
42END
43}
44
45
46function print_function_definition
47{
48cat << END
49$ACCESS_MODIFIER
50 $RET_TYPE $NEW_FUNCTION_NAME$ARG_LIST;
51END
52}
53
54
55function print_new_header_file
56{
57get_number_of_lines
58get_first_line_of_class_definition
59if [ -z "$LINE" ]
60then
61cat << END
62/*
63 No good, can't find $EXISTING_CLASS_NAME class definition anywhere.
64 You'll have to manually edit the header file to add the
65 following function definition to the $EXISTING_CLASS_NAME class:
66
67END
68print_function_definition
69echo -e "\n*/"
70cat $ORIGINAL_CLASS_HEADER_FILE
71else
72head -n $LINE $ORIGINAL_CLASS_HEADER_FILE
73print_function_definition
74tail -n `expr $LINES - $LINE` $ORIGINAL_CLASS_HEADER_FILE
75fi
76}
77
78
79[ -f $EXISTING_CLASS_HEADER_FILE ] || { echo "file $EXISTING_CLASS_HEADER_FILE not found" ; exit ; }
80
81# Backup file
82mv $EXISTING_CLASS_HEADER_FILE $ORIGINAL_CLASS_HEADER_FILE
83
84
85print_source_file >> $EXISTING_CLASS_SOURCE_FILE
86print_new_header_file >> $EXISTING_CLASS_HEADER_FILE
87
88
diff --git a/scripts/q_add_variable b/scripts/q_add_variable
new file mode 100755
index 0000000..e35b8de
--- a/dev/null
+++ b/scripts/q_add_variable
@@ -0,0 +1,70 @@
1#!/bin/sh
2#
3# Script to add a new function to an existing class
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9# load the helper functions
10. q_functions
11
12
13if [ $# -lt 3 ]
14then
15echo "Usage: q_add_variable AccessModifier: Type ExistingClassName::NewVariableName"
16print_example_usage
17exit
18fi
19
20
21ACCESS_MODIFIER=$1
22TYPE=$2
23EXISTING_CLASS_NAME=`echo $3 | cut -d ":" -f 1`
24NEW_VARIABLE_NAME=`echo $3 | cut -d ":" -f 3`
25
26
27EXISTING_CLASS_NAME_LOWER=`echo $EXISTING_CLASS_NAME | tr "[A-Z]" "[a-z]"`
28EXISTING_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h
29ORIGINAL_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h.orig
30
31
32function print_variable_definition
33{
34cat << END
35$ACCESS_MODIFIER
36 $TYPE $NEW_VARIABLE_NAME;
37END
38}
39
40
41function print_new_header_file
42{
43get_number_of_lines
44get_first_line_of_class_definition
45if [ -z "$LINE" ]
46then
47cat << END
48/*
49 No good, can't find $EXISTING_CLASS_NAME class definition anywhere.
50 You'll have to manually edit the header file to add the
51 following variable definition to the $EXISTING_CLASS_NAME class:
52
53END
54print_variable_definition
55echo -e "\n*/"
56cat $ORIGINAL_CLASS_HEADER_FILE
57else
58head -n $LINE $ORIGINAL_CLASS_HEADER_FILE
59print_variable_definition
60tail -n `expr $LINES - $LINE` $ORIGINAL_CLASS_HEADER_FILE
61fi
62}
63
64
65[ -f $EXISTING_CLASS_HEADER_FILE ] || { echo "file $EXISTING_CLASS_HEADER_FILE not found" ; exit ; }
66# Backup file
67mv $EXISTING_CLASS_HEADER_FILE $ORIGINAL_CLASS_HEADER_FILE
68print_new_header_file >> $EXISTING_CLASS_HEADER_FILE
69
70
diff --git a/scripts/q_cvs_add b/scripts/q_cvs_add
new file mode 100755
index 0000000..693b672
--- a/dev/null
+++ b/scripts/q_cvs_add
@@ -0,0 +1,17 @@
1#!/bin/sh
2#
3# Adds a file to which ever repository is appropriate
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9if [ $P4PORT = "lupinella:866" ]
10then
11 p4 add $@
12else
13 echo Need to put some kind of cvs command here in q_cvs_add !!
14 # cvs add $@
15fi
16
17
diff --git a/scripts/q_cvs_edit b/scripts/q_cvs_edit
new file mode 100755
index 0000000..73a04db
--- a/dev/null
+++ b/scripts/q_cvs_edit
@@ -0,0 +1,17 @@
1#!/bin/sh
2#
3# Adds a file to which ever repository is appropriate
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9if [ $P4PORT = "lupinella:866" ]
10then
11 p4 edit $@
12else
13 echo Need to put some kind of cvs command here in q_cvs_edit !!
14 # cvs edit $@
15fi
16
17
diff --git a/scripts/q_cvs_submit b/scripts/q_cvs_submit
new file mode 100755
index 0000000..6b2b759
--- a/dev/null
+++ b/scripts/q_cvs_submit
@@ -0,0 +1,17 @@
1#!/bin/sh
2#
3# Adds a file to which ever repository is appropriate
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9if [ $P4PORT = "lupinella:866" ]
10then
11 p4 submit $@
12else
13 echo Need to put some kind of cvs command here in q_cvs_submit !!
14 # cvs submit $@
15fi
16
17
diff --git a/scripts/q_functions b/scripts/q_functions
new file mode 100755
index 0000000..cf2c2e1
--- a/dev/null
+++ b/scripts/q_functions
@@ -0,0 +1,232 @@
1#!/bin/sh
2#
3# Common helper functions used by the other scripts
4#
5# Copyright 1999-2000 Trolltech AS. All rights reserved.
6#
7
8
9function print_example_usage
10{
11cat << END
12Example of what you do:
13 ~/qpe$ q_add_application foo Foo MyFooBarApp "A FooBar Application"
14 ~/qpe$ cd foo
15 ~/qpe/foo$ q_add_class foo Bar
16 ~/qpe/foo$ q_add_function public: void Bar::barFoo "( int a, int b )"
17 ~/qpe/foo$ q_add_variable private: int Bar::fooBarInt
18END
19}
20
21
22function print_copyright_header
23{
24cat << END
25/**********************************************************************
26** Copyright (C) 2000 Trolltech AS. All rights reserved.
27**
28** This file is part of Qtopia Environment.
29**
30** This file may be distributed and/or modified under the terms of the
31** GNU General Public License version 2 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file.
34**
35** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
36** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
37**
38** See http://www.trolltech.com/gpl/ for GPL licensing information.
39**
40** Contact info@trolltech.com if any conditions of this licensing are
41** not clear to you.
42**
43**********************************************************************/
44END
45}
46
47
48function print_main_file
49{
50print_copyright_header
51cat << END
52#include <qpeapplication.h>
53#include <qmainwindow.h>
54#include "$NEW_CLASS_HEADER_FILE"
55
56
57int main( int argc, char ** argv )
58{
59 QPEApplication a( argc, argv );
60
61 $NEW_CLASS_NAME *m = new $NEW_CLASS_NAME();
62 a.setMainWidget( m );
63 m->show();
64
65 return a.exec();
66}
67END
68}
69
70
71function print_source_file
72{
73print_copyright_header
74cat << END
75#include <qwidget.h>
76#include <pixmaploader.h>
77#include "$NEW_CLASS_HEADER_FILE"
78
79
80$NEW_CLASS_NAME::$NEW_CLASS_NAME( QWidget *parent=0, const char *name=0, WFlags f = 0) :
81 QWidget( parent, name, f )
82{
83}
84
85
86void $NEW_CLASS_NAME::exampleFunction( )
87{
88}
89END
90}
91
92
93function print_header_file
94{
95print_copyright_header
96cat << END
97#ifndef $NEW_CLASS_HEADER_DEFINE
98#define $NEW_CLASS_HEADER_DEFINE
99
100
101#include <qwidget.h>
102
103
104class $NEW_CLASS_NAME : public QWidget
105{
106Q_OBJECT
107public:
108 $NEW_CLASS_NAME( QWidget *parent=0, const char *name=0, WFlags f = 0);
109protected:
110 void exampleFunction( );
111private:
112 int exampleVariable;
113};
114
115
116#endif // $NEW_CLASS_HEADER_DEFINE
117END
118}
119
120
121function print_pro_file
122{
123cat << END
124 TEMPLATE= app
125 CONFIG = qt warn_on release
126 DESTDIR = ../bin
127 HEADERS = $NEW_CLASS_HEADER_FILE
128 SOURCES = $NEW_CLASS_SOURCE_FILE $NEW_APP_MAIN_FILE
129 INTERFACES=
130 INCLUDEPATH+= ../library
131 DEPENDPATH+= ../library
132LIBS += -lqpe
133 TARGET = $NEW_APP_NAME
134END
135}
136
137
138function print_install_file
139{
140cat << END
141#!/bin/sh
142if [ a\$QPEDIR = a ]
143then
144echo QPEDIR must be set
145exit
146fi
147[ -f \$QPEDIR/pics/$NEW_APP_ICON_FILE ] || cp $NEW_APP_ICON_FILE \$QPEDIR/pics/
148[ -f \$QPEDIR/apps/$NEW_APP_DESKTOP_FILE ] || cp $NEW_APP_DESKTOP_FILE \$QPEDIR/apps/
149mv \$QPEDIR/Makefile \$QPEDIR/Makefile.orig
150sed "s/APPS=/&$NEW_APP_NAME \\\\\\\\ \\\\
151 /" \$QPEDIR/Makefile.orig >> \$QPEDIR/Makefile
152echo You may wish to move the desktop file in to
153echo an appropriate subdirectory of the menus.
154END
155}
156
157
158function print_desktop_file
159{
160cat << END
161[Desktop Entry]
162Type=Application
163Exec=$NEW_APP_NAME
164Icon=$NEW_APP_ICON_FILE
165Name=$NEW_APP_MENU_NAME
166Comment=$NEW_APP_DESCRIPTION
167END
168}
169
170
171function print_icon_file
172{
173XPM_NAME="$NEW_APP_NAME"_xpm
174cat << END
175/* XPM */
176static char *$XPM_NAME[] = {
177"14 14 3 1",
178 " c None",
179 ".c #000000",
180 "ac #FFFFFF",
181" ",
182" aaaaaaaaaaaa ",
183" a..........a ",
184" a..aaaaaa..a ",
185" a.a.aaaa.a.a ",
186" a.aa.aa.aa.a ",
187" a.aaa..aaa.a ",
188" a.aaa..aaa.a ",
189" a.aa.aa.aa.a ",
190" a.a.aaaa.a.a ",
191" a..aaaaaa..a ",
192" a..........a ",
193" aaaaaaaaaaaa ",
194" "};
195END
196}
197
198
199function add_class_to_pro_file
200{
201cat << END
202 HEADERS += $NEW_CLASS_HEADER_FILE
203 SOURCES += $NEW_CLASS_SOURCE_FILE
204END
205}
206
207
208function get_number_of_lines
209{
210# Get the number of lines in the file
211LINES=`wc -l $ORIGINAL_CLASS_HEADER_FILE | cut -d " " -f 6`
212}
213
214
215function get_first_line_of_class_definition
216{
217# First look for class definition with Q_OBJECT a few lines below
218LINE=`grep -n -A 3 "class $EXISTING_CLASS_NAME " $ORIGINAL_CLASS_HEADER_FILE | grep "Q_OBJECT" | cut -d "-" -f 1`
219if [ -z "$LINE" ]
220then
221# else look for class definition with open brace on same line
222LINE=`grep -n "class $EXISTING_CLASS_NAME.*[{]" $ORIGINAL_CLASS_HEADER_FILE | cut -d ":" -f 1`
223#elif doesn't work here
224fi;if [ -z "$LINE" ]
225then
226# else look for class with open brace a few lines below
227LINE=`grep -n -A 3 "class $EXISTING_CLASS_NAME " $ORIGINAL_CLASS_HEADER_FILE | grep "\-.*[{]" | cut -d "-" -f 1`
228#elif doesn't work here
229fi
230}
231
232
diff --git a/scripts/updateipks b/scripts/updateipks
new file mode 100755
index 0000000..3195f26
--- a/dev/null
+++ b/scripts/updateipks
@@ -0,0 +1,29 @@
1#!/bin/sh
2
3RHOST=qpe.sf.net
4RDIR=/home/groups/q/qp/qpe/htdocs/packages/ipaq/unstable/
5
6NEW=""
7rm -f *.ipk
8ssh $RHOST -C "cd $RDIR; ls *.ipk" >currentipks &
9./mkipks "$@"
10wait # for ssh
11
12for i in *.ipk
13do
14 if grep -q $i currentipks
15 then
16 rm $i
17 else
18 NEW="$NEW $i";
19 fi
20done
21
22if [ -n "$NEW" ]
23then
24 scp $NEW $RHOST:$RDIR
25 rm $NEW
26 ssh $RHOST -C "cd $RDIR; chmod g+w *.ipk; ./mkPackages"
27fi
28
29rm currentipks