summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_source_files.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build/get_source_files.sh')
-rwxr-xr-xredhat/build/get_source_files.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/redhat/build/get_source_files.sh b/redhat/build/get_source_files.sh
new file mode 100755
index 000000000..b52c023e8
--- /dev/null
+++ b/redhat/build/get_source_files.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+PKGNAME="${1##*/}"
+TDE_VERSION="${2:-14.0.0}"
+
+[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
+SPECFILE=$(get_specfile.sh ${PKGNAME} ${TDE_VERSION})
+SPECDIR="${SPECFILE%/*}"
+
+[ ! -r "${SPECFILE}" ] && exit 2
+
+while read var val; do
+ case "${var}" in
+ Source[0-9]*:|Source:|Patch[0-9]*:)
+ FILE=$(rpm -E "${SPECDIR}/${val##*/}")
+ if [ -r "${FILE}" ]; then
+ echo "${FILE}"
+ fi
+ ;;
+ esac
+done < "${SPECFILE}"