summaryrefslogtreecommitdiffstats
path: root/redhat/build
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2018-12-02 11:45:46 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2018-12-02 21:48:19 +0100
commitc39ca964b3288690923cdb4e63275aebd334e4e2 (patch)
tree32ce3b08f70ef3c731f4bf9d46f7de8152163f4e /redhat/build
parent513bfad2d12c9454d8c232ed4a18929924f9c6f6 (diff)
downloadtde-packaging-c39ca964b3288690923cdb4e63275aebd334e4e2.tar.gz
tde-packaging-c39ca964b3288690923cdb4e63275aebd334e4e2.zip
RPM: update build scripts
Diffstat (limited to 'redhat/build')
-rwxr-xr-xredhat/build/gather_rpm_sources.sh4
-rwxr-xr-xredhat/build/get_latest_tarball_filename.sh16
-rwxr-xr-xredhat/build/get_specfile.sh12
3 files changed, 17 insertions, 15 deletions
diff --git a/redhat/build/gather_rpm_sources.sh b/redhat/build/gather_rpm_sources.sh
index f6b7253dc..244b140c5 100755
--- a/redhat/build/gather_rpm_sources.sh
+++ b/redhat/build/gather_rpm_sources.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
# Usage: gather_rpm_sources.sh <TDE_PACKAGE> <TDE_VERSION> <DESTINATION>
# Example: gather_rpm_sources.sh tdebase 14.0.0 /tmp/tdebase
@@ -30,7 +30,7 @@ cp -f ${SPECFILE} ${SOURCES} ${TARBALL} "${TARGETDIR}"
### Check for patches
-PATCHDIR="${HOME}/tde/tde-patches/${TDE_VERSION}/$1"
+PATCHDIR="${HOME}/tde/patches/${TDE_VERSION}/$1"
if [ -d "${PATCHDIR}" ]; then
cat "${PATCHDIR}/"*".patch" >>"${TARGETDIR}/one.patch"
sed -i "${TARGETDIR}/"*".spec" \
diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh
index 7901d0915..7e8059b3b 100755
--- a/redhat/build/get_latest_tarball_filename.sh
+++ b/redhat/build/get_latest_tarball_filename.sh
@@ -10,32 +10,32 @@ TDE_VERSION="${2:-14.0.0}"
EXTRA_DIR="$(cd ${TARBALLS_DIR}/../extras/; pwd)"
-RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1)
+RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
-RET=$(find "${TARBALLS_DIR}" "${EXTRA_DIR}" -follow -name "${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1)
+RET=$(find "${TARBALLS_DIR}" "${EXTRA_DIR}" -follow -name "${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
-RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-[0-9]*.tar.gz" | sort -n | tail -n 1)
+RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-[0-9]*.tar.gz" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
-RET=$(find "${EXTRA_DIR}" -follow -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -n | tail -n 1)
+RET=$(find "${EXTRA_DIR}" -follow -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
# Now look in the 'tde-packaging' directory
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1)
+RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
# Retry without 'trinity-*', and allow any TAR extension.
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1)
+RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
# Retry without 'trinity-*', and allow any TAR extension.
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1)
+RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
# Retry by removing numbers in package name, e.g "imlib1" => "imlib"
-RET=$(find "${DIST_PACKAGING_DIR}" -name "$(tr -d "[0-9]" <<< ${PKGNAME})-[0-9]*.tar*" | sort -n | tail -n 1)
+RET=$(find "${DIST_PACKAGING_DIR}" -name "$(tr -d "[0-9]" <<< ${PKGNAME})-[0-9]*.tar*" | sort -V | tail -n 1)
[ -r "${RET}" ] && echo "${RET}" && exit 0
diff --git a/redhat/build/get_specfile.sh b/redhat/build/get_specfile.sh
index b7336ffcc..92fbd7ddb 100755
--- a/redhat/build/get_specfile.sh
+++ b/redhat/build/get_specfile.sh
@@ -25,10 +25,12 @@ for filename in \
"trinity-${PKGNAME}.spec" \
; do
SPECFILE="$(find "${DIST_PACKAGING_DIR}" -follow -name "${filename}")"
- if [ -r "${SPECFILE}" ]; then
- echo "${SPECFILE}"
- exit 0
- fi
+ [ -r "${SPECFILE}" ] && break || continue
done
-exit 1
+if [ -r "${SPECFILE}" ]; then
+ echo "${SPECFILE}"
+ exit 0
+else
+ exit 1
+fi