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