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