Skip to content

Commit

Permalink
Add support for directory filespecs in katello-certs-gen-rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSD committed Jun 13, 2018
1 parent 10fdc54 commit 38c2e0e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions katello-certs-gen-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ while [ $i -lt ${#PARAMS[*]} ]; do
IFS== read dstmod src
echo ${dstmod} | (IFS=: read dst mod
echo "${src} -> ${RPM_BUILD_DIR}/${DIRNAME}/${dst}"
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/`dirname "${dst}"`; cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/${dst}
if [ -d "$src" ] ; then
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/${dst}
else
mkdir --parents --verbose ${RPM_BUILD_DIR}/${DIRNAME}/`dirname "${dst}"`
cp ${src} ${RPM_BUILD_DIR}/${DIRNAME}/${dst}
fi
)
)
i=$[$i+1]
Expand Down Expand Up @@ -278,7 +283,11 @@ while [ $i -lt ${#PARAMS[*]} ]; do
# NOTE there's already a %defattr(-,root,root), so if there's no u
# or g defined, set it to '-' by default
echo $mod | (IFS=, read m u g
echo "%attr(${m:-0644},${u:--},${g:--}) ${dst}"
if [ -d "$src" ] ; then
echo "%dir %attr(${m:-0755},${u:--},${g:--}) ${dst}"
else
echo "%attr(${m:-0644},${u:--},${g:--}) ${dst}"
fi
)
)
)
Expand Down

0 comments on commit 38c2e0e

Please sign in to comment.