diff --git a/ChangeLog b/ChangeLog index 5bedafa..80d496e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-01-15 Paul Eggert <eggert@cs.ucla.edu> + KO Myung-Hun <komh@chollian.net> + + gnulib-tool: don't assume ln -s works + * gnulib-tool (func_ln_s): New function. + (func_ln): Use it. + 2016-01-15 KO Myung-Hun <komh@chollian.net> utimes: detect utimes() correctly on OS/2 kLIBC diff --git a/gnulib-tool b/gnulib-tool index 34676f9..dc4eb87 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -767,23 +767,44 @@ func_relconcat () done } +# func_ln_s SRC DEST +# Like ln -s, except use cp -p if ln -s fails. +func_ln_s () +{ + ln -s "$1" "$2" || { + echo "$progname: ln -s failed; falling back on cp -p" >&2 + symbolic= + lsymbolic= + do_copyrights=true + + case "$1" in + /* | ?:*) # SRC is absolute. + cp_src=$1 ;; + *) # SRC is relative to the directory of DEST. + cp_src=${2%/*}/$1 ;; + esac + + cp -p "$cp_src" "$2" + } +} + # func_ln SRC DEST -# Like ln -s, except that SRC is given relative to the current directory (or +# Like func_ln_s, except that SRC is given relative to the current directory (or # absolute), not given relative to the directory of DEST. func_ln () { case "$1" in /* | ?:*) - ln -s "$1" "$2" ;; + func_ln_s "$1" "$2" ;; *) # SRC is relative. case "$2" in /* | ?:*) - ln -s "`pwd`/$1" "$2" ;; + func_ln_s "`pwd`/$1" "$2" ;; *) # DEST is relative too. ln_destdir=`echo "$2" | sed -e 's,[^/]*$,,'` test -n "$ln_destdir" || ln_destdir="." func_relativize "$ln_destdir" "$1" - ln -s "$reldir" "$2" + func_ln_s "$reldir" "$2" ;; esac ;;
Thanks, I installed the attached somewhat-different patch instead.
Please give it a try. Also, I installed the other two gnulib patches
pretty much as-is.
- [PATCH v7 06/11] pipe_filter_ii_execute: port to OS/2 kLIBC KO Myung-Hun
- [PATCH v7 07/11] dup, dup2, fcntl: support a directory fd on ... KO Myung-Hun
- [PATCH v7 02/11] binary-io: don't put fd in binary mode if it... KO Myung-Hun
- [PATCH v7 05/11] wchar: fix 'conflicting types' error for `__... KO Myung-Hun
- [PATCH v7 10/11] utimes: detect utimes() correctly on OS/2 kL... KO Myung-Hun
- [PATCH v7 11/11] gnulib-tool: fall back into copy if symbolic... KO Myung-Hun
- Re: [PATCH v7 11/11] gnulib-tool: fall back into copy if... Paul Eggert
- Re: [PATCH v7 11/11] gnulib-tool: fall back into cop... KO Myung-Hun
- Re: [PATCH v7 11/11] gnulib-tool: fall back into... Paul Eggert
- Re: [PATCH v7 11/11] gnulib-tool: fall back ... KO Myung-Hun
- Re: [PATCH v7 11/11] gnulib-tool: fall ... Paul Eggert
- Re: [PATCH v7 11/11] gnulib-tool: f... KO Myung-Hun
- Re: [PATCH v7 11/11] gnulib-tool: f... Paul Eggert
- Re: [PATCH v7 11/11] gnulib-tool: f... KO Myung-Hun
- Re: [PATCH v7 11/11] gnulib-tool: fall back ... Bruno Haible
- Re: [PATCH v7 11/11] gnulib-tool: fall ... Myung-Hun KO
- [PATCH v7 08/11] openat_proc_name: port to OS/2 kLIBC KO Myung-Hun