@@ -332,9 +332,9 @@ QStringList *Package::getOutdatedAURStringList()
332332{
333333 QStringList * res = new QStringList ();
334334
335- if (StrConstants:: getForeignRepositoryToolName () != " yaourt" &&
336- StrConstants:: getForeignRepositoryToolName () != " pacaur" &&
337- StrConstants:: getForeignRepositoryToolName () != " kcp" )
335+ if (getForeignRepositoryToolName () != " yaourt" &&
336+ getForeignRepositoryToolName () != " pacaur" &&
337+ getForeignRepositoryToolName () != " kcp" )
338338 return res;
339339
340340 QString outPkgList = UnixCommand::getOutdatedAURPackageList ();
@@ -345,8 +345,8 @@ QStringList *Package::getOutdatedAURStringList()
345345 {
346346 QStringList parts = packageTuple.split (' ' , QString::SkipEmptyParts);
347347 {
348- if (StrConstants:: getForeignRepositoryToolName () == " yaourt" ||
349- StrConstants:: getForeignRepositoryToolName () == " kcp" )
348+ if (getForeignRepositoryToolName () == " yaourt" ||
349+ getForeignRepositoryToolName () == " kcp" )
350350 {
351351 QString pkgName;
352352 pkgName = parts[0 ];
@@ -355,7 +355,13 @@ QStringList *Package::getOutdatedAURStringList()
355355 pkgName = pkgName.remove (" [1;36m" );
356356 pkgName = pkgName.remove (" [1;32m" );
357357 pkgName = pkgName.remove (" [m" );
358- pkgName = pkgName.remove (" [1m" );
358+ pkgName = pkgName.remove (" [1m" );
359+
360+ if (getForeignRepositoryToolName () == " yaourt" )
361+ {
362+ if (!pkgName.startsWith (StrConstants::getForeignRepositoryTargetPrefix ()))
363+ continue ;
364+ }
359365
360366 if (pkgName.contains (StrConstants::getForeignRepositoryTargetPrefix (), Qt::CaseInsensitive))
361367 {
@@ -367,11 +373,14 @@ QStringList *Package::getOutdatedAURStringList()
367373 }
368374 }
369375 }
370- else if (StrConstants:: getForeignRepositoryToolName () == " pacaur" )
376+ else if (getForeignRepositoryToolName () == " pacaur" )
371377 {
372378 QString pkgName;
373379 if (parts.count () >= 2 )
374380 {
381+ if (parts[1 ] != StrConstants::getForeignRepositoryTargetPrefix ())
382+ continue ;
383+
375384 pkgName = parts[2 ];
376385 pkgName = pkgName.remove (" \033 " );
377386 pkgName = pkgName.remove (" [1;31m" );
@@ -381,7 +390,7 @@ QStringList *Package::getOutdatedAURStringList()
381390 pkgName = pkgName.remove (" [1;39m" );
382391 pkgName = pkgName.remove (" [m" );
383392 pkgName = pkgName.remove (" [0m" );
384- pkgName = pkgName.remove (" [1m" );
393+ pkgName = pkgName.remove (" [1m" );
385394
386395 // Let's ignore the "IgnorePkg" list of packages...
387396 if (!ignorePkgList.contains (pkgName))
@@ -711,7 +720,7 @@ QString Package::getAURUrl(const QString &pkgName)
711720{
712721 QString url=" " ;
713722
714- if (StrConstants:: getForeignRepositoryToolName () != " kcp" )
723+ if (getForeignRepositoryToolName () != " kcp" )
715724 {
716725 QString pkgInfo = UnixCommand::getAURUrl (pkgName);
717726 url = getURL (pkgInfo);
@@ -793,7 +802,7 @@ QList<PackageListData> * Package::getAURPackageList(const QString& searchString)
793802 pkgVotes = 0 ;
794803
795804 // Chakra does not have popularity support in CCR
796- QString aurTool = StrConstants:: getForeignRepositoryToolName ();
805+ QString aurTool = getForeignRepositoryToolName ();
797806
798807 if (aurTool != " chaser" && aurTool != " pacaur" && strVotes.count () > 0 )
799808 {
@@ -1508,9 +1517,9 @@ QHash<QString, QString> Package::getAUROutdatedPackagesNameVersion()
15081517 QHash<QString, QString> hash;
15091518
15101519 if (UnixCommand::getLinuxDistro () == ectn_CHAKRA ||
1511- (StrConstants:: getForeignRepositoryToolName () != " yaourt" &&
1512- StrConstants:: getForeignRepositoryToolName () != " pacaur" &&
1513- StrConstants:: getForeignRepositoryToolName () != " kcp" ))
1520+ (getForeignRepositoryToolName () != " yaourt" &&
1521+ getForeignRepositoryToolName () != " pacaur" &&
1522+ getForeignRepositoryToolName () != " kcp" ))
15141523 {
15151524 return hash;
15161525 }
@@ -1519,8 +1528,8 @@ QHash<QString, QString> Package::getAUROutdatedPackagesNameVersion()
15191528 QStringList listOfPkgs = res.split (" \n " , QString::SkipEmptyParts);
15201529 QStringList ignorePkgList = UnixCommand::getIgnorePkgsFromPacmanConf ();
15211530
1522- if ((StrConstants:: getForeignRepositoryToolName () == " yaourt" ) ||
1523- (StrConstants:: getForeignRepositoryToolName () == " kcp" ))
1531+ if ((getForeignRepositoryToolName () == " yaourt" ) ||
1532+ (getForeignRepositoryToolName () == " kcp" ))
15241533 {
15251534 foreach (QString line, listOfPkgs)
15261535 {
@@ -1537,16 +1546,19 @@ QHash<QString, QString> Package::getAUROutdatedPackagesNameVersion()
15371546 QStringList nameVersion = line.split (" " , QString::SkipEmptyParts);
15381547 QString pkgName = nameVersion.at (0 );
15391548
1540- if (StrConstants:: getForeignRepositoryToolName () == " kcp" )
1549+ if (getForeignRepositoryToolName () == " kcp" )
15411550 {
15421551 // Let's ignore the "IgnorePkg" list of packages...
15431552 if (!ignorePkgList.contains (pkgName))
15441553 {
15451554 hash.insert (pkgName, nameVersion.at (1 ));
15461555 }
15471556 }
1548- else
1557+ else // It's yaourt!
15491558 {
1559+ if (!pkgName.startsWith (StrConstants::getForeignRepositoryTargetPrefix ()))
1560+ continue ;
1561+
15501562 // Let's ignore the "IgnorePkg" list of packages...
15511563 if (!ignorePkgList.contains (pkgName))
15521564 {
@@ -1559,7 +1571,7 @@ QHash<QString, QString> Package::getAUROutdatedPackagesNameVersion()
15591571 }
15601572 }
15611573 }
1562- else if (StrConstants:: getForeignRepositoryToolName () == " pacaur" )
1574+ else if (getForeignRepositoryToolName () == " pacaur" )
15631575 {
15641576 foreach (QString line, listOfPkgs)
15651577 {
@@ -1574,6 +1586,10 @@ QHash<QString, QString> Package::getAUROutdatedPackagesNameVersion()
15741586 line = line.remove (" [1m" );
15751587
15761588 QStringList sl = line.split (" " , QString::SkipEmptyParts);
1589+
1590+ if (sl[1 ] != StrConstants::getForeignRepositoryTargetPrefix ())
1591+ continue ;
1592+
15771593 if (sl.count () >= 6 )
15781594 {
15791595 hash.insert (sl.at (2 ), sl.at (5 ));
@@ -1701,3 +1717,25 @@ bool Package::hasPacmanDatabase()
17011717
17021718 return answer;
17031719}
1720+
1721+ QString Package::getForeignRepositoryToolName ()
1722+ {
1723+ static bool first=true ;
1724+ static QString ret;
1725+
1726+ if (first)
1727+ {
1728+ if ( UnixCommand::getLinuxDistro () == ectn_CHAKRA )
1729+ ret = QLatin1String ( " chaser" );
1730+ else if (UnixCommand::getLinuxDistro () == ectn_KAOS)
1731+ ret = QLatin1String ( " kcp" );
1732+ else if (UnixCommand::hasTheExecutable (" pacaur" ))
1733+ ret = QLatin1String ( " pacaur" );
1734+ else
1735+ ret = QLatin1String ( " yaourt" );
1736+
1737+ first = false ;
1738+ }
1739+
1740+ return ret;
1741+ }
0 commit comments