From 758f72fdff548e9eee8bdba2d084e83eb39cb43f Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Wed, 13 Apr 2016 09:21:14 -0700 Subject: [PATCH] Make rpm push handle SRPMs * Fix the rpm push to search out and push SRPMs * Fix the rpm push to actually push a file as it was referencing a bad variable * Fix up some minor linting issues Change-Id: I4d2e66ad52e593b71b969ab1b5faad254cc35e2d Signed-off-by: Andrew Grimberg --- jjb/vpp/include-raw-vpp-maven-push.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/jjb/vpp/include-raw-vpp-maven-push.sh b/jjb/vpp/include-raw-vpp-maven-push.sh index 924d335af..dc75e907b 100644 --- a/jjb/vpp/include-raw-vpp-maven-push.sh +++ b/jjb/vpp/include-raw-vpp-maven-push.sh @@ -72,13 +72,21 @@ function push_rpm () rpmfile=$1 repoId="${BASEREPOID}yum" url="${BASEURL}yum" - basefile=$(basename -s .rpm "$rpmfile") + + if grep -q srpm <<<"$rpmfile" + then + rpmtype=srpm + basefile=$(basename -s .srpm "$rpmfile") + else + rpmtype=rpm + basefile=$(basename -s .rpm "$rpmfile") + fi artifactId=$(echo "$basefile" | cut -f 1 -d '_') version=$(echo "$basefile" | cut -f 2- -d '_') - push_file "$debfile" "$repoId" "$url" "$version" "$artifactId" rpm + push_file "$rpmfile" "$repoId" "$url" "$version" "$artifactId" "$rpmtype" } -if [ ${OS} == "ubuntu1404" ]; then +if [ "${OS}" == "ubuntu1404" ]; then # Find the files JARS=$(find . -type f -iname '*.jar') DEBS=$(find . -type f -iname '*.deb') @@ -91,10 +99,11 @@ if [ ${OS} == "ubuntu1404" ]; then do push_deb "$i" done -elif [ ${OS} == "centos7" ]; then +elif [ "${OS}" == "centos7" ]; then # Find the files RPMS=$(find . -type f -iname '*.rpm') - for i in $RPMS + SRPMS=$(find . -type f -iname '*.srpm') + for i in $RPMS $SRPMS do push_rpm "$i" done -- 2.16.6