00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef IPKG_H
00031 #define IPKG_H
00032
00033
00038 #include <qobject.h>
00039 #include <qstring.h>
00040 #include <qstringlist.h>
00041 #include <qlist.h>
00042
00043 #define FORCE_DEPENDS 0x0001
00044 #define FORCE_REMOVE 0x0002
00045 #define FORCE_REINSTALL 0x0004
00046 #define FORCE_OVERWRITE 0x0008
00047 #define MAKE_LINKS 0x0010
00048 #define VERBOSE_WGET 0x0020
00049
00050 namespace Opie {namespace Core {class OProcess;}}
00051
00052 class Ipkg : public QObject
00053 {
00054 Q_OBJECT
00055 public:
00056 Ipkg();
00057 ~Ipkg();
00058 void runIpkg();
00059 void createSymLinks();
00060
00061 void setOption( const char *opt ) { option = opt; }
00062 void setPackage( const char *pkg ) { package = pkg; }
00063 void setDestination( const char *dest ) { destination = dest; }
00064 void setDestinationDir( const char *dir ) { destDir = dir; }
00065 void setFlags( int fl, int il ) { flags = fl; infoLevel = il; }
00066 void setRuntimeDirectory( const char *dir ) { runtimeDir = dir; }
00067
00068 signals:
00069 void outputText( const QString &text );
00070 void ipkgFinished();
00071
00072 public slots:
00073 void linkCommandStdout(Opie::Core::OProcess*, char *buffer, int buflen);
00074 void commandStdout(Opie::Core::OProcess*, char *buffer, int buflen);
00075 void commandStderr(Opie::Core::OProcess*, char *buffer, int buflen);
00076 void linkProcessFinished();
00077 void processFinished();
00078 void abort();
00079
00080
00081 private:
00082 bool createLinks;
00083 bool aborted;
00084 bool error;
00085 QString option;
00086 QString package;
00087 QString destination;
00088 QString destDir;
00089 QString runtimeDir;
00090 Opie::Core::OProcess *proc;
00091 int flags;
00092 int infoLevel;
00093 bool finished;
00094
00095 QList<QString> *dependantPackages;
00096
00097 int executeIpkgLinkCommand( QStringList *cmd );
00098 int executeIpkgCommand( QStringList &cmd, const QString option );
00099 void removeStatusEntry();
00100 void linkPackage( const QString &packFileName, const QString &dest, const QString &destDir );
00101 QStringList* getList( const QString &packageFilename, const QString &destDir );
00102 void processFileList( const QStringList *fileList, const QString &destDir );
00103 void processLinkDir( const QString &file, const QString &baseDir, const QString &destDir );
00104
00105 };
00106
00107 #endif