Skip to content

Commit 79f9831

Browse files
committed
Add support for wildcard filespecs in katello-certs-gen-rpm
1 parent 44f5f2b commit 79f9831

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

katello-certs-gen-rpm

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -240,38 +240,27 @@ TARBALL=$NAME-$VERSION.tar.gz
240240
echo "Building $NAME-$VERSION-$RELEASE.$ARCH.rpm"
241241

242242
rm -rf $RPM_BUILD_DIR
243-
install --verbose -d $RPM_BUILD_DIR/$DIRNAME
243+
install --verbose -d $RPM_BUILD_DIR/$DIRNAME/root
244244

245245
# Prepare the tar file
246246
i=0
247247
while [ $i -lt ${#PARAMS[*]} ]; do
248248
echo ${PARAMS[$i]} | (
249249
IFS== read dstmod src
250250
echo ${dstmod} | (IFS=: read dst mod
251-
echo "${src} -> ${RPM_BUILD_DIR}/${DIRNAME}/${dst}"
251+
echo "${src} -> ${RPM_BUILD_DIR}/${DIRNAME}/root/${dst}"
252252
if [ -d "$src" ] ; then
253-
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/${dst}
253+
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/root/${dst}
254254
else
255-
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/`dirname "${dst}"`
256-
cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/${dst}
255+
dstdir=`dirname "${dst}"`
256+
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/root/${dstdir}
257+
cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/root/${dstdir}
257258
fi
258259
)
259260
)
260261
i=$[$i+1]
261262
done
262263

263-
# Build the install section
264-
installsect=`i=0
265-
while [ $i -lt ${#PARAMS[*]} ]; do
266-
echo ${PARAMS[$i]} | (
267-
IFS== read dstmod src
268-
echo ${dstmod} | (IFS=: read dst mod
269-
echo "install --verbose -d \\\$RPM_BUILD_ROOT\`dirname ${dst}\`"
270-
echo "install --verbose .${dst} \\\$RPM_BUILD_ROOT${dst}")
271-
)
272-
i=$[$i+1]
273-
done | sort | uniq | while read line; do echo -n "$line\n"; done`
274-
275264
# Build the files section
276265
filessect=`i=0
277266
while [ $i -lt ${#PARAMS[*]} ]; do
@@ -325,8 +314,8 @@ Vendor: $VENDOR
325314
326315
%install
327316
rm -rf \$RPM_BUILD_ROOT
328-
install -d \$RPM_BUILD_ROOT
329-
`echo -e $installsect`
317+
install -d \`dirname \$RPM_BUILD_ROOT\`
318+
cp --verbose -R root \$RPM_BUILD_ROOT
330319
331320
%clean
332321
rm -rf \$RPM_BUILD_ROOT

0 commit comments

Comments
 (0)