fix printf when used with --regex

strip parentheses from the Optionals line

replace deprecated autotools commands in INSTALL
This commit is contained in:
John McQuah 2023-12-23 13:50:23 +00:00
parent d9ec1c1e98
commit dad928b20f
3 changed files with 9 additions and 42 deletions

View File

@ -1,6 +1,7 @@
Installing prt-get
------------------
Installing prt-get is just a matter of
./configure
make
make install
meson setup bld --prefix=/usr
cd bld && meson compile
meson install

View File

@ -213,50 +213,16 @@ void Package::load() const
StringHelper::replaceAll( softdeps, " ", "," );
StringHelper::replaceAll( softdeps, ",,", "," );
StringHelper::replaceAll( softdeps, "(", "" );
StringHelper::replaceAll( softdeps, ")", "" );
// TODO: decide which one to use
#if 0
// remove commented out packages
list<string> softDepList = StringHelper::split( softdeps, ',' );
list<string>::iterator it = deps.begin();
for ( ; it != softDepList.end(); ++it ) {
if ( (*it)[0] == '#' ) {
cerr << "Commented dep: " << *it << endl;
} else {
if ( it != softDepsList.begin() ) {
m_data->optionals += ",";
}
m_data->optionals += *it;
}
}
#else
m_data->optionals = softdeps;
#endif
} else if ( startsWithNoCase( line, "dep" ) ) {
string depends = stripWhiteSpace( getValue( line, ':' ) );
StringHelper::replaceAll( depends, " ", "," );
StringHelper::replaceAll( depends, ",,", "," );
// TODO: decide which one to use
#if 0
// remove commented out packages
list<string> deps = StringHelper::split( depends, ',' );
list<string>::iterator it = deps.begin();
for ( ; it != deps.end(); ++it ) {
if ( (*it)[0] == '#' ) {
cerr << "Commented dep: " << *it << endl;
} else {
if ( it != deps.begin() ) {
m_data->depends += ",";
}
m_data->depends += *it;
}
}
#else
m_data->depends = depends;
#endif
}
}
}

View File

@ -70,8 +70,8 @@ PrtGet::PrtGet( const ArgParser* parser )
m_pkgDB = new PkgDB(m_parser->installRoot());
readConfig();
m_useRegex = m_config->useRegex() || m_parser->useRegex();
m_followSoftdeps = m_config->followSoftdeps() || m_parser->followSoftdeps();
m_useRegex = ( m_config->useRegex() || m_parser->useRegex() );
m_followSoftdeps = ( m_config->followSoftdeps() || m_parser->followSoftdeps() );
}
/*! destruct PrtGet object */
@ -1263,7 +1263,7 @@ void PrtGet::printf()
assertExactArgCount(1);
initRepo();
string filter = m_parser->useRegex() ? "." : "*";
string filter = m_useRegex ? ".*" : "*";
if ( m_parser->hasFilter() ) {
filter = m_parser->filter();
}