From 0931c2f3ae13d3da03f0b7b250940910dd98515d Mon Sep 17 00:00:00 2001 From: Paul Donohue Date: Wed, 13 Jun 2018 17:59:28 -0400 Subject: [PATCH] Add support for wildcard filespecs in katello-certs-gen-rpm --- katello-certs-gen-rpm | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/katello-certs-gen-rpm b/katello-certs-gen-rpm index 16f8621..56eecc1 100755 --- a/katello-certs-gen-rpm +++ b/katello-certs-gen-rpm @@ -240,7 +240,7 @@ TARBALL=$NAME-$VERSION.tar.gz echo "Building $NAME-$VERSION-$RELEASE.$ARCH.rpm" rm -rf $RPM_BUILD_DIR -install --verbose -d $RPM_BUILD_DIR/$DIRNAME +install --verbose -d $RPM_BUILD_DIR/$DIRNAME/root # Prepare the tar file i=0 @@ -248,30 +248,19 @@ while [ $i -lt ${#PARAMS[*]} ]; do echo ${PARAMS[$i]} | ( IFS== read dstmod src echo ${dstmod} | (IFS=: read dst mod - echo "${src} -> ${RPM_BUILD_DIR}/${DIRNAME}/${dst}" + echo "${src} -> ${RPM_BUILD_DIR}/${DIRNAME}/root/${dst}" if [ -d "$src" ] ; then - mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/${dst} + mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/root/${dst} else - mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/`dirname "${dst}"` - cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/${dst} + dstdir=`dirname "${dst}"` + mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/root/${dstdir} + cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/root/${dstdir} fi ) ) i=$[$i+1] done -# Build the install section -installsect=`i=0 -while [ $i -lt ${#PARAMS[*]} ]; do - echo ${PARAMS[$i]} | ( - IFS== read dstmod src - echo ${dstmod} | (IFS=: read dst mod - echo "install --verbose -d \\\$RPM_BUILD_ROOT\`dirname ${dst}\`" - echo "install --verbose .${dst} \\\$RPM_BUILD_ROOT${dst}") - ) - i=$[$i+1] -done | sort | uniq | while read line; do echo -n "$line\n"; done` - # Build the files section filessect=`i=0 while [ $i -lt ${#PARAMS[*]} ]; do @@ -325,8 +314,8 @@ Vendor: $VENDOR %install rm -rf \$RPM_BUILD_ROOT -install -d \$RPM_BUILD_ROOT -`echo -e $installsect` +install -d \`dirname \$RPM_BUILD_ROOT\` +cp --verbose -R root \$RPM_BUILD_ROOT %clean rm -rf \$RPM_BUILD_ROOT