From 8f67324fd1a60c165ae7043b9457f911b9690e43 Mon Sep 17 00:00:00 2001 From: tille Date: Wed, 24 Apr 2002 09:33:16 +0000 Subject: fixed: ipkg c version issues --- (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 681f2d4..94ca824 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -23,6 +24,9 @@ #include "runwindow.h" +#define PARSE_FILELIST +// #define IPKG_FILELIST + PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) // : RunWindow ( p, name, f ) : QObject ( p ) @@ -52,7 +56,7 @@ int PmIpkg::runIpkg(const QString& args) cmd += " -dest "+settings->getDestinationName(); cmd += " -force-defaults "; - out( "Starting to "+ args+"
\n"); + out( "

Starting to "+ args+"
\n"); cmd += args; out( "running:
\n"+cmd+"
\n" ); int r = 0; @@ -66,6 +70,7 @@ int PmIpkg::runIpkg(const QString& args) #ifdef SYSTEM QString redirect = "/tmp/oipkg.pipe"; cmd += " | tee "+redirect+" 2>&1"; + pvDebug(2, "running >"+cmd+"<"); r = system(cmd.latin1()); QFile f( redirect ); while ( ! f.open(IO_ReadOnly) ) {}; @@ -85,14 +90,30 @@ int PmIpkg::runIpkg(const QString& args) return r; } -void PmIpkg::makeLinks(QString file) +void PmIpkg::makeLinks(QString pack) { + pvDebug( 2, "PmIpkg::makeLinks "+ pack); out( "
creating links
" ); QString dest = settings->getDestinationUrl(); - out("for package "+file+" in "+dest+"
"); - system(("ipkg -d "+dest+" files "+file+"> /tmp/oipkg.pipe 2>&1").latin1()); + out("for package "+pack+" in "+dest+"
"); +#ifdef IPKG_FILELIST + system(("ipkg -d "+dest+" files "+pack+"> /tmp/oipkg.pipe 2>&1").latin1()); QFile f( "/tmp/oipkg.pipe" ); while ( ! f.open(IO_ReadOnly) ) {}; +#endif +#ifdef PARSE_FILELIST + { + Config cfg( "oipkg", Config::User ); + cfg.setGroup( "Common" ); + QString statusDir = cfg.readEntry( "statusDir", "" ); + } + QString fn = dest+"/"+statusDir+"/info/"+pack+".list"; + QFile f( fn ); + if ( ! f.open(IO_ReadOnly) ) + { + out( "Panik! Could not open:
"+fn ); + }; +#endif QTextStream t( &f ); QString fp; while ( !t.eof() ) @@ -105,7 +126,14 @@ void PmIpkg::makeLinks(QString file) void PmIpkg::processLinkDir( QString file, QString dest ) { + +#ifdef PARSE_FILELIST + QString destFile = file; + file = dest+"/"+file; +#endif +#ifdef IPKG_FILELIST QString destFile = file.right( file.length() - dest.length() ); +#endif QFileInfo fileInfo( file ); if ( fileInfo.isDir() ) { -- cgit v0.9.0.2