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