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