[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/11] gnulib-tool: fall back into copy if symbolic link is n
From: |
KO Myung-Hun |
Subject: |
Re: [PATCH 11/11] gnulib-tool: fall back into copy if symbolic link is not supported |
Date: |
Sun, 08 Nov 2015 14:39:11 +0900 |
User-agent: |
Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.6esrpre) Gecko/20120715 Firefox/10.0.6esrpre SeaMonkey/2.7.2 |
Updated.
Process a relative path of SRC correctly.
KO Myung-Hun wrote:
> And warn about it only once.
>
> * gnulib-tool (first_fall_back_to_cp_warn): New. Indicator for only
> once warning about falling back to cp -p.
> (func_ln_s): New. Fall back into cp -p if ln -s fails. And warn about
> this only once.
> (func_ln): Replace ln -s with func_ln_s.
> ---
> ChangeLog | 11 +++++++++++
> gnulib-tool | 28 ++++++++++++++++++++++++----
> 2 files changed, 35 insertions(+), 4 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 157d50f..b2804bd 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,16 @@
> 2015-11-07 KO Myung-Hun <address@hidden>
>
> + gnulib-tool: fall back into copy if symbolic link is not supported
> + And warn about it only once.
> +
> + * gnulib-tool (first_fall_back_to_cp_warn): New. Indicator for only
> + once warning about falling back to cp -p.
> + (func_ln_s): New. Fall back into cp -p if ln -s fails. And warn about
> + this only once.
> + (func_ln): Replace ln -s with func_ln_s.
> +
> +2015-11-07 KO Myung-Hun <address@hidden>
> +
> utimes: detect utimes() correctly on OS/2 kLIBC
> utimes() of OS/2 kLIBC has some limitations.
>
> diff --git a/gnulib-tool b/gnulib-tool
> index 564f072..5a35ff3 100755
> --- a/gnulib-tool
> +++ b/gnulib-tool
> @@ -691,23 +691,43 @@ func_relconcat ()
> done
> }
>
> +first_fall_back_to_cp_warn=true
> +
> +# func_ln_s SRC DEST
> +# Like ln -s, except that cp -p is used if ln -s fails.
> +func_ln_s ()
> +{
> + if ln -s "$1" "$2" 2>/dev/null; then
> + :
> + else
> + if $first_fall_back_to_cp_warn; then
> + echo "gnulib-tool: symbolic link is not supported on this system." 1>&2
> + echo "Copy will be performed instead." 1>&2
> +
> + first_fall_back_to_cp_warn=false
> + fi
> +
> + cp -p "$1" "$2"
> + fi
> +}
> +
> # 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
> ;;
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
- [PATCH 02/11] binary-io: don't put fd in binary mode if it is a console on EMX, (continued)
- [PATCH 02/11] binary-io: don't put fd in binary mode if it is a console on EMX, KO Myung-Hun, 2015/11/06
- [PATCH 03/11] pipe-filter-aux: undefine HAVE_SELECT on KLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 04/11] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 05/11] wchar: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 07/11] dup, dup2, fcntl: support a directory fd on OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 06/11] pipe_filter_ii_execute: port to OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 08/11] openat_proc_name: port to OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 10/11] utimes: detect utimes() correctly on OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 09/11] opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC, KO Myung-Hun, 2015/11/06
- [PATCH 11/11] gnulib-tool: fall back into copy if symbolic link is not supported, KO Myung-Hun, 2015/11/06
- Re: [PATCH 11/11] gnulib-tool: fall back into copy if symbolic link is not supported,
KO Myung-Hun <=