18f84f
#!/bin/bash -
18f84f
18f84f
# Generate RPM requires automatically for supermin appliances.
18f84f
# Copyright (C) 2009-2015 Red Hat Inc.
18f84f
18f84f
# This script is called with a list of supermin.d/*packages* files
18f84f
# (either passed on the command line, or if that is empty, then passed
18f84f
# through stdin).  Each file is a simple list of packages, so we
18f84f
# simply have to `cat' the contents in order to get the list of
18f84f
# requires - it could hardly be simpler.
18f84f
18f84f
function process_file
18f84f
{
18f84f
    cat "$1"
18f84f
}
18f84f
18f84f
if [ "$#" -ge 1 ]; then
18f84f
    for f in "$@"; do
18f84f
        process_file "$f"
18f84f
    done
18f84f
else
18f84f
    # Get the list of files from stdin.  One filename per line?
18f84f
    while read line; do
18f84f
        process_file "$line"
18f84f
    done
18f84f
fi