summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 844f43f..998dae9 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -173,13 +173,13 @@ void PackageList::readFileEntries( QString filename, QString dest )
pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest);
QStringList packEntry;
QFile f( filename );
if ( !f.open(IO_ReadOnly) ) return;
QTextStream *statusStream = new QTextStream( &f );
while ( !statusStream ->eof() )
- {
+ {
QString line = statusStream->readLine();
if ( line.find(QRegExp("[\n\t ]*")) || line == "" )
{
//end of package
if ( ! packEntry.isEmpty() )
{
@@ -192,12 +192,23 @@ void PackageList::readFileEntries( QString filename, QString dest )
}
}
}else{
packEntry << line;
};
}
+ //there might be no nl at the end of the package file
+ if ( ! packEntry.isEmpty() )
+ {
+ Package *p = new Package( packEntry, settings );
+ if ( p )
+ {
+ p->setDest( dest );
+ insertPackage( p );
+ packEntry.clear();
+ }
+ }
delete statusStream;
return;
}
void PackageList::setSettings( PackageManagerSettings *s )
{