All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] fix unportability in gen_initramfs_list.sh
Date: Wed, 02 Apr 2008 14:50:05 +0200	[thread overview]
Message-ID: <47F380FD.6010605@openwrt.org> (raw)

On a Mac OS X machine the output of ls -l is different from a standard 
Linux machine. Use readlink instead of parsing a hardcoded field number 
from the ls output.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 684fb9c..5f3415f 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -135,7 +135,7 @@ parse() {
    			str="${ftype} ${name} ${str} ${dev} ${maj} ${min}"
    			;;
    		"slink")
-			local target=`field 11 $(LC_ALL=C ls -l "${location}")`
+			local target=`readlink "${location}"`
    			str="${ftype} ${name} ${target} ${str}"
    			;;
    		*)



                 reply	other threads:[~2008-04-02 13:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47F380FD.6010605@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.