diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_world_patchin.sh | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh index 9e406d8ad..d021d6043 100644 --- a/scripts/lib/ptxd_make_world_patchin.sh +++ b/scripts/lib/ptxd_make_world_patchin.sh @@ -31,9 +31,6 @@ ptxd_make_world_patchin_apply_init() else # is there a "series" file pkg_patch_series="${pkg_patch_dir}/series" - if [ \! -e "${pkg_patch_series}" ]; then - unset pkg_patch_series - fi fi # decide which tool to use @@ -219,6 +216,7 @@ export -f ptxd_make_world_patchin_apply_patch ptxd_make_world_patchin_apply() { local \ + tmp_patch_series \ pkg_patch_series \ pkg_patch_tool @@ -252,19 +250,10 @@ ptxd_make_world_patchin_apply() # ln -s "${pkg_patch_dir}" "${pkg_patchin_dir}/.ptxdist/patches" && - # link series file - if not available create it - if [ -z "${pkg_patch_series}" ]; then - - ptxd_pedantic "series file for '$(ptxd_print_path "${pkg_patch_dir}")' is missing" - - # if writable, create series file next to the patches - if [ -w "${pkg_patch_dir}/" ]; then - pkg_patch_series="${pkg_patch_dir}/series" && - ln -s "${pkg_patch_series}" "${pkg_patchin_dir}/.ptxdist/series" - else - pkg_patch_series="${pkg_patchin_dir}/.ptxdist/series" - fi && + tmp_patch_series="${pkg_patchin_dir}/.ptxdist/series" && + # link series file - if not available create it + if [ ! -e "${pkg_patch_series}" ]; then # # look for patches (and archives) and put into series file # (the "sed" removes "./" from find's output) @@ -277,18 +266,24 @@ ptxd_make_world_patchin_apply() -name "*.bz2" -o \ -name "*.gz" | \ sed -e "s:^[.]/::" | sort > \ - "${pkg_patch_series}" && + "${tmp_patch_series}" && popd > /dev/null # no patches found - if [ \! -s "${pkg_patch_series}" ]; then - rm -f \ - "${pkg_patchin_dir}/.ptxdist/series" \ - "${pkg_patch_series}" && + if [ \! -s "${tmp_patch_series}" ]; then + rm -f "${tmp_patch_series}" && unset pkg_patch_series + else + ptxd_pedantic "series file for '$(ptxd_print_path "${pkg_patch_dir}")' is missing" && + + # if writable, create series file next to the patches + if [ -w "${pkg_patch_dir}/" ]; then + mv "${tmp_patch_series}" "${pkg_patch_series}" && + ln -s "${pkg_patch_series}" "${tmp_patch_series}" + fi fi else - ln -s "${pkg_patch_series}" "${pkg_patchin_dir}/.ptxdist/series" + ln -s "${pkg_patch_series}" "${tmp_patch_series}" # # check for non existing patches |