You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
398 B
20 lines
398 B
#!/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
|
|
|