mkimage-profiles/bin/pkgdups
Michael Shigorin f4519332e9 READMEs: pkglist related clarification
glebfm@ asked what to do with new package lists: whether these
belong to features, or to distributions themselves.  This question
is actually open and up for discussion but there are guidelines
that can and should be written down already; and so they were.

Added pkgdups utility reference as well.
2012-04-09 22:21:10 +03:00

21 lines
398 B
Bash
Executable File

#!/bin/sh
# a script to help weed out duplicate packages
# contained in package lists given as arguments
#
# Requires: libshell
. /bin/shell-quote
sort "$@" \
| grep -v '^ *#' \
| sed -s 's,[ ]\+, ,g' \
| grep -v '^ *$' \
| uniq -cd \
| while read num str; do
echo -n "$str: $num ";
pattern="`quote_sed_regexp "$str"`"
grep -l "^$pattern$" "$@" | tr '\n' ' '
echo
done \
| sort -rn -t: -k2