summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--config.in1
-rw-r--r--core/launcher/server.cpp2
-rw-r--r--core/symlinker/Makefile160
-rw-r--r--core/symlinker/config.in5
-rw-r--r--core/symlinker/main.cpp160
-rw-r--r--core/symlinker/opie-symlinker.control9
-rw-r--r--core/symlinker/symlinker.pro15
-rw-r--r--packages1
8 files changed, 352 insertions, 1 deletions
diff --git a/config.in b/config.in
index b57488a..1a5b53b 100644
--- a/config.in
+++ b/config.in
@@ -94,128 +94,129 @@ endmenu
94menu "Configuration" 94menu "Configuration"
95config OPIE_NO_OVERRIDE_QT 95config OPIE_NO_OVERRIDE_QT
96 boolean "Build Opie against an unpatched version of Qt" 96 boolean "Build Opie against an unpatched version of Qt"
97 default n 97 default n
98 98
99config OPIE_NO_BUILTIN_SHUTDOWN 99config OPIE_NO_BUILTIN_SHUTDOWN
100 boolean "Disable the built in shutdown application" 100 boolean "Disable the built in shutdown application"
101 default n 101 default n
102 102
103config OPIE_NO_BUILTIN_CALIBRATE 103config OPIE_NO_BUILTIN_CALIBRATE
104 boolean "Disable the built in calibrate application" 104 boolean "Disable the built in calibrate application"
105 default y if TARGET_YOPY 105 default y if TARGET_YOPY
106 default n 106 default n
107 107
108config OPIE_SOUND_FRAGMENT_SHIFT 108config OPIE_SOUND_FRAGMENT_SHIFT
109 string "The sound fragment used in Opie Player I" 109 string "The sound fragment used in Opie Player I"
110 default "14" if TARGET_IPAQ 110 default "14" if TARGET_IPAQ
111 default "16" if (!TARGET_IPAQ) 111 default "16" if (!TARGET_IPAQ)
112 112
113config USE_REALTIME_AUDIO_THREAD 113config USE_REALTIME_AUDIO_THREAD
114 boolean "Use a realtime thread in Opie Player I" 114 boolean "Use a realtime thread in Opie Player I"
115 default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP 115 default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP
116 default n 116 default n
117 117
118config QT_QWS_ALLOW_OVERCLOCK 118config QT_QWS_ALLOW_OVERCLOCK
119 boolean "Allow the user to overclock the device" 119 boolean "Allow the user to overclock the device"
120 depends TARGET_RAMSES 120 depends TARGET_RAMSES
121 default n 121 default n
122 122
123config OPIE_HIGH_RES_SMALL_PHY 123config OPIE_HIGH_RES_SMALL_PHY
124 boolean "Resolution is bigger than physical screen" 124 boolean "Resolution is bigger than physical screen"
125 default y if TARGET_C700 125 default y if TARGET_C700
126 default n 126 default n
127 127
128config OPIE_NEW_ALLOC 128config OPIE_NEW_ALLOC
129 boolean "Use malloc and free for the implementation" 129 boolean "Use malloc and free for the implementation"
130 default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP 130 default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP
131 default n 131 default n
132 132
133config OPIE_NO_SOUND_PCM_READ_BITS 133config OPIE_NO_SOUND_PCM_READ_BITS
134 boolean "There is not a pcm_read_bits io control" 134 boolean "There is not a pcm_read_bits io control"
135 default y if TARGET_SHARP 135 default y if TARGET_SHARP
136 default n 136 default n
137 137
138config OPIE_WE_VERSION 138config OPIE_WE_VERSION
139 string "The wireless extension (WE) version to build against" 139 string "The wireless extension (WE) version to build against"
140 default "15" if ! TARGET_X86 140 default "15" if ! TARGET_X86
141 default "16" if TAGET_X86 141 default "16" if TAGET_X86
142 142
143endmenu 143endmenu
144 144
145menu "Base" 145menu "Base"
146 choice 146 choice
147 prompt "Qpe Library Selection" 147 prompt "Qpe Library Selection"
148 default LIBQPE 148 default LIBQPE
149 source library/config.in 149 source library/config.in
150 source x11/config.in 150 source x11/config.in
151 endchoice 151 endchoice
152 source libopie/config.in 152 source libopie/config.in
153 source core/opie-login/config.in 153 source core/opie-login/config.in
154 source core/opiealarm/config.in 154 source core/opiealarm/config.in
155 source core/tools/quicklauncher/config.in 155 source core/tools/quicklauncher/config.in
156 source core/launcher/config.in 156 source core/launcher/config.in
157 source core/qws/config.in 157 source core/qws/config.in
158 source core/symlinker/config.in
158endmenu 159endmenu
159 160
160comment "" 161comment ""
161 162
162menu "Applets" 163menu "Applets"
163 source core/applets/config.in 164 source core/applets/config.in
164 source noncore/applets/config.in 165 source noncore/applets/config.in
165endmenu 166endmenu
166 167
167menu "Apps" 168menu "Apps"
168 source core/apps/config.in 169 source core/apps/config.in
169 source noncore/apps/config.in 170 source noncore/apps/config.in
170endmenu 171endmenu
171 172
172menu "Communications and Networking" 173menu "Communications and Networking"
173 source noncore/comm/config.in 174 source noncore/comm/config.in
174 source noncore/net/config.in 175 source noncore/net/config.in
175endmenu 176endmenu
176 177
177menu "Games" 178menu "Games"
178 source noncore/games/config.in 179 source noncore/games/config.in
179endmenu 180endmenu
180 181
181menu "Graphics and Multimedia" 182menu "Graphics and Multimedia"
182 source freetype/config.in 183 source freetype/config.in
183 source noncore/graphics/config.in 184 source noncore/graphics/config.in
184 source core/multimedia/config.in 185 source core/multimedia/config.in
185 source noncore/multimedia/config.in 186 source noncore/multimedia/config.in
186endmenu 187endmenu
187 188
188menu "Input methods" 189menu "Input methods"
189 source inputmethods/config.in 190 source inputmethods/config.in
190endmenu 191endmenu
191 192
192menu "Pim" 193menu "Pim"
193 source core/pim/config.in 194 source core/pim/config.in
194 menu "Today Plugins" 195 menu "Today Plugins"
195 source noncore/todayplugins/config.in 196 source noncore/todayplugins/config.in
196 source core/pim/today/plugins/config.in 197 source core/pim/today/plugins/config.in
197 endmenu 198 endmenu
198endmenu 199endmenu
199 200
200menu "Settings" 201menu "Settings"
201 source core/settings/config.in 202 source core/settings/config.in
202 source noncore/settings/config.in 203 source noncore/settings/config.in
203endmenu 204endmenu
204 205
205menu "Theming" 206menu "Theming"
206 source noncore/decorations/config.in 207 source noncore/decorations/config.in
207 source noncore/styles/config.in 208 source noncore/styles/config.in
208endmenu 209endmenu
209 210
210menu "Tools" 211menu "Tools"
211 source noncore/tools/config.in 212 source noncore/tools/config.in
212endmenu 213endmenu
213 214
214menu "Development" 215menu "Development"
215 source development/keyview/config.in 216 source development/keyview/config.in
216 #source development/debugviewer/config.in 217 #source development/debugviewer/config.in
217endmenu 218endmenu
218 219
219menu "Examples" 220menu "Examples"
220 config EXAMPLES 221 config EXAMPLES
221 boolean "Compile Example Application" 222 boolean "Compile Example Application"
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 634082b..9a86a80 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -647,83 +647,83 @@ void Server::timerEvent( QTimerEvent *e )
647 QDate today = QDate::currentDate(); 647 QDate today = QDate::currentDate();
648 if ( today != last_today_show ) { 648 if ( today != last_today_show ) {
649 last_today_show = today; 649 last_today_show = today;
650 Config cfg("today"); 650 Config cfg("today");
651 cfg.setGroup("Start"); 651 cfg.setGroup("Start");
652#ifndef QPE_DEFAULT_TODAY_MODE 652#ifndef QPE_DEFAULT_TODAY_MODE
653#define QPE_DEFAULT_TODAY_MODE "Never" 653#define QPE_DEFAULT_TODAY_MODE "Never"
654#endif 654#endif
655 if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) { 655 if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) {
656 QCopEnvelope env(Service::channel("today"),"raise()"); 656 QCopEnvelope env(Service::channel("today"),"raise()");
657 } 657 }
658 } 658 }
659 } 659 }
660#endif 660#endif
661} 661}
662 662
663void Server::terminateServers() 663void Server::terminateServers()
664{ 664{
665 delete transferServer; 665 delete transferServer;
666 delete qcopBridge; 666 delete qcopBridge;
667 transferServer = 0; 667 transferServer = 0;
668 qcopBridge = 0; 668 qcopBridge = 0;
669} 669}
670 670
671void Server::syncConnectionClosed( const QHostAddress & ) 671void Server::syncConnectionClosed( const QHostAddress & )
672{ 672{
673 qDebug( "Lost sync connection" ); 673 qDebug( "Lost sync connection" );
674 delete syncDialog; 674 delete syncDialog;
675 syncDialog = 0; 675 syncDialog = 0;
676} 676}
677 677
678void Server::pokeTimeMonitors() 678void Server::pokeTimeMonitors()
679{ 679{
680#if 0 680#if 0
681 // inform all TimeMonitors 681 // inform all TimeMonitors
682 QStrList tms = Service::channels("TimeMonitor"); 682 QStrList tms = Service::channels("TimeMonitor");
683 for (const char* ch = tms.first(); ch; ch=tms.next()) { 683 for (const char* ch = tms.first(); ch; ch=tms.next()) {
684 QString t = getenv("TZ"); 684 QString t = getenv("TZ");
685 QCopEnvelope e(ch, "timeChange(QString)"); 685 QCopEnvelope e(ch, "timeChange(QString)");
686 e << t; 686 e << t;
687 } 687 }
688#endif 688#endif
689} 689}
690 690
691void Server::applicationLaunched(int, const QString &app) 691void Server::applicationLaunched(int, const QString &app)
692{ 692{
693 serverGui->applicationStateChanged( app, ServerInterface::Launching ); 693 serverGui->applicationStateChanged( app, ServerInterface::Launching );
694} 694}
695 695
696void Server::applicationTerminated(int pid, const QString &app) 696void Server::applicationTerminated(int pid, const QString &app)
697{ 697{
698 serverGui->applicationStateChanged( app, ServerInterface::Terminated ); 698 serverGui->applicationStateChanged( app, ServerInterface::Terminated );
699#if 0 699#if 0
700 tsmMonitor->applicationTerminated( pid ); 700 tsmMonitor->applicationTerminated( pid );
701#endif 701#endif
702} 702}
703 703
704void Server::applicationConnected(const QString &app) 704void Server::applicationConnected(const QString &app)
705{ 705{
706 serverGui->applicationStateChanged( app, ServerInterface::Running ); 706 serverGui->applicationStateChanged( app, ServerInterface::Running );
707} 707}
708 708
709void Server::storageChanged() 709void Server::storageChanged()
710{ 710{
711 system( "qtopia-update-symlinks" ); 711 system( "opie-update-symlinks" );
712 serverGui->storageChanged( storage->fileSystems() ); 712 serverGui->storageChanged( storage->fileSystems() );
713 docList->storageChanged(); 713 docList->storageChanged();
714} 714}
715 715
716 716
717 717
718void Server::preloadApps() 718void Server::preloadApps()
719{ 719{
720 Config cfg("Launcher"); 720 Config cfg("Launcher");
721 cfg.setGroup("Preload"); 721 cfg.setGroup("Preload");
722 QStringList apps = cfg.readListEntry("Apps",','); 722 QStringList apps = cfg.readListEntry("Apps",',');
723 for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { 723 for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) {
724#ifndef QT_NO_COP 724#ifndef QT_NO_COP
725 QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); 725 QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()");
726#endif 726#endif
727 } 727 }
728} 728}
729 729
diff --git a/core/symlinker/Makefile b/core/symlinker/Makefile
new file mode 100644
index 0000000..f35292c
--- a/dev/null
+++ b/core/symlinker/Makefile
@@ -0,0 +1,160 @@
1#############################################################################
2# Makefile for building: $(OPIEDIR)/bin/opie-update-symlinks
3# Generated by qmake (1.05a) (Qt 3.1.2) on: Tue Mar 16 10:46:29 2004
4# Project: symlinker.pro
5# Template: app
6# Command: $(QMAKE) -o Makefile symlinker.pro
7#############################################################################
8
9####### Compiler, tools and options
10
11CC = arm-linux-gcc
12CXX = arm-linux-g++ -DQT_QWS_IPAQ
13LEX = flex
14YACC = yacc
15CFLAGS = -pipe $(CFLAGS_EXTRA) -Wall -W $(if $(CFLAGS_RELEASE),$(CFLAGS_RELEASE), -O2) -DUSE_REALTIME_AUDIO_THREAD -DOPIE_NEW_MALLOC -DOPIE_SOUND_FRAGMENT_SHIFT=14 -DOPIE_WE_VERSION=15 -DQT_NO_DEBUG
16CXXFLAGS = -pipe $(CFLAGS_EXTRA) -DQWS -fno-exceptions -fno-rtti $(CXXFLAGS_EXTRA) -Wall -W $(if $(CFLAGS_RELEASE),$(CFLAGS_RELEASE), -O2) -DUSE_REALTIME_AUDIO_THREAD -DOPIE_NEW_MALLOC -DOPIE_SOUND_FRAGMENT_SHIFT=14 -DOPIE_WE_VERSION=15 -DQT_NO_DEBUG
17LEXFLAGS =
18YACCFLAGS= -d
19INCPATH = -I/opt/arm/opie//mkspecs/qws/linux-ipaq-g++ -I. -I$(OPIEDIR)/include -I$(QTDIR)/include -I.moc/$(PLATFORM)/
20LINK = arm-linux-gcc
21LFLAGS = $(LFLAGS_EXTRA) -Wl,-rpath=$(OPIEDIR)/lib
22LIBS = $(SUBLIBS) -Wl,-rpath-link,$(OPIEDIR)/lib -L$(OPIEDIR)/lib -Wl,-rpath-link,$(QTDIR)/lib -L$(QTDIR)/lib $(LIBS_EXTRA) -lqpe -lopie -lqte
23AR = ar cqs
24RANLIB =
25MOC = $(QTDIR)/bin/moc
26UIC = $(QTDIR)/bin/uic
27QMAKE = qmake
28TAR = tar -cf
29GZIP = gzip -9f
30COPY = cp -f
31COPY_FILE= $(COPY) -p
32COPY_DIR = $(COPY) -pR
33DEL_FILE = rm -f
34SYMLINK = ln -sf
35DEL_DIR = rmdir
36MOVE = mv -f
37PRO = symlinker.pro
38CHK_DIR_EXISTS= test -d
39MKDIR = mkdir -p
40
41####### Output directory
42
43OBJECTS_DIR = .obj/$(PLATFORM)/
44
45####### Files
46
47HEADERS =
48SOURCES = main.cpp
49OBJECTS = .obj/$(PLATFORM)/main.o
50FORMS =
51UICDECLS =
52UICIMPLS =
53SRCMOC =
54OBJMOC =
55 DIST = ../../gen.pro \
56 ../../include.pro \
57 symlinker.pro
58QMAKE_TARGET = opie-update-symlinks
59DESTDIR = $(OPIEDIR)/bin/
60TARGET = $(OPIEDIR)/bin/opie-update-symlinks
61
62first: all
63####### Implicit rules
64
65.SUFFIXES: .c .cpp .cc .cxx .C
66
67.cpp.o:
68 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
69
70.cc.o:
71 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
72
73.cxx.o:
74 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
75
76.C.o:
77 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
78
79.c.o:
80 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
81
82####### Build rules
83
84all: Makefile $(TARGET)
85
86$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
87 test -d $(OPIEDIR)/bin/ || mkdir -p $(OPIEDIR)/bin/
88 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
89
90mocables: $(SRCMOC)
91
92$(MOC):
93 ( cd $(QTDIR)/src/moc ; $(MAKE) )
94
95Makefile: symlinker.pro /opt/arm/opie//mkspecs/qws/linux-ipaq-g++/qmake.conf ../../gen.pro \
96 ../../include.pro
97 $(QMAKE) -o Makefile symlinker.pro
98qmake:
99 @$(QMAKE) -o Makefile symlinker.pro
100
101dist:
102 @mkdir -p .obj/$(PLATFORM)/opie-update-symlinks && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .obj/$(PLATFORM)/opie-update-symlinks/ && ( cd `dirname .obj/$(PLATFORM)/opie-update-symlinks` && $(TAR) opie-update-symlinks.tar opie-update-symlinks && $(GZIP) opie-update-symlinks.tar ) && $(MOVE) `dirname .obj/$(PLATFORM)/opie-update-symlinks`/opie-update-symlinks.tar.gz . && $(DEL_FILE) -r .obj/$(PLATFORM)/opie-update-symlinks
103
104mocclean:
105
106uiclean:
107
108yaccclean:
109lexclean:
110clean:
111 -$(DEL_FILE) $(OBJECTS)
112 -$(DEL_FILE) *~ core *.core
113
114
115####### Sub-libraries
116
117distclean: clean
118 -$(DEL_FILE) $(OPIEDIR)/bin/$(TARGET) $(TARGET)
119
120
121lupdate:
122 lupdate -noobsolete $(PRO)
123
124lrelease:
125 lrelease $(PRO)
126
127ipk:
128 tmp=`mktemp -d /tmp/ipkg-opie.XXXXXXXXXX` && ( $(MAKE) INSTALL_ROOT="" install && ipkg-build ; rm -rf ; )
129
130opie-lupdate:
131 opie-lupdate $(PRO)
132
133opie-lrelease:
134 opie-lrelease $(PRO)
135
136messages:
137 xgettext -C -n -ktr -kQT_TRANSLATE_NOOP main.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-tr.po' && xgettext -C -n -a main.cpp -o '$(OPIEDIR)/messages-$(QMAKE_TARGET)-allstrings.po'
138
139FORCE:
140
141####### Compile
142
143.obj/$(PLATFORM)/main.o: main.cpp
144 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o .obj/$(PLATFORM)/main.o main.cpp
145
146####### Install
147
148install_target:
149 @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)$(OPIEDIR)/bin/" || $(MKDIR) "$(INSTALL_ROOT)$(OPIEDIR)/bin/"
150 -$(COPY) "$(OPIEDIR)/bin/$(QMAKE_TARGET)" "$(INSTALL_ROOT)$(OPIEDIR)/bin/$(QMAKE_TARGET)"
151
152uninstall_target:
153 -$(DEL_FILE) "$(INSTALL_ROOT)$(OPIEDIR)/bin/$(QMAKE_TARGET)"
154 -$(DEL_DIR) "$(INSTALL_ROOT)$(OPIEDIR)/bin/"
155
156
157install: all install_target
158
159uninstall: uninstall_target
160
diff --git a/core/symlinker/config.in b/core/symlinker/config.in
new file mode 100644
index 0000000..a378d3a
--- a/dev/null
+++ b/core/symlinker/config.in
@@ -0,0 +1,5 @@
1 config SYMLINKER
2 boolean "Opie Symlinker for external media"
3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LAUNCHER
5
diff --git a/core/symlinker/main.cpp b/core/symlinker/main.cpp
new file mode 100644
index 0000000..73d5166
--- a/dev/null
+++ b/core/symlinker/main.cpp
@@ -0,0 +1,160 @@
1#include <qapplication.h>
2#include <qfile.h>
3#include <qfileinfo.h>
4#include <qdir.h>
5#include <qtextstream.h>
6#include <qstringlist.h>
7
8#include <stdlib.h>
9#include <unistd.h> //symlink()
10#include <sys/stat.h> // mkdir()
11
12#include <sys/vfs.h>
13#include <mntent.h>
14
15static const char *listDir = "/usr/lib/ipkg/externinfo/";
16
17static void createSymlinks( const QString &location, const QString &package )
18{
19 QFile inFile( location + "/usr/lib/ipkg/info/" + package + ".list" );
20 mkdir( "/usr/lib/ipkg", 0777 );
21 mkdir( listDir, 0777 );
22
23 QFile outFile( listDir + package + ".list");
24
25 //qDebug( "createSymlinks %s -> %s", inFile.name().ascii(), outFile.name().ascii() );
26
27
28
29 if ( inFile.open(IO_ReadOnly) && outFile.open(IO_WriteOnly)) {
30 QTextStream in(&inFile);
31 QTextStream out(&outFile);
32
33 QString s;
34 while ( !in.eof() ) { // until end of file...
35 s = in.readLine(); // line of text excluding '\n'
36 //qDebug( "Read: %s", s.ascii() );
37 // for s, do link/mkdir.
38 if ( s.right(1) == "/" ) {
39 //qDebug("do mkdir for %s", s.ascii());
40 mkdir( s.ascii(), 0777 );
41 //possible optimization: symlink directories
42 //that don't exist already. -- Risky.
43 } else {
44 //qDebug("do symlink for %s", s.ascii());
45 QFileInfo ffi( s );
46 //Don't try to symlink if a regular file exists already
47 if ( !ffi.exists() || ffi.isSymLink() ) {
48 symlink( (location+s).ascii(), s.ascii() );
49 // qDebug ( "Created %s" ,s.ascii() );
50 out << s << "\n";
51 } //else {
52 // qDebug( "%s exists already, not symlinked", s.ascii() );
53 // }
54 }
55 }
56 inFile.close();
57 outFile.close();
58 }
59}
60
61
62
63static void removeSymlinks( const QString &package )
64{
65 QFile inFile( listDir + package + ".list" );
66
67 if ( inFile.open(IO_ReadOnly) ) {
68 QTextStream in(&inFile);
69
70 QString s;
71 while ( !in.eof() ) { // until end of file...
72 s = in.readLine(); // line of text excluding '\n'
73 //qDebug("remove symlink %s", s.ascii());
74 QFileInfo ffi( s );
75 //Confirm that it's still a symlink.
76 if ( ffi.isSymLink() )
77 unlink( s.ascii() );
78 // qDebug ( "Removed %s", s.ascii() );
79 // else
80 // qDebug( "Not removed %s", s.ascii() );
81 }
82 inFile.close();
83 inFile.remove();
84 }
85}
86
87
88
89/*
90 Slightly hacky: we can't use StorageInfo, since we don't have a
91 QApplication. We look for filesystems that have the directory
92 /usr/lib/ipkg/info, and assume that they are removable media
93 with packages installed. This is safe even if eg. /usr is on a
94 separate filesystem, since then we would be testing for
95 /usr/usr/lib/ipkg/info, which should not exist. (And if it
96 does they deserve to have it treated as removable.)
97 */
98
99static void updateSymlinks()
100{
101 QDir lists( listDir );
102 QStringList knownPackages = lists.entryList( "*.list" ); // No tr
103
104 struct mntent *me;
105 FILE *mntfp = setmntent( "/etc/mtab", "r" );
106
107 if ( mntfp ) {
108 while ( (me = getmntent( mntfp )) != 0 ) {
109 QString root = me->mnt_dir;
110 if ( root == "/" )
111 continue;
112
113 QString info = root + "/usr/lib/ipkg/info";
114 QDir infoDir( info );
115 //qDebug( "looking at %s", info.ascii() );
116 if ( infoDir.isReadable() ) {
117 const QFileInfoList *packages = infoDir.entryInfoList( "*.list" ); // No tr
118 QFileInfoListIterator it( *packages );
119 QFileInfo *fi;
120 while (( fi = *it )) {
121 ++it;
122 if ( knownPackages.contains( fi->fileName() ) ) {
123 //qDebug( "found %s and we've seen it before", fi->fileName().latin1() );
124 knownPackages.remove( fi->fileName() );
125 } else {
126 //it's a new one
127 createSymlinks( root, fi->baseName() );
128 }
129
130 }
131
132 }
133 }
134 endmntent( mntfp );
135 }
136
137 for ( QStringList::Iterator it = knownPackages.begin();
138 it != knownPackages.end(); ++it ) {
139 // strip ".info" off the end.
140 removeSymlinks( (*it).left((*it).length()-5) );
141 }
142}
143
144
145
146int main( int argc, char *argv[] )
147{
148 QApplication a( argc, argv, QApplication::Tty );
149
150 QString command = argc > 1 ? argv[1] : "update"; // No tr
151
152 if ( command == "update" ) // No tr
153 updateSymlinks();
154 else if ( command == "create" && argc > 3 ) // No tr
155 createSymlinks( argv[2], argv[3] );
156 else if ( command == "remove" && argc > 2 ) // No tr
157 removeSymlinks( argv[2] );
158 else
159 qWarning( "Argument error" );
160}
diff --git a/core/symlinker/opie-symlinker.control b/core/symlinker/opie-symlinker.control
new file mode 100644
index 0000000..6378653
--- a/dev/null
+++ b/core/symlinker/opie-symlinker.control
@@ -0,0 +1,9 @@
1Package: opie-symlinker
2Files: bin/opie-update-symlinks
3Priority: optional
4Section: opie/system
5Maintainer: Project Opie <opie@handhelds.org>
6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION.3
8Depends: task-opie-minimal
9Description: Enables apps on external media
diff --git a/core/symlinker/symlinker.pro b/core/symlinker/symlinker.pro
new file mode 100644
index 0000000..9558b3e
--- a/dev/null
+++ b/core/symlinker/symlinker.pro
@@ -0,0 +1,15 @@
1 TEMPLATE= app
2 CONFIG += qtopia warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4
5 HEADERS =
6 SOURCES = main.cpp
7 INTERFACES=
8
9 TARGET = opie-update-symlinks
10INCLUDEPATH += $(OPIEDIR)/include
11DEPENDPATH += $(OPIEDIR)/include .
12LIBS += -lqpe -lopie
13
14include ( $(OPIEDIR)/include.pro )
15
diff --git a/packages b/packages
index 8f4f731..9e5406e 100644
--- a/packages
+++ b/packages
@@ -106,104 +106,105 @@ CONFIG_MINDBREAKER noncore/games/mindbreaker mindbreaker.pro
106 CONFIG_MINESWEEP noncore/games/minesweepminesweep.pro 106 CONFIG_MINESWEEP noncore/games/minesweepminesweep.pro
107 CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro 107 CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro
108 CONFIG_MODPLUG core/multimedia/opieplayer/modplugmodplug.pro 108 CONFIG_MODPLUG core/multimedia/opieplayer/modplugmodplug.pro
109 CONFIG_MULTIKEYAPPLET core/applets/multikeyappletmultikeyapplet.pro 109 CONFIG_MULTIKEYAPPLET core/applets/multikeyappletmultikeyapplet.pro
110 CONFIG_MULTIKEY inputmethods/multikeymultikey.pro 110 CONFIG_MULTIKEY inputmethods/multikeymultikey.pro
111 CONFIG_NETSYSTEMTIME noncore/settings/netsystemtimenetsystemtime.pro 111 CONFIG_NETSYSTEMTIME noncore/settings/netsystemtimenetsystemtime.pro
112 CONFIG_NETWORKAPPLET noncore/applets/networkappletnetworkapplet.pro 112 CONFIG_NETWORKAPPLET noncore/applets/networkappletnetworkapplet.pro
113 CONFIG_NETWORKSETUP noncore/settings/networksettingsnetworksettings.pro 113 CONFIG_NETWORKSETUP noncore/settings/networksettingsnetworksettings.pro
114 CONFIG_NOTESAPPLET noncore/applets/notesappletnotesapplet.pro 114 CONFIG_NOTESAPPLET noncore/applets/notesappletnotesapplet.pro
115 CONFIG_OAPP core/apps/oappoapp.pro 115 CONFIG_OAPP core/apps/oappoapp.pro
116 CONFIG_OBEX core/applets/obex2obex.pro 116 CONFIG_OBEX core/applets/obex2obex.pro
117 CONFIG_ODICT noncore/apps/odictodict.pro 117 CONFIG_ODICT noncore/apps/odictodict.pro
118 CONFIG_OIPKG noncore/unsupported/oipkgoipkg.pro 118 CONFIG_OIPKG noncore/unsupported/oipkgoipkg.pro
119 CONFIG_OPIEALARMcore/opiealarm 119 CONFIG_OPIEALARMcore/opiealarm
120 CONFIG_OPIE-CONSOLE noncore/apps/opie-consoleopie-console.pro 120 CONFIG_OPIE-CONSOLE noncore/apps/opie-consoleopie-console.pro
121 CONFIG_OPIEFTP noncore/net/opieftpopieftp.pro 121 CONFIG_OPIEFTP noncore/net/opieftpopieftp.pro
122 CONFIG_OPIEIRC noncore/net/opieircopieirc.pro 122 CONFIG_OPIEIRC noncore/net/opieircopieirc.pro
123 CONFIG_OPIE-LOGIN core/opie-loginopie-login.pro 123 CONFIG_OPIE-LOGIN core/opie-loginopie-login.pro
124 CONFIG_OPIEMAIL2noncore/unsupported/mail2 mail.pro 124 CONFIG_OPIEMAIL2noncore/unsupported/mail2 mail.pro
125 CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2opieplayer2.pro 125 CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2opieplayer2.pro
126 CONFIG_OPIEPLAYER core/multimedia/opieplayeropieplayer.pro 126 CONFIG_OPIEPLAYER core/multimedia/opieplayeropieplayer.pro
127 CONFIG_OPIE-RDESKTOP noncore/net/opierdesktopopierdesktop.pro 127 CONFIG_OPIE-RDESKTOP noncore/net/opierdesktopopierdesktop.pro
128 CONFIG_OPIE-READER noncore/apps/opie-readeropie-reader.pro 128 CONFIG_OPIE-READER noncore/apps/opie-readeropie-reader.pro
129 CONFIG_OPIEREC noncore/multimedia/opierecopierec.pro 129 CONFIG_OPIEREC noncore/multimedia/opierecopierec.pro
130 CONFIG_OPIE-SHEET noncore/apps/opie-sheetopie-sheet.pro 130 CONFIG_OPIE-SHEET noncore/apps/opie-sheetopie-sheet.pro
131 CONFIG_OPIE-SH noncore/tools/opie-shopie-sh.pro 131 CONFIG_OPIE-SH noncore/tools/opie-shopie-sh.pro
132 CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro 132 CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro
133 CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/managermanager.pro 133 CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/managermanager.pro
134 CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro 134 CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro
135 CONFIG_OSEARCH core/pim/osearchosearch.pro 135 CONFIG_OSEARCH core/pim/osearchosearch.pro
136 CONFIG_OXYGEN noncore/apps/oxygenoxygen.pro 136 CONFIG_OXYGEN noncore/apps/oxygenoxygen.pro
137 CONFIG_PACKAGEMANAGER noncore/settings/packagemanagerpackagemanager.pro 137 CONFIG_PACKAGEMANAGER noncore/settings/packagemanagerpackagemanager.pro
138 CONFIG_PARASHOOT noncore/games/parashootparashoot.pro 138 CONFIG_PARASHOOT noncore/games/parashootparashoot.pro
139 CONFIG_PICKBOARD inputmethods/pickboardpickboard.pro 139 CONFIG_PICKBOARD inputmethods/pickboardpickboard.pro
140 CONFIG_POWERCHORD noncore/multimedia/powerchordpowerchord.pro 140 CONFIG_POWERCHORD noncore/multimedia/powerchordpowerchord.pro
141CONFIG_PPP noncore/settings/networksettings/ppp ppp.pro 141CONFIG_PPP noncore/settings/networksettings/ppp ppp.pro
142 CONFIG_QASHMONEY noncore/apps/qashmoneyqashmoney.pro 142 CONFIG_QASHMONEY noncore/apps/qashmoneyqashmoney.pro
143 CONFIG_QASTEROIDS noncore/games/qasteroidsqasteroids.pro 143 CONFIG_QASTEROIDS noncore/games/qasteroidsqasteroids.pro
144 CONFIG_QCOP core/apps/qcopqcop.pro 144 CONFIG_QCOP core/apps/qcopqcop.pro
145 CONFIG_QPDF noncore/unsupported/qpdfqpdf.pro 145 CONFIG_QPDF noncore/unsupported/qpdfqpdf.pro
146CONFIG_QUICKLAUNCHER core/tools/quicklauncher quicklauncher.pro 146CONFIG_QUICKLAUNCHER core/tools/quicklauncher quicklauncher.pro
147 CONFIG_QWS core/qwsqws.pro 147 CONFIG_QWS core/qwsqws.pro
148 CONFIG_REMOTE noncore/tools/remoteremote.pro 148 CONFIG_REMOTE noncore/tools/remoteremote.pro
149 CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro 149 CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro
150 CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro 150 CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro
151 CONFIG_ROTATEAPPLET core/applets/rotateappletrotateapplet.pro 151 CONFIG_ROTATEAPPLET core/applets/rotateappletrotateapplet.pro
152 CONFIG_ROTATION noncore/settings/rotationrotation.pro 152 CONFIG_ROTATION noncore/settings/rotationrotation.pro
153 CONFIG_RUNAPPLET core/applets/runappletrunapplet.pro 153 CONFIG_RUNAPPLET core/applets/runappletrunapplet.pro
154 CONFIG_SCREENSHOTAPPLET core/applets/screenshotappletscreenshotapplet.pro 154 CONFIG_SCREENSHOTAPPLET core/applets/screenshotappletscreenshotapplet.pro
155 CONFIG_SECURITY core/settings/securitysecurity.pro 155 CONFIG_SECURITY core/settings/securitysecurity.pro
156 CONFIG_SFCAVE noncore/games/sfcavesfcave.pro 156 CONFIG_SFCAVE noncore/games/sfcavesfcave.pro
157 CONFIG_SFCAVE-SDL noncore/games/sfcave-sdlsfcave-sdl.pro 157 CONFIG_SFCAVE-SDL noncore/games/sfcave-sdlsfcave-sdl.pro
158 CONFIG_SHOWIMG noncore/multimedia/showimgshowimg.pro 158 CONFIG_SHOWIMG noncore/multimedia/showimgshowimg.pro
159CONFIG_SIMPLE_EXAMPLE examples/simple example.pro 159CONFIG_SIMPLE_EXAMPLE examples/simple example.pro
160CONFIG_SIMPLE_ICON examples/simple-icon example.pro 160CONFIG_SIMPLE_ICON examples/simple-icon example.pro
161CONFIG_SIMPLE_MAIN examples/simple-main example.pro 161CONFIG_SIMPLE_MAIN examples/simple-main example.pro
162 CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro 162 CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro
163CONFIG_SIMPLE_PIM examples/simple-pim example.pro 163CONFIG_SIMPLE_PIM examples/simple-pim example.pro
164 CONFIG_SINGLE singlesingle.pro 164 CONFIG_SINGLE singlesingle.pro
165 CONFIG_SNAKE noncore/games/snakesnake.pro 165 CONFIG_SNAKE noncore/games/snakesnake.pro
166 CONFIG_SOLITAIRE noncore/games/solitairesolitaire.pro 166 CONFIG_SOLITAIRE noncore/games/solitairesolitaire.pro
167 CONFIG_SOUND noncore/settings/soundsound.pro 167 CONFIG_SOUND noncore/settings/soundsound.pro
168 CONFIG_SSHKEYS noncore/settings/sshkeyssshkeys.pro 168 CONFIG_SSHKEYS noncore/settings/sshkeyssshkeys.pro
169 CONFIG_SUSPENDAPPLET core/applets/suspendappletsuspendapplet.pro 169 CONFIG_SUSPENDAPPLET core/applets/suspendappletsuspendapplet.pro
170CONFIG_SYMLINKER core/symlinker symlinker.pro
170 CONFIG_SYSINFO noncore/settings/sysinfosysinfo.pro 171 CONFIG_SYSINFO noncore/settings/sysinfosysinfo.pro
171 CONFIG_TABLEVIEWER noncore/apps/tableviewertableviewer.pro 172 CONFIG_TABLEVIEWER noncore/apps/tableviewertableviewer.pro
172 CONFIG_TABMANAGER noncore/settings/tabmanagertabmanager.pro 173 CONFIG_TABMANAGER noncore/settings/tabmanagertabmanager.pro
173 CONFIG_TABOAPP core/apps/taboapptaboapp.pro 174 CONFIG_TABOAPP core/apps/taboapptaboapp.pro
174 CONFIG_TEST libsql/testtest.pro 175 CONFIG_TEST libsql/testtest.pro
175 CONFIG_TEST noncore/apps/opie-console/testtest.pro 176 CONFIG_TEST noncore/apps/opie-console/testtest.pro
176 CONFIG_TETRIX noncore/games/tetrixtetrix.pro 177 CONFIG_TETRIX noncore/games/tetrixtetrix.pro
177 CONFIG_TEXTEDIT core/apps/textedittextedit.pro 178 CONFIG_TEXTEDIT core/apps/textedittextedit.pro
178 CONFIG_THEME noncore/styles/themetheme.pro 179 CONFIG_THEME noncore/styles/themetheme.pro
179 CONFIG_TICTAC noncore/games/tictactictac.pro 180 CONFIG_TICTAC noncore/games/tictactictac.pro
180 CONFIG_TINYKATE noncore/apps/tinykatetinykate.pro 181 CONFIG_TINYKATE noncore/apps/tinykatetinykate.pro
181CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro 182CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro
182 CONFIG_TODAY core/pim/todaytoday.pro 183 CONFIG_TODAY core/pim/todaytoday.pro
183 CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebookdatebook.pro 184 CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebookdatebook.pro
184CONFIG_TODAY_EXAMPLE examples/todayplugin example.pro 185CONFIG_TODAY_EXAMPLE examples/todayplugin example.pro
185 CONFIG_TODAY_FORTUNE noncore/todayplugins/fortunefortune.pro 186 CONFIG_TODAY_FORTUNE noncore/todayplugins/fortunefortune.pro
186 CONFIG_TODAY_MAIL core/pim/today/plugins/mailmail.pro 187 CONFIG_TODAY_MAIL core/pim/today/plugins/mailmail.pro
187 CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlibstocktickerlib.pro 188 CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlibstocktickerlib.pro
188 CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stocktickerstockticker.pro 189 CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stocktickerstockticker.pro
189 CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolisttodolist.pro 190 CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolisttodolist.pro
190 CONFIG_TODAY_WEATHERnoncore/todayplugins/weather weather.pro 191 CONFIG_TODAY_WEATHERnoncore/todayplugins/weather weather.pro
191 CONFIG_TODO core/pim/todotodo.pro 192 CONFIG_TODO core/pim/todotodo.pro
192 CONFIG_TONLEITER noncore/multimedia/tonleitertonleiter.pro 193 CONFIG_TONLEITER noncore/multimedia/tonleitertonleiter.pro
193 CONFIG_TRACKER noncore/multimedia/trackertracker.pro 194 CONFIG_TRACKER noncore/multimedia/trackertracker.pro
194 CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro 195 CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro
195 CONFIG_UNIKEYBOARD inputmethods/unikeyboardunikeyboard.pro 196 CONFIG_UNIKEYBOARD inputmethods/unikeyboardunikeyboard.pro
196 CONFIG_USERMANAGER noncore/settings/usermanagerusermanager.pro 197 CONFIG_USERMANAGER noncore/settings/usermanagerusermanager.pro
197 CONFIG_VMEMO core/applets/vmemovmemo.pro 198 CONFIG_VMEMO core/applets/vmemovmemo.pro
198 CONFIG_VOLUMEAPPLET core/applets/volumeappletvolumeapplet.pro 199 CONFIG_VOLUMEAPPLET core/applets/volumeappletvolumeapplet.pro
199 CONFIG_VTAPPLET core/applets/vtappletvtapplet.pro 200 CONFIG_VTAPPLET core/applets/vtappletvtapplet.pro
200 CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavpluginwavplugin.pro 201 CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavpluginwavplugin.pro
201 CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro 202 CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro
202 CONFIG_WIRELESSAPPLET noncore/applets/wirelessappletwirelessapplet.pro 203 CONFIG_WIRELESSAPPLET noncore/applets/wirelessappletwirelessapplet.pro
203 CONFIG_WLAN noncore/settings/networksettings/wlanwlan.pro 204 CONFIG_WLAN noncore/settings/networksettings/wlanwlan.pro
204 CONFIG_WORDGAME noncore/games/wordgamewordgame.pro 205 CONFIG_WORDGAME noncore/games/wordgamewordgame.pro
205 CONFIG_YATZEE noncore/games/oyatzeeoyatzee.pro 206 CONFIG_YATZEE noncore/games/oyatzeeoyatzee.pro
206CONFIG_ZKBAPPLET noncore/applets/zkbapplet zkbapplet.pro 207CONFIG_ZKBAPPLET noncore/applets/zkbapplet zkbapplet.pro
207 CONFIG_ZLINES noncore/games/zlines zlines.pro 208 CONFIG_ZLINES noncore/games/zlines zlines.pro
208 CONFIG_ZSAFEnoncore/apps/zsafe zsafe.pro 209 CONFIG_ZSAFEnoncore/apps/zsafe zsafe.pro
209 CONFIG_ZSAME noncore/games/zsame zsame.pro 210 CONFIG_ZSAME noncore/games/zsame zsame.pro