Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ipkg.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the OPIE Project
00003 
00004                =.            Copyright (c)  2002 Andy Qua <andy.qua@blueyonder.co.uk>
00005              .=l.                                Dan Williams <drw@handhelds.org>
00006            .>+-=
00007  _;:,     .>    :=|.         This file is free software; you can
00008 .> <`_,   >  .   <=          redistribute it and/or modify it under
00009 :`=1 )Y*s>-.--   :           the terms of the GNU General Public
00010 .="- .-=="i,     .._         License as published by the Free Software
00011  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00012      ._= =}       :          or (at your option) any later version.
00013     .%`+i>       _;_.
00014     .i_,=:_.      -<s.       This file is distributed in the hope that
00015      +  .  -:.       =       it will be useful, but WITHOUT ANY WARRANTY;
00016     : ..    .:,     . . .    without even the implied warranty of
00017     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00018   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU General
00019 ..}^=.=       =       ;      Public License for more details.
00020 ++=   -.     .`     .:
00021  :     =  ...= . :.=-        You should have received a copy of the GNU
00022  -.   .:....=;==+<;          General Public License along with this file;
00023   -_. . .   )=.  =           see the file COPYING. If not, write to the
00024     --        :-=`           Free Software Foundation, Inc.,
00025                              59 Temple Place - Suite 330,
00026                              Boston, MA 02111-1307, USA.
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

Generated on Sat Nov 5 16:17:47 2005 for OPIE by  doxygen 1.4.2