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