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