lkml.org 
[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix unportability in gen_initramfs_list.sh
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}"
;;
*)



\
 
 \ /
  Last update: 2008-04-02 15:31    [W:0.060 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site