summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_specfile.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2018-11-27 21:34:48 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2018-11-27 21:34:48 +0100
commita615d19df88eb2e989316b480519161945dbc7dc (patch)
tree369970b98042998b86c11024598155e037b76fec /redhat/build/get_specfile.sh
parent76a93e0011ade1583a1ec672f33411dfd35454f3 (diff)
downloadtde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.tar.gz
tde-packaging-a615d19df88eb2e989316b480519161945dbc7dc.zip
RPM: merge redhat directory with master branch
Diffstat (limited to 'redhat/build/get_specfile.sh')
-rwxr-xr-xredhat/build/get_specfile.sh30
1 files changed, 17 insertions, 13 deletions
diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh
index 70ff8d144..b7336ffcc 100755
--- a/redhat/build/get_specfile.sh
+++ b/redhat/build/get_specfile.sh
@@ -6,25 +6,29 @@ TDE_VERSION="${2:-14.0.0}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
[ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/tde-packaging
-[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${PACKAGING_DIR}/redhat
+[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat
# Special case for QT3
if [ "${PKGNAME}" = "qt3" ]; then
case "$(rpmdist.sh --dist)" in
- .oss*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/opensuse ;;
- .mga*|.mdk*|.pclos*) DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/mageia ;;
+ .oss*) DIST_PACKAGING_DIR="${TDE_PACKAGING_DIR}/opensuse" ;;
+ .mga*|.mdk*|.pclos*) DIST_PACKAGING_DIR="${TDE_PACKAGING_DIR}/mageia" ;;
esac
fi
-SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-${TDE_VERSION}.spec")
-if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}.spec")
- if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}.spec")
- if [ ! -r "${SPECFILE}" ]; then
- SPECFILE=$(find "${DIST_PACKAGING_DIR}" -name "trinity-${PKGNAME}.spec")
- fi
+for filename in \
+ "${PKGNAME}-${TDE_VERSION}.spec" \
+ "${PKGNAME}-14.0.0.spec" \
+ "${PKGNAME}.spec" \
+ "trinity-${PKGNAME}-${TDE_VERSION}.spec" \
+ "trinity-${PKGNAME}-14.0.0.spec" \
+ "trinity-${PKGNAME}.spec" \
+; do
+ SPECFILE="$(find "${DIST_PACKAGING_DIR}" -follow -name "${filename}")"
+ if [ -r "${SPECFILE}" ]; then
+ echo "${SPECFILE}"
+ exit 0
fi
-fi
+done
-echo ${SPECFILE}
+exit 1