diff options
author | Johannes Winkelmann <jw@smts.ch> | 2006-04-08 09:41:02 +0000 |
---|---|---|
committer | Johannes Winkelmann <jw@smts.ch> | 2006-04-08 09:41:02 +0000 |
commit | a4a40a4b02be44729d1e52c560c81c4ef0fc40c6 (patch) | |
tree | 4bbfd31c418cd0c33445b252279bc0b2692342ab /src | |
parent | 5634324b6525fd1f95d40e6ed4e3126ca55ce50a (diff) | |
download | prt-get-a4a40a4b02be44729d1e52c560c81c4ef0fc40c6.tar.gz prt-get-a4a40a4b02be44729d1e52c560c81c4ef0fc40c6.tar.xz |
prt-get: hidden within trailing whitespace removals, a fix for aliases in deptree
git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1179 0b5ae1c7-2405-0410-a7fc-ba219f786e1e
Diffstat (limited to 'src')
-rw-r--r-- | src/pkgdb.cpp | 12 | ||||
-rw-r--r-- | src/prtget.cpp | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/pkgdb.cpp b/src/pkgdb.cpp index f264300..48eb279 100644 --- a/src/pkgdb.cpp +++ b/src/pkgdb.cpp @@ -55,7 +55,7 @@ bool PkgDB::isInstalled( const string& name, if ( !load() ) { return false; } - + bool installed = m_packages.find( name ) != m_packages.end(); if (!installed && useAlias) { string provider; @@ -68,6 +68,10 @@ bool PkgDB::isInstalled( const string& name, *aliasOrignalName = provider; } } + } else { + if (isAlias) { + *isAlias = false; + } } return installed; @@ -81,13 +85,13 @@ bool PkgDB::aliasExistsFor(const string& name, string& providerName) const map<string, string>::iterator it = m_aliases.begin(); for (; it != m_aliases.end(); ++it) { StringHelper::split(it->second, ',', - m_splitAliases[it->first]); + m_splitAliases[it->first]); } } - + map<string, vector<string> >::iterator it = m_splitAliases.begin(); for (; it != m_splitAliases.end(); ++it) { - if (find(it->second.begin(), it->second.end(), name) != + if (find(it->second.begin(), it->second.end(), name) != it->second.end()) { providerName = it->first; return true; diff --git a/src/prtget.cpp b/src/prtget.cpp index 9deb26b..92d36d4 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -1225,12 +1225,12 @@ bool PrtGet::printFile(const string& file) if (!File::fileExists(file)) { return false; } - + char* pager = getenv("PAGER"); if (pager) { Process proc(pager, file); proc.executeShell(); - } else { + } else { FILE* fp = fopen( file.c_str(), "r" ); char buf[255]; if ( fp ) { @@ -1240,7 +1240,7 @@ bool PrtGet::printFile(const string& file) fclose( fp ); } } - + return true; } |