#!/bin/sh
# $Id: rpm-erase,v 1.2 2011/10/31 22:10:22 friedman Exp $

# Older linux distributions cannot handle 2^17 or more max-chars.
size=65536

case $* in
  *"*"* ) verbose=--verbose ;;
esac

rpm --qf "%{NAME}\n" --nodigest --nosignature -qa "$@" \
 | xargs $verbose \
    --no-run-if-empty \
    --max-args  $size \
    --max-chars $size \
    rpm --erase --allmatches

# eof
