summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_patchin.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-11-06 15:16:18 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-11-07 09:44:21 +0100
commit45d4484a426c58b1b4fb0c241c0a9474bc7c8c39 (patch)
treec3fc84ba783faac99b6a2cd9d53402b242cd1436 /scripts/lib/ptxd_make_world_patchin.sh
parent8124140087fadb52e87ab4e65f1cc7113292e39b (diff)
downloadptxdist-45d4484a426c58b1b4fb0c241c0a9474bc7c8c39.tar.gz
ptxdist-45d4484a426c58b1b4fb0c241c0a9474bc7c8c39.tar.xz
ptxd_make_world_patchin: don't complain about missing 'series' if there are no patches
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_patchin.sh')
-rw-r--r--scripts/lib/ptxd_make_world_patchin.sh37
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