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
This commit is contained in:
parent
5634324b65
commit
a4a40a4b02
@ -11,6 +11,7 @@
|
|||||||
- Make 'cat' and 'readme' use $PAGER if set
|
- Make 'cat' and 'readme' use $PAGER if set
|
||||||
- update default prt-get.conf to reflect new port hierarchy (core/opt/contrib)
|
- update default prt-get.conf to reflect new port hierarchy (core/opt/contrib)
|
||||||
- add timestamps to log files
|
- add timestamps to log files
|
||||||
|
- fix aliasing bug introduce earlier in the .12 session (thanks Mark)
|
||||||
|
|
||||||
* 0.5.11 29.05.2005 Johannes Winkelmann
|
* 0.5.11 29.05.2005 Johannes Winkelmann
|
||||||
- add --path to 'ls'
|
- add --path to 'ls'
|
||||||
|
@ -55,7 +55,7 @@ bool PkgDB::isInstalled( const string& name,
|
|||||||
if ( !load() ) {
|
if ( !load() ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool installed = m_packages.find( name ) != m_packages.end();
|
bool installed = m_packages.find( name ) != m_packages.end();
|
||||||
if (!installed && useAlias) {
|
if (!installed && useAlias) {
|
||||||
string provider;
|
string provider;
|
||||||
@ -68,6 +68,10 @@ bool PkgDB::isInstalled( const string& name,
|
|||||||
*aliasOrignalName = provider;
|
*aliasOrignalName = provider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (isAlias) {
|
||||||
|
*isAlias = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return installed;
|
return installed;
|
||||||
@ -81,13 +85,13 @@ bool PkgDB::aliasExistsFor(const string& name, string& providerName) const
|
|||||||
map<string, string>::iterator it = m_aliases.begin();
|
map<string, string>::iterator it = m_aliases.begin();
|
||||||
for (; it != m_aliases.end(); ++it) {
|
for (; it != m_aliases.end(); ++it) {
|
||||||
StringHelper::split(it->second, ',',
|
StringHelper::split(it->second, ',',
|
||||||
m_splitAliases[it->first]);
|
m_splitAliases[it->first]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map<string, vector<string> >::iterator it = m_splitAliases.begin();
|
map<string, vector<string> >::iterator it = m_splitAliases.begin();
|
||||||
for (; it != m_splitAliases.end(); ++it) {
|
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()) {
|
it->second.end()) {
|
||||||
providerName = it->first;
|
providerName = it->first;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1225,12 +1225,12 @@ bool PrtGet::printFile(const string& file)
|
|||||||
if (!File::fileExists(file)) {
|
if (!File::fileExists(file)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* pager = getenv("PAGER");
|
char* pager = getenv("PAGER");
|
||||||
if (pager) {
|
if (pager) {
|
||||||
Process proc(pager, file);
|
Process proc(pager, file);
|
||||||
proc.executeShell();
|
proc.executeShell();
|
||||||
} else {
|
} else {
|
||||||
FILE* fp = fopen( file.c_str(), "r" );
|
FILE* fp = fopen( file.c_str(), "r" );
|
||||||
char buf[255];
|
char buf[255];
|
||||||
if ( fp ) {
|
if ( fp ) {
|
||||||
@ -1240,7 +1240,7 @@ bool PrtGet::printFile(const string& file)
|
|||||||
fclose( fp );
|
fclose( fp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user