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