prt-get: simplify default output of dup; allow passing a printf style pattern
git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1835 0b5ae1c7-2405-0410-a7fc-ba219f786e1e
This commit is contained in:
parent
01f7f05e78
commit
261cc30ba2
@ -2,6 +2,7 @@
|
|||||||
- Show undecided versions in diff and sysup when using "prefer higher"
|
- Show undecided versions in diff and sysup when using "prefer higher"
|
||||||
- fix display bug in "dependent"
|
- fix display bug in "dependent"
|
||||||
- fix bug in version comparator
|
- fix bug in version comparator
|
||||||
|
- Simplify output of 'dup', suggested by maro (-v -> old format)
|
||||||
|
|
||||||
* 0.5.12 00.04.2006 Johannes Winkelmann
|
* 0.5.12 00.04.2006 Johannes Winkelmann
|
||||||
- Add 'depinst' in 'help' (thanks Simone)
|
- Add 'depinst' in 'help' (thanks Simone)
|
||||||
|
@ -223,10 +223,24 @@ Subtrees already shown are marked with '-->' to save some space, in
|
|||||||
order to show them all, add the --all switch
|
order to show them all, add the --all switch
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B dup
|
.B dup [-v] [format]
|
||||||
List ports which can be found in multiple directories configured in
|
List ports which can be found in multiple directories configured in
|
||||||
.B /etc/prt-get.conf
|
.B /etc/prt-get.conf
|
||||||
|
Use the verbose switch to simulate the output of version 5.12 and older (likely
|
||||||
|
to go away in the future). The format string can be used to create user
|
||||||
|
specified formats. The following symbols are currently replaced:
|
||||||
|
|
||||||
|
.TP
|
||||||
|
\ \ \ \(bu
|
||||||
|
%n \-> name of the port
|
||||||
|
|
||||||
|
.TP
|
||||||
|
\ \ \ \(bu
|
||||||
|
%1 \-> Port which takes precedence
|
||||||
|
|
||||||
|
.TP
|
||||||
|
\ \ \ \(bu
|
||||||
|
%2 \-> Port which is hidden
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B list [\-v|\-vv] [filter] [--path] [--regex]
|
.B list [\-v|\-vv] [filter] [--path] [--regex]
|
||||||
|
@ -267,14 +267,24 @@ void PrtGet::listShadowed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
initRepo( true );
|
initRepo( true );
|
||||||
cout << "Hidden packages:" << endl;
|
|
||||||
|
string format = "%1 > %2\n";
|
||||||
|
if (m_parser->otherArgs().size() > 0)
|
||||||
|
format = *(m_parser->otherArgs().begin());
|
||||||
|
else if (m_parser->verbose() > 0)
|
||||||
|
format = "* %n\n %1 preceeds over \n %2\n";
|
||||||
|
|
||||||
|
string output;
|
||||||
map<string, pair<string, string> >::const_iterator it =
|
map<string, pair<string, string> >::const_iterator it =
|
||||||
m_repo->shadowedPackages().begin();
|
m_repo->shadowedPackages().begin();
|
||||||
for ( ; it != m_repo->shadowedPackages().end(); ++it ) {
|
for ( ; it != m_repo->shadowedPackages().end(); ++it ) {
|
||||||
string name = it->first;
|
output = format;
|
||||||
cout << "* " << name << endl;
|
StringHelper::replaceAll(output, "%n", it->first);
|
||||||
cout << " " << it->second.second << " preceeds over" << endl;
|
StringHelper::replaceAll(output, "%1", it->second.second);
|
||||||
cout << " " << it->second.first << endl;
|
StringHelper::replaceAll(output, "%2", it->second.first);
|
||||||
|
|
||||||
|
StringHelper::replaceAll(output, "\\n", "\n");
|
||||||
|
cout << output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,9 +228,9 @@ void Repository::initFromFS( const list< pair<string, string> >& rootList,
|
|||||||
} else if ( listDuplicate ) {
|
} else if ( listDuplicate ) {
|
||||||
Package* old = hidden->second;
|
Package* old = hidden->second;
|
||||||
string ps = p->path() + "/" + p->name() +
|
string ps = p->path() + "/" + p->name() +
|
||||||
"-" + p->version();
|
" " + p->versionReleaseString();
|
||||||
string os = old->path() + "/" + old->name() +
|
string os = old->path() + "/" + old->name() +
|
||||||
"-" + old->version();
|
" " + old->versionReleaseString();
|
||||||
m_shadowedPackages[name] = make_pair( ps, os );
|
m_shadowedPackages[name] = make_pair( ps, os );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user