Put ${PATCH_WRSKRC} within quotes so that expanding it works properly when it contains spaces.
Details
Details
- Reviewers
marino mat - Group Reviewers
portmgr - Commits
- rP406842: smart_makepatch: Quote PATCH_WRKSRC when regenerating patches.
make makepatch in audio/quimup.
Before:
% make -dl makepatch /usr/bin/env WRKDIR=/usr/local/poudriere/ports/default/audio/quimup/work PATCHDIR=/usr/local/poudriere/ports/default/audio/quimup/files PATCH_WRKSRC=/usr/local/poudriere/ports/default/audio/quimup/work/quimup\ 1.4.0 STRIP_COMPONENTS=" 0" /bin/sh /home/rakuco/ports/Mk/Scripts/smart_makepatch.sh cd: too many arguments cd: too many arguments
With this change everything works as expected and I don't end up with an empty files/ directory.
Diff Detail
Diff Detail
- Repository
- rP FreeBSD ports repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
John asked to me move my own patch over here. :-(
Committed version was incomplete, quoting only two cd arguments out of five. This is inconsistent and confusing to the reader, not to mention that ${PATCHDIR} might contain spaces as well.
Index: /usr/ports/Mk/Scripts/smart_makepatch.sh =================================================================== --- /usr/ports/Mk/Scripts/smart_makepatch.sh (revision 407796) +++ /usr/ports/Mk/Scripts/smart_makepatch.sh (working copy) @@ -67,7 +67,7 @@ patchdir_files_list() { if [ -d "${PATCHDIR}" ]; then - (cd ${PATCHDIR} && \ + (cd "${PATCHDIR}" && \ find * -type f -name "patch-*" -maxdepth 0 \ 2>/dev/null | sed -e '/\.orig$/d' ) @@ -100,7 +100,7 @@ local P local t for P in ${old_patch_list}; do - target=$(cd ${PATCHDIR} && \ + target=$(cd "${PATCHDIR}" && \ grep "^+++ " ${P} | awk '{print $2}' ) # For single patches, we honor previous separators, but use @@ -215,7 +215,7 @@ local P local name local patch_list - patch_list=$(cd ${REGENNED} && find * -name "patch-*" 2>/dev/null) + patch_list=$(cd "${REGENNED}" && find * -name "patch-*" 2>/dev/null) for P in ${patch_list}; do name=$(get_patch_name ${P}) [ -e ${COMMENTS}/${P} ] && cat ${COMMENTS}/${P} \
Comment Actions
I also approve this change (revision is already approved so I can only say this is comments)
Comment Actions
Do by "Land your update" you mean "commit it"? I can do it any time, I was just thinking that perhaps a nod from portmgr@ is in order (no matter how stupid it might look in this particular case).