author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /scripts | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
-rw-r--r-- | scripts/README | 26 | ||||
-rwxr-xr-x | scripts/mkPackages | 24 | ||||
-rwxr-xr-x | scripts/mkconfigs | 9 | ||||
-rwxr-xr-x | scripts/mkmakefile | 23 | ||||
-rwxr-xr-x | scripts/pack | 58 | ||||
-rwxr-xr-x | scripts/q_add_application | 49 | ||||
-rwxr-xr-x | scripts/q_add_class | 36 | ||||
-rwxr-xr-x | scripts/q_add_function | 88 | ||||
-rwxr-xr-x | scripts/q_add_variable | 70 | ||||
-rwxr-xr-x | scripts/q_cvs_add | 17 | ||||
-rwxr-xr-x | scripts/q_cvs_edit | 17 | ||||
-rwxr-xr-x | scripts/q_cvs_submit | 17 | ||||
-rwxr-xr-x | scripts/q_functions | 232 | ||||
-rwxr-xr-x | scripts/updateipks | 29 |
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 | |||
2 | These scripts are for convienence only. | ||
3 | |||
4 | Use them at your own risk. | ||
5 | |||
6 | Especially q_add_variable and q_add_function, | ||
7 | however when used they should leave behind a backup copy of the | ||
8 | header file it has tried to modify. Sometimes those two scripts | ||
9 | find headers that it decides it can't parse and leaves it up to | ||
10 | the user to edit them manually. | ||
11 | |||
12 | But even still I would highly recommend backing up your files | ||
13 | or using this in conjuction with some kind of CVS like system. | ||
14 | |||
15 | The script to add a new application is the most useful script | ||
16 | and creates a very basic QPE app from a template with most of | ||
17 | the files you need. | ||
18 | |||
19 | Currently these scripts don't integrate with a CVS system and | ||
20 | add or edit the created/modified files with the repository, you | ||
21 | have to do that manually, however I have started to make a few | ||
22 | scripts that are generic repository accessing scripts that | ||
23 | could be made to work with either p4 or cvs or something else. | ||
24 | |||
25 | John | ||
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 | |||
3 | for i in *.ipk | ||
4 | do | ||
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 | ||
24 | done >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 | |||
3 | system('rm -f configs/linux-*'); | ||
4 | for $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 | |||
3 | if [ $# -lt 1 ] | ||
4 | then | ||
5 | echo "Usage: mkmakefile <dir> ..." | ||
6 | exit 1 | ||
7 | fi | ||
8 | |||
9 | while [ $# -gt 0 ] | ||
10 | do | ||
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 - | ||
20 | done | ||
21 | |||
22 | exit 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 | ||
7 | system("rm -rf usr-ipaq/lib/qt/*/*"); | ||
8 | system("mkdir -p usr-ipaq/lib/qt/etc/fonts"); | ||
9 | system("mkdir -p usr-ipaq/lib/qt/apps"); | ||
10 | system("mkdir -p usr-ipaq/lib/qt/bin"); | ||
11 | system("mkdir -p usr-ipaq/lib/qt/docs"); | ||
12 | system("mkdir -p usr-ipaq/lib/qt/lib"); | ||
13 | system("mkdir -p usr-ipaq/lib/qt/pics"); | ||
14 | system("mkdir -p usr-ipaq/lib/qt/video"); | ||
15 | |||
16 | # The app | ||
17 | #system("cp single/qpe usr-ipaq/lib/qt/bin/"); | ||
18 | system("cp -r bin usr-ipaq/lib/qt/"); | ||
19 | system("cp -a $QTDIR/lib/libqte.so* usr-ipaq/lib/"); | ||
20 | system("cp -a $QTDIR/lib/libqpe.so* usr-ipaq/lib/"); | ||
21 | |||
22 | # Media | ||
23 | system("cp -r apps usr-ipaq/lib/qt"); | ||
24 | system("cp -a docs usr-ipaq/lib/qt"); | ||
25 | system("cp -r pics usr-ipaq/lib/qt"); | ||
26 | system("cp -r i18n usr-ipaq/lib/qt; rm usr-ipaq/lib/qt/i18n/*/*.po"); | ||
27 | system("cp -r video usr-ipaq/lib/qt"); | ||
28 | system("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 | ||
39 | system("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/"); | ||
47 | system("mkdir -p usr-ipaq/lib/qt/etc/dict/"); | ||
48 | |||
49 | # IM files | ||
50 | system("cp etc/dict/*dawg* usr-ipaq/lib/qt/etc/dict/"); | ||
51 | system("cp -r etc/qimpen usr-ipaq/lib/qt/etc/"); | ||
52 | |||
53 | # Themery | ||
54 | system("cp -r etc/colors usr-ipaq/lib/qt/etc/"); | ||
55 | |||
56 | # Clean | ||
57 | system("find usr-ipaq -name CVS | xargs rm -r"); | ||
58 | system("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 | |||
13 | if [ $# -lt 2 ] | ||
14 | then | ||
15 | echo "Usage: q_add_application NewAppName NewAppsMainClassName [MenuItemName] [Description]" | ||
16 | print_example_usage | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | |||
21 | NEW_APP_NAME=$1 | ||
22 | NEW_CLASS_NAME=$2 | ||
23 | NEW_APP_MENU_NAME=$NEW_CLASS_NAME | ||
24 | NEW_APP_DESCRIPTION=$NEW_CLASS_NAME | ||
25 | [ $# -lt 3 ] || NEW_APP_MENU_NAME=$3 | ||
26 | [ $# -lt 4 ] || NEW_APP_DESCRIPTION=$4 | ||
27 | |||
28 | |||
29 | NEW_APP_FOLDER=$NEW_APP_NAME | ||
30 | NEW_APP_PRO_FILE="$NEW_APP_NAME".pro | ||
31 | NEW_APP_DESKTOP_FILE="$NEW_APP_NAME".desktop | ||
32 | NEW_APP_ICON_FILE="$NEW_APP_NAME"_icon.xpm | ||
33 | NEW_APP_MAIN_FILE=main.cpp | ||
34 | NEW_CLASS_HEADER_FILE="$NEW_APP_NAME".h | ||
35 | NEW_CLASS_SOURCE_FILE="$NEW_APP_NAME".cpp | ||
36 | NEW_CLASS_HEADER_DEFINE=__`echo $NEW_APP_NAME | tr [a-z] [A-Z]`_H__ | ||
37 | |||
38 | |||
39 | [ -d $NEW_APP_FOLDER ] || mkdir $NEW_APP_FOLDER | ||
40 | print_source_file >> $NEW_APP_FOLDER/$NEW_CLASS_SOURCE_FILE | ||
41 | print_header_file >> $NEW_APP_FOLDER/$NEW_CLASS_HEADER_FILE | ||
42 | print_main_file >> $NEW_APP_FOLDER/$NEW_APP_MAIN_FILE | ||
43 | print_pro_file >> $NEW_APP_FOLDER/$NEW_APP_PRO_FILE | ||
44 | print_desktop_file >> $NEW_APP_FOLDER/$NEW_APP_DESKTOP_FILE | ||
45 | print_icon_file >> $NEW_APP_FOLDER/$NEW_APP_ICON_FILE | ||
46 | print_install_file >> $NEW_APP_FOLDER/install | ||
47 | chmod 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 | |||
13 | if [ $# -lt 2 ] | ||
14 | then | ||
15 | echo "Usage: q_add_class ExistingAppName NewClassName" | ||
16 | print_example_usage | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | |||
21 | EXISTING_APP_NAME=$1 | ||
22 | NEW_CLASS_NAME=$2 | ||
23 | |||
24 | |||
25 | NEW_CLASS_NAME_LOWER=`echo $NEW_CLASS_NAME | tr [A-Z] [a-z]` | ||
26 | NEW_CLASS_HEADER_FILE="$NEW_CLASS_NAME_LOWER".h | ||
27 | NEW_CLASS_SOURCE_FILE="$NEW_CLASS_NAME_LOWER".cpp | ||
28 | NEW_CLASS_HEADER_DEFINE=__`echo $NEW_CLASS_NAME | tr [a-z] [A-Z]`_H__ | ||
29 | EXISTING_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 | |||
13 | if [ $# -lt 4 ] | ||
14 | then | ||
15 | echo "Usage: q_add_function AccessModifier RetType ExistingClassName NewFunctionName ArgList" | ||
16 | print_example_usage | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | |||
21 | ACCESS_MODIFIER=$1 | ||
22 | RET_TYPE=$2 | ||
23 | EXISTING_CLASS_NAME=`echo $3 | cut -d ":" -f 1` | ||
24 | NEW_FUNCTION_NAME=`echo $3 | cut -d ":" -f 3` | ||
25 | ARG_LIST=$4 | ||
26 | |||
27 | |||
28 | EXISTING_CLASS_NAME_LOWER=`echo $EXISTING_CLASS_NAME | tr "[A-Z]" "[a-z]"` | ||
29 | EXISTING_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h | ||
30 | EXISTING_CLASS_SOURCE_FILE="$EXISTING_CLASS_NAME_LOWER".cpp | ||
31 | ORIGINAL_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h.orig | ||
32 | |||
33 | |||
34 | function print_source_file | ||
35 | { | ||
36 | cat << END | ||
37 | |||
38 | |||
39 | $RET_TYPE $EXISTING_CLASS_NAME::$NEW_FUNCTION_NAME$ARG_LIST | ||
40 | { | ||
41 | } | ||
42 | END | ||
43 | } | ||
44 | |||
45 | |||
46 | function print_function_definition | ||
47 | { | ||
48 | cat << END | ||
49 | $ACCESS_MODIFIER | ||
50 | $RET_TYPE $NEW_FUNCTION_NAME$ARG_LIST; | ||
51 | END | ||
52 | } | ||
53 | |||
54 | |||
55 | function print_new_header_file | ||
56 | { | ||
57 | get_number_of_lines | ||
58 | get_first_line_of_class_definition | ||
59 | if [ -z "$LINE" ] | ||
60 | then | ||
61 | cat << 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 | |||
67 | END | ||
68 | print_function_definition | ||
69 | echo -e "\n*/" | ||
70 | cat $ORIGINAL_CLASS_HEADER_FILE | ||
71 | else | ||
72 | head -n $LINE $ORIGINAL_CLASS_HEADER_FILE | ||
73 | print_function_definition | ||
74 | tail -n `expr $LINES - $LINE` $ORIGINAL_CLASS_HEADER_FILE | ||
75 | fi | ||
76 | } | ||
77 | |||
78 | |||
79 | [ -f $EXISTING_CLASS_HEADER_FILE ] || { echo "file $EXISTING_CLASS_HEADER_FILE not found" ; exit ; } | ||
80 | |||
81 | # Backup file | ||
82 | mv $EXISTING_CLASS_HEADER_FILE $ORIGINAL_CLASS_HEADER_FILE | ||
83 | |||
84 | |||
85 | print_source_file >> $EXISTING_CLASS_SOURCE_FILE | ||
86 | print_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 | |||
13 | if [ $# -lt 3 ] | ||
14 | then | ||
15 | echo "Usage: q_add_variable AccessModifier: Type ExistingClassName::NewVariableName" | ||
16 | print_example_usage | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | |||
21 | ACCESS_MODIFIER=$1 | ||
22 | TYPE=$2 | ||
23 | EXISTING_CLASS_NAME=`echo $3 | cut -d ":" -f 1` | ||
24 | NEW_VARIABLE_NAME=`echo $3 | cut -d ":" -f 3` | ||
25 | |||
26 | |||
27 | EXISTING_CLASS_NAME_LOWER=`echo $EXISTING_CLASS_NAME | tr "[A-Z]" "[a-z]"` | ||
28 | EXISTING_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h | ||
29 | ORIGINAL_CLASS_HEADER_FILE="$EXISTING_CLASS_NAME_LOWER".h.orig | ||
30 | |||
31 | |||
32 | function print_variable_definition | ||
33 | { | ||
34 | cat << END | ||
35 | $ACCESS_MODIFIER | ||
36 | $TYPE $NEW_VARIABLE_NAME; | ||
37 | END | ||
38 | } | ||
39 | |||
40 | |||
41 | function print_new_header_file | ||
42 | { | ||
43 | get_number_of_lines | ||
44 | get_first_line_of_class_definition | ||
45 | if [ -z "$LINE" ] | ||
46 | then | ||
47 | cat << 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 | |||
53 | END | ||
54 | print_variable_definition | ||
55 | echo -e "\n*/" | ||
56 | cat $ORIGINAL_CLASS_HEADER_FILE | ||
57 | else | ||
58 | head -n $LINE $ORIGINAL_CLASS_HEADER_FILE | ||
59 | print_variable_definition | ||
60 | tail -n `expr $LINES - $LINE` $ORIGINAL_CLASS_HEADER_FILE | ||
61 | fi | ||
62 | } | ||
63 | |||
64 | |||
65 | [ -f $EXISTING_CLASS_HEADER_FILE ] || { echo "file $EXISTING_CLASS_HEADER_FILE not found" ; exit ; } | ||
66 | # Backup file | ||
67 | mv $EXISTING_CLASS_HEADER_FILE $ORIGINAL_CLASS_HEADER_FILE | ||
68 | print_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 | |||
9 | if [ $P4PORT = "lupinella:866" ] | ||
10 | then | ||
11 | p4 add $@ | ||
12 | else | ||
13 | echo Need to put some kind of cvs command here in q_cvs_add !! | ||
14 | # cvs add $@ | ||
15 | fi | ||
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 | |||
9 | if [ $P4PORT = "lupinella:866" ] | ||
10 | then | ||
11 | p4 edit $@ | ||
12 | else | ||
13 | echo Need to put some kind of cvs command here in q_cvs_edit !! | ||
14 | # cvs edit $@ | ||
15 | fi | ||
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 | |||
9 | if [ $P4PORT = "lupinella:866" ] | ||
10 | then | ||
11 | p4 submit $@ | ||
12 | else | ||
13 | echo Need to put some kind of cvs command here in q_cvs_submit !! | ||
14 | # cvs submit $@ | ||
15 | fi | ||
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 | |||
9 | function print_example_usage | ||
10 | { | ||
11 | cat << END | ||
12 | Example 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 | ||
18 | END | ||
19 | } | ||
20 | |||
21 | |||
22 | function print_copyright_header | ||
23 | { | ||
24 | cat << 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 | **********************************************************************/ | ||
44 | END | ||
45 | } | ||
46 | |||
47 | |||
48 | function print_main_file | ||
49 | { | ||
50 | print_copyright_header | ||
51 | cat << END | ||
52 | #include <qpeapplication.h> | ||
53 | #include <qmainwindow.h> | ||
54 | #include "$NEW_CLASS_HEADER_FILE" | ||
55 | |||
56 | |||
57 | int 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 | } | ||
67 | END | ||
68 | } | ||
69 | |||
70 | |||
71 | function print_source_file | ||
72 | { | ||
73 | print_copyright_header | ||
74 | cat << 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 | |||
86 | void $NEW_CLASS_NAME::exampleFunction( ) | ||
87 | { | ||
88 | } | ||
89 | END | ||
90 | } | ||
91 | |||
92 | |||
93 | function print_header_file | ||
94 | { | ||
95 | print_copyright_header | ||
96 | cat << END | ||
97 | #ifndef $NEW_CLASS_HEADER_DEFINE | ||
98 | #define $NEW_CLASS_HEADER_DEFINE | ||
99 | |||
100 | |||
101 | #include <qwidget.h> | ||
102 | |||
103 | |||
104 | class $NEW_CLASS_NAME : public QWidget | ||
105 | { | ||
106 | Q_OBJECT | ||
107 | public: | ||
108 | $NEW_CLASS_NAME( QWidget *parent=0, const char *name=0, WFlags f = 0); | ||
109 | protected: | ||
110 | void exampleFunction( ); | ||
111 | private: | ||
112 | int exampleVariable; | ||
113 | }; | ||
114 | |||
115 | |||
116 | #endif // $NEW_CLASS_HEADER_DEFINE | ||
117 | END | ||
118 | } | ||
119 | |||
120 | |||
121 | function print_pro_file | ||
122 | { | ||
123 | cat << 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 | ||
132 | LIBS += -lqpe | ||
133 | TARGET = $NEW_APP_NAME | ||
134 | END | ||
135 | } | ||
136 | |||
137 | |||
138 | function print_install_file | ||
139 | { | ||
140 | cat << END | ||
141 | #!/bin/sh | ||
142 | if [ a\$QPEDIR = a ] | ||
143 | then | ||
144 | echo QPEDIR must be set | ||
145 | exit | ||
146 | fi | ||
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/ | ||
149 | mv \$QPEDIR/Makefile \$QPEDIR/Makefile.orig | ||
150 | sed "s/APPS=/&$NEW_APP_NAME \\\\\\\\ \\\\ | ||
151 | /" \$QPEDIR/Makefile.orig >> \$QPEDIR/Makefile | ||
152 | echo You may wish to move the desktop file in to | ||
153 | echo an appropriate subdirectory of the menus. | ||
154 | END | ||
155 | } | ||
156 | |||
157 | |||
158 | function print_desktop_file | ||
159 | { | ||
160 | cat << END | ||
161 | [Desktop Entry] | ||
162 | Type=Application | ||
163 | Exec=$NEW_APP_NAME | ||
164 | Icon=$NEW_APP_ICON_FILE | ||
165 | Name=$NEW_APP_MENU_NAME | ||
166 | Comment=$NEW_APP_DESCRIPTION | ||
167 | END | ||
168 | } | ||
169 | |||
170 | |||
171 | function print_icon_file | ||
172 | { | ||
173 | XPM_NAME="$NEW_APP_NAME"_xpm | ||
174 | cat << END | ||
175 | /* XPM */ | ||
176 | static 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 | " "}; | ||
195 | END | ||
196 | } | ||
197 | |||
198 | |||
199 | function add_class_to_pro_file | ||
200 | { | ||
201 | cat << END | ||
202 | HEADERS += $NEW_CLASS_HEADER_FILE | ||
203 | SOURCES += $NEW_CLASS_SOURCE_FILE | ||
204 | END | ||
205 | } | ||
206 | |||
207 | |||
208 | function get_number_of_lines | ||
209 | { | ||
210 | # Get the number of lines in the file | ||
211 | LINES=`wc -l $ORIGINAL_CLASS_HEADER_FILE | cut -d " " -f 6` | ||
212 | } | ||
213 | |||
214 | |||
215 | function get_first_line_of_class_definition | ||
216 | { | ||
217 | # First look for class definition with Q_OBJECT a few lines below | ||
218 | LINE=`grep -n -A 3 "class $EXISTING_CLASS_NAME " $ORIGINAL_CLASS_HEADER_FILE | grep "Q_OBJECT" | cut -d "-" -f 1` | ||
219 | if [ -z "$LINE" ] | ||
220 | then | ||
221 | # else look for class definition with open brace on same line | ||
222 | LINE=`grep -n "class $EXISTING_CLASS_NAME.*[{]" $ORIGINAL_CLASS_HEADER_FILE | cut -d ":" -f 1` | ||
223 | #elif doesn't work here | ||
224 | fi;if [ -z "$LINE" ] | ||
225 | then | ||
226 | # else look for class with open brace a few lines below | ||
227 | LINE=`grep -n -A 3 "class $EXISTING_CLASS_NAME " $ORIGINAL_CLASS_HEADER_FILE | grep "\-.*[{]" | cut -d "-" -f 1` | ||
228 | #elif doesn't work here | ||
229 | fi | ||
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 | |||
3 | RHOST=qpe.sf.net | ||
4 | RDIR=/home/groups/q/qp/qpe/htdocs/packages/ipaq/unstable/ | ||
5 | |||
6 | NEW="" | ||
7 | rm -f *.ipk | ||
8 | ssh $RHOST -C "cd $RDIR; ls *.ipk" >currentipks & | ||
9 | ./mkipks "$@" | ||
10 | wait # for ssh | ||
11 | |||
12 | for i in *.ipk | ||
13 | do | ||
14 | if grep -q $i currentipks | ||
15 | then | ||
16 | rm $i | ||
17 | else | ||
18 | NEW="$NEW $i"; | ||
19 | fi | ||
20 | done | ||
21 | |||
22 | if [ -n "$NEW" ] | ||
23 | then | ||
24 | scp $NEW $RHOST:$RDIR | ||
25 | rm $NEW | ||
26 | ssh $RHOST -C "cd $RDIR; chmod g+w *.ipk; ./mkPackages" | ||
27 | fi | ||
28 | |||
29 | rm currentipks | ||