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