diff options
-rw-r--r-- | patches/uClibc/0.9.33.2/300-fix-darwin-build.patch | 12 | ||||
-rwxr-xr-x | scripts/patch-rework.sh | 14 |
2 files changed, 20 insertions, 6 deletions
diff --git a/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch new file mode 100644 index 0000000..884307d --- /dev/null +++ b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch @@ -0,0 +1,12 @@ +diff -Nrupa uClibc-0.9.33.2.orig/extra/scripts/unifdef.c uClibc-0.9.33.2/extra/scripts/unifdef.c +--- uClibc-0.9.33.2.orig/extra/scripts/unifdef.c 2012-05-15 09:20:09.000000000 +0200 ++++ uClibc-0.9.33.2/extra/scripts/unifdef.c 2014-10-25 17:07:33.000000000 +0200 +@@ -78,8 +78,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/ + #define errx(exit_code, fmt, args...) ({ warnx(fmt, ## args); exit(exit_code); }) + #define err(exit_code, fmt, args...) errx(exit_code, fmt ": %s", ## args, strerror(errno)) + +-size_t strlcpy(char *dst, const char *src, size_t siz); +- + /* types of input lines: */ + typedef enum { + LT_TRUEI, /* a true #if with ignore flag */ diff --git a/scripts/patch-rework.sh b/scripts/patch-rework.sh index 3d97795..2809348 100755 --- a/scripts/patch-rework.sh +++ b/scripts/patch-rework.sh @@ -67,10 +67,10 @@ do_check_files_at_depth() { exec 6<&0 exec 7<"${flist}" - while read -u7 f; do + while read f; do f="$( echo "${f}" |sed -r -e "s:^([^/]+/){${depth}}::;" )" [ -f "${f}" ] || ret=1 - done + done </dev/fd/7 exec 7<&- exec <&6 @@ -106,16 +106,18 @@ $1=="+++" && mark==1 { nextfile; } >"diffstat.orig" printf " done\n" - pushd "${base}" >/dev/null 2>&1 + cd "${base}" # Check all files exist, up to depth 3 printf " checking depth:" - for((d=0;d<4;d++)); do + d=0 + while [ $d -lt 4 ]; do printf " ${d}" if do_check_files_at_depth "../diffstat.orig" ${d}; then printf " ok, using depth '${d}'\n" break fi + d=$((d + 1)) done if [ ${d} -ge 4 ]; then printf "\n" @@ -133,7 +135,7 @@ $1=="+++" && mark==1 { nextfile; } printf " applying patch..." if ! patch -g0 -F1 -f -p${d} <"${p}" >"../patch.out" 2>&1; then printf " ERROR\n\n" - popd >/dev/null 2>&1 + cd - >/dev/null printf "There was an error while applying:\n --> ${p} <--\n" printf "'${base}' was restored to the state it was prior to applying this faulty patch.\n" printf "Here's the 'patch' command, and its output:\n" @@ -149,7 +151,7 @@ $1=="+++" && mark==1 { nextfile; } find . -type f -name '*.orig' -exec rm -f {} + printf " done\n" - popd >/dev/null 2>&1 + cd - >/dev/null printf " re-diffing the patch..." printf "%s\n\n" "${comment}" >"${dst}/${pname}" |