summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index eacef76..368548b 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -151,105 +151,103 @@ bool Ipkg :: runIpkg( )
if ( *pkg == package )
continue;
emit outputText( " " );
emit outputText( QString( "Creating symbolic links for " )+ (*pkg) );
linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir );
}
}
}
delete dependantPackages;
emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") );
emit outputText( "" );
return ret;
}
int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
{
FILE *fp = NULL;
char line[130];
QString lineStr, lineStrOld;
int ret = false;
fp = popen( (const char *) cmd, "r");
if ( fp == NULL )
{
cout << "Couldn't execute " << cmd << "! err = " << fp << endl;
QString text;
text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd );
emit outputText( text );
}
else
{
while ( fgets( line, sizeof line, fp) != NULL )
{
lineStr = line;
lineStr=lineStr.left( lineStr.length()-1 );
if ( lineStr != lineStrOld )
{
//See if we're finished
if ( option == "install" || option == "reinstall" )
{
// Need to keep track of any dependant packages that get installed
// so that we can create links to them as necessary
if ( lineStr.startsWith( "Installing " ) )
{
- cout << "LineStr = " << lineStr << endl;
int start = lineStr.find( " " ) + 1;
int end = lineStr.find( " ", start );
QString *package = new QString( lineStr.mid( start, end-start ) );
dependantPackages->append( package );
- cout << "installing dependant package <" << *package << ">" << endl;
}
}
-
+
if ( option == "update" )
{
if (lineStr.contains("Updated list"))
ret = true;
}
else if ( option == "download" )
{
if (lineStr.contains("Downloaded"))
ret = true;
}
else
{
if (lineStr.contains("Done"))
ret = true;
}
emit outputText( lineStr );
}
lineStrOld = lineStr;
qApp->processEvents();
}
pclose(fp);
}
return ret;
}
void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir )
{
if ( dest == "root" || dest == "/" )
return;
qApp->processEvents();
QStringList *fileList = getList( packFileName, destDir );
qApp->processEvents();
processFileList( fileList, destDir );
delete fileList;
}
QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir )
{
QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list";
QFile f( packageFileDir );
cout << "Try to open " << packageFileDir << endl;
if ( !f.open(IO_ReadOnly) )
{