Files
common/provides.sh
Patrick McCarty 7203329212 Move conf files into dedicated "conf" directory
The "image-creator" and "koji-client-files" subdirectories are named as
such to reflect their purpose from long ago. In the present, the names
are confusing, so I am shuffling files around a bit to reflect current
usage.

All conf files (or conf file templates) have been moved to "conf"
instead, and some documentation has been added to explain what the files
are used for, and how they can be customized.

Also, after moving the conf files, the last file remaining in one of the
old subdirectories is "start_qemu.sh", so move it to the toplevel dir.
We could eventually move the miscellaneous scripts into a dedicated
directory too, but I will save that for another time.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-05-30 13:15:17 -07:00

63 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
RELEASE=0
FILE_PATH="-r"
show_help() {
echo "Usage: $0 [OPTIONS]"
echo
echo "Search "
echo
echo " -f, --file PATH full file path to search."
echo
echo "Optional: "
echo " -r, --release RELEASE OS release number. Ex. 18400"
echo " if not specified last release will be used"
echo
}
if [ "$#" -eq 0 ]; then
show_help
exit 0
fi
if [ ! -e /etc/yum.conf ]; then
echo "Error: yum.conf is missing. Please copy projects/common/conf/yum.conf to /etc"
exit 1
fi
while [ -n "$1" ]; do
case "$1" in
-r | --release)
shift
RELEASE=$1
shift
;;
-f | --file)
shift
FILE_PATH=$1
shift
;;
*)
echo "$1: Invalid option" 1>&2
exit 1
;;
esac
done
if [ "${RELEASE}" = "0" -o -z "${RELEASE}" ]; then
RELEASE=$(curl -s https://download.clearlinux.org/latest)
fi
if [ "${FILE_PATH}" = "-r" ]; then
show_help
exit 1
fi
REPO_URL="https://download.clearlinux.org/releases/${RELEASE}/clear/x86_64/os"
repoquery --repoid=${RELEASE} \
--repofrompath=${RELEASE},${REPO_URL} \
--whatprovides ${FILE_PATH}