Blob Blame History Raw
From f17c272d769a43490eec780424f5971f87acdc06 Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@bitwagon.com>
Date: Thu, 31 Jan 2013 23:58:53 +0330
Subject: [PATCH 06/18] Use shell processing instead of basename (#875356)

Systems with many partitions bog down os-prober. Remove the call to
basename and use shell substitution instead.

Resolves: rhbz#875356
---
 common.sh                                  | 2 +-
 linux-boot-probes/mounted/powerpc/40yaboot | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common.sh b/common.sh
index f83eb0d..b9b3951 100644
--- a/common.sh
+++ b/common.sh
@@ -57,7 +57,7 @@ progname=
 cache_progname() {
   case $progname in
     '')
-      progname="$(basename "$0")"
+      progname="${0##*/}"
       ;;
   esac
 }
diff --git a/linux-boot-probes/mounted/powerpc/40yaboot b/linux-boot-probes/mounted/powerpc/40yaboot
index cbb87da..b060b18 100755
--- a/linux-boot-probes/mounted/powerpc/40yaboot
+++ b/linux-boot-probes/mounted/powerpc/40yaboot
@@ -27,7 +27,7 @@ recordstanza () {
 		fi
 
 		if [ -z "$title" ]; then
-			title="$(basename "$kernel")"
+			title="${kernel##*/}"
 		fi
 		if [ "$read_only" ]; then
 			parameters="ro $parameters"
-- 
2.5.5