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

Bug#694668: A patch improve the performance of os-prober for systems with many partitions



Yes, you are right specially since the patch does many things at once. I am going to break up the patch to smaller ones so that I can maintain them personally. I thought that you might also prefer this. Therefore, I'll post the smaller patches. But if you think that is not needed, let me know.
Anyway, attached you'll find a small patch which just replaces usage of 'basename' with shell string processing (already used in some parts of the code, so should be supported in the target shell(s)).


Cyril Brulebois <kibi@debian.org> wrote on Tue, 25 Dec 2012 19:33:56 +0100:
Hi,

Hedayat Vatankhah <hedayatv@gmail.com> (29/11/2012):
This bug is reported by one of our users, and also the patch is
provided by him. And this is his comments on the provided patch:
[…]
thanks for forwarding. Unfortunately it's too late in the release
cycle to consider this kind of large changes, so it's probably only
going to be considered during the 'jessie' release cycle.

Mraw,
KiBi.

diff -up os-prober-1.57/common.sh.remove-basename os-prober-1.57/common.sh
--- os-prober-1.57/common.sh.remove-basename	2013-01-23 01:06:50.023992389 +0330
+++ os-prober-1.57/common.sh	2013-01-23 02:01:09.435244141 +0330
@@ -57,7 +57,7 @@ progname=
 cache_progname() {
   case $progname in
     '')
-      progname="$(basename "$0")"
+      progname="${0##*/}"
       ;;
   esac
 }
diff -up os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot
--- os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot.remove-basename	2013-01-23 02:04:03.855063593 +0330
+++ os-prober-1.57/linux-boot-probes/mounted/powerpc/40yaboot	2013-01-23 02:02:34.876175982 +0330
@@ -27,7 +27,7 @@ recordstanza () {
 		fi
 
 		if [ -z "$title" ]; then
-			title="$(basename "$kernel")"
+			title="${kernel##*/}"
 		fi
 		if [ "$read_only" ]; then
 			parameters="ro $parameters"

Reply to: