qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 03/19] scripts/clean-includes: Skip symbolic links


From: Warner Losh
Subject: Re: [PATCH v4 03/19] scripts/clean-includes: Skip symbolic links
Date: Fri, 27 Jan 2023 16:08:12 -0700



On Fri, Jan 27, 2023 at 3:47 PM Eric Blake <eblake@redhat.com> wrote:
On Thu, Jan 19, 2023 at 07:59:43AM +0100, Markus Armbruster wrote:
> When a symbolic link points to a file that needs cleaning, the script
> replaces the link with a cleaned regular file.  Not wanted; skip them.
>
> We have a few symbolic links under subprojects/libvduse/ and
> subprojects/libvhost-user/.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/clean-includes | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/scripts/clean-includes b/scripts/clean-includes
> index 8e8420d785..f0466a6262 100755
> --- a/scripts/clean-includes
> +++ b/scripts/clean-includes
> @@ -113,6 +113,10 @@ EOT

>  files=
>  for f in "$@"; do
> +  if [ -L "$f" ]; then

I don't see -L used with test very often, but POSIX requires it, so it
is safe for our choice of /bin/sh.

FYI: -L is in FreeBSD, NetBSD, OpenBSD, etc. It's been in all these trees since the mid 90s. It wasn't in 4.4BSD, but all these projects have imported the code from pdksh's test.

So in addition to POSIX, it's been widely implemented, at least in the BSD world, for over 20 years.

Warner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]