• Michael Shigorin's avatar
    READMEs: pkglist related clarification · f4519332
    Michael Shigorin authored
    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.
    f4519332
pkgdups 398 Bytes
#!/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