Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 689263 Details for
Bug 875356
OS prober is slow
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
0002-Avoid-cat-.-Shorten-filenames-after-cd.patch
0002-Avoid-cat-.-Shorten-filenames-after-cd.patch (text/plain), 7.75 KB, created by
John Reiser
on 2013-01-28 19:25:41 UTC
(
hide
)
Description:
0002-Avoid-cat-.-Shorten-filenames-after-cd.patch
Filename:
MIME Type:
Creator:
John Reiser
Created:
2013-01-28 19:25:41 UTC
Size:
7.75 KB
patch
obsolete
>From 5b5272f57ef89cfe6973ede306ed99eb2eb5ae95 Mon Sep 17 00:00:00 2001 >From: John Reiser <jreiser@BitWagon.com> >Date: Sat, 22 Dec 2012 10:26:28 -0800 >Subject: [PATCH 2/4] Avoid 'cat'. Shorten filenames after 'cd'. > >--- > os-probes/mounted/common/90linux-distro | 152 ++++++++++---------------------- > 1 file changed, 46 insertions(+), 106 deletions(-) > >diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro >index cbcff3c..80c6df2 100755 >--- a/os-probes/mounted/common/90linux-distro >+++ b/os-probes/mounted/common/90linux-distro >@@ -3,7 +3,6 @@ > set -e > > # . $execpfx/common.sh >-path_lookup cat; export cat # search once only > > origdir=$PWD > >@@ -39,129 +38,70 @@ function filter() { > # The syntax with braces avoids using a subprocess. > # All that saves 0.02 seconds over using the exit code of /bin/ls. > # It matters when you have several dozen partitions to check. >+# Even after that, expanding '*' in filenames is expensive in wait time. >+# It would save 0.06 seconds per iteration (2 seconds for 32 partitions) >+# to short-circuit from here to the end of the enclosing 'while' loop. > if { set -- "$dir"/lib*/ld*.so*; [ -r "$1" ]; } \ > || { set -- "$dir"/usr/libexec*/ld*.so*; [ -r "$1" ]; } ; then > cd "$dir"/etc 2>/dev/null || { fail; continue; } > short="" >- set -- *[_-]version >+ set -- *[_-]version # 'for' iterates over the result > > for file do case "$file" in >- debian_version) >- short="Debian" >- long="$(printf "Debian GNU/Linux (%s)\n" "$($cat "$dir/etc/debian_version")")" ;; >- kanotix-version) >- short="Kanotix" >- long="$($cat "$dir/etc/kanotix-version")" ;; >- slackware-version) >- short="Slackware" >- long="$(printf "Slackware Linux (%s)\n" "$($cat "$dir/etc/slackware-version")")" ;; >+ debian_version) short="Debian"; read long <"$file" >+ long="Debian GNU/Linux ($long)" ;; >+ kanotix-version) short="Kanotix"; read long <"$file" ;; >+ slackware-version)short="Slackware"; read long <"$file" >+ long="Slackware Linux ($long)" ;; > esac; done > if [ -n "$short" ]; then succeed; continue; fi > > # RPM derived distributions may also have a redhat-release or > # mandrake-release. Set base first, then override using derived. >- set -- *-release >+ set -- *-release # 'for' iterates over the result > > for file do case "$file" in # base distro >- redhat-release) >- short="RedHat" >- long="$($cat "$dir/etc/redhat-release")" ;; >+ redhat-release) short="RedHat"; read long <"$file" ;; > esac; done > >- for file do case "$file" in # possible intermediate distro >- fedora-release) >- short="Fedora" >- long="$($cat "$dir/etc/fedora-release")" ;; >+ for file do case "$file" in # intermediate distro >+ fedora-release) short="Fedora"; read long <"$file" ;; > esac; done > >- for file do case "$file" in # possible intermediate distro >- mandrake-release) >- short="Mandrake" >- long="$($cat "$dir/etc/mandrake-release")" ;; >+ for file do case "$file" in # intermediate distro >+ mandrake-release) short="Mandrake"; read long <"$file" ;; > esac; done > >- for file do case "$file" in # possible derived distro >- SuSE-release) >- short="SuSE" >- long="$(head -n 1 "$dir/etc/SuSE-release")" ;; >- altlinux-release) >- short="ALTLinux" >- long="$($cat "$dir/etc/altlinux-release")" ;; >- magic-release) >- short="Magic" >- long="$($cat "$dir/etc/magic-release")" ;; >- blackPanther-release) >- short="blackPanther" >- long="$($cat "$dir/etc/blackPanther-release")" ;; >- ark-release) >- short="Ark" >- long="$($cat "$dir/etc/ark-release")" ;; >- arch-release) >- short="Arch" >- long="$($cat "$dir/etc/arch-release")" ;; >- asplinux-release) >- short="ASPLinux" >- long="$($cat "$dir/etc/asplinux-release")" ;; >- lvr-release) >- short="LvR" >- long="$($cat "$dir/etc/lvr-release")" ;; >- caos-release) >- short="cAos" >- long="$($cat "$dir/etc/caos-release")" ;; >- aurox-release) >- short="Aurox" >- long="$($cat "$dir/etc/aurox-release")" ;; >- engarde-release) >- short="EnGarde" >- long="$($cat "$dir/etc/engarde-release")" ;; >- vine-release) >- short="Vine" >- long="$($cat "$dir/etc/vine-release")" ;; >- whitebox-release) >- short="WhiteBox" >- long="$($cat "$dir/etc/whitebox-release")" ;; >- pld-release) >- short="PLD" >- long="$($cat "$dir/etc/pld-release")" ;; >- startcom-release) >- short="StartCom" >- long="$($cat "$dir/etc/startcom-release")" ;; >- trustix-release) >- short="Trustix" >- long="$($cat "$dir/etc/trustix-release")" ;; >- openna-release) >- short="OpenNA" >- long="$($cat "$dir/etc/openna-release")" ;; >- conectiva-release) >- short="Conectiva" >- long="$($cat "$dir/etc/conectiva-release")" ;; >- gentoo-release) >- short="Gentoo" >- long="$($cat "$dir/etc/gentoo-release")" ;; >- cobalt-release) >- short="Cobalt" >- long="$($cat "$dir/etc/cobalt-release")" ;; >- yellowdog-release) >- short="YellowDog" >- long="$($cat "$dir/etc/yellowdog-release")" ;; >- turbolinux-release) >- short="Turbolinux" >- long="$($cat "$dir/etc/turbolinux-release")" ;; >- pardus-release) >- short="Pardus" >- long="$($cat "$dir/etc/pardus-release")" ;; >- frugalware-release) >- short="Frugalware Linux" >- long="$($cat "$dir/etc/frugalware-release")" ;; >- kdemar-release) >- short="K-DEMar" >- long="$(printf "K-DEMar GNU/Linux (%s)\n" "$($cat "$dir/etc/kdemar-release")")" ;; >- lfs-release) >- short="LFS" >- long="$(printf "Linux From Scratch (%s)\n" "$($cat "$dir/etc/lfs-release")")" ;; >- meego-release) >- short="MeeGo" >- long="$(head -1 "$dir/etc/meego-release")" ;; >+ for file do case "$file" in # derived distro >+ SuSE-release) short="SuSE"; read long <"$file" ;; >+ altlinux-release) short="ALTLinux"; read long <"$file" ;; >+ magic-release) short="Magic"; read long <"$file" ;; >+ blackPanther-release) short="blackPanther"; read long <"$file" ;; >+ ark-release) short="Ark"; read long <"$file" ;; >+ arch-release) short="Arch"; read long <"$file" ;; >+ asplinux-release) short="ASPLinux"; read long <"$file" ;; >+ lvr-release) short="LvR"; read long <"$file" ;; >+ caos-release) short="cAos"; read long <"$file" ;; >+ aurox-release) short="Aurox"; read long <"$file" ;; >+ engarde-release) short="EnGarde"; read long <"$file" ;; >+ vine-release) short="Vine"; read long <"$file" ;; >+ whitebox-release) short="WhiteBox"; read long <"$file" ;; >+ pld-release) short="PLD"; read long <"$file" ;; >+ startcom-release) short="StartCom"; read long <"$file" ;; >+ trustix-release) short="Trustix"; read long <"$file" ;; >+ openna-release) short="OpenNA"; read long <"$file" ;; >+ conectiva-release) short="Conectiva"; read long <"$file" ;; >+ gentoo-release) short="Gentoo"; read long <"$file" ;; >+ cobalt-release) short="Cobalt"; read long <"$file" ;; >+ yellowdog-release) short="YellowDog"; read long <"$file" ;; >+ turbolinux-release) short="Turbolinux"; read long <"$file" ;; >+ pardus-release) short="Pardus"; read long <"$file" ;; >+ frugalware-release) short="Frugalware Linux"; read long <"$file" ;; >+ meego-release) short="MeeGo"; read long <"$file" ;; >+ kdemar-release) short="K-DEMar"; read long <"$file" >+ long="K-DEMar GNU/Linux ($long)" ;; >+ lfs-release) short="LFS"; read long <"$file" >+ long="Linux From Scratch ($long)" ;; > esac; done > if [ -n "$short" ]; then succeed; continue; fi > >@@ -169,7 +109,7 @@ function filter() { > if [ -e "$dir/sbin/pkgtool" ]; then > short="Slackware" > long="Slackware Linux" >- elif grep -qs OpenLinux "$dir/etc/issue"; then >+ elif grep -qs OpenLinux issue; then > short="Caldera" > long="Caldera OpenLinux" > else >-- >1.8.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 875356
:
652201
|
688069
|
689262
| 689263 |
689264
|
689265
|
692170
|
692171
|
692172