[node-patches] Change in ovirt-node[master]: dracut: Add basename() fallback

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Jan 9 10:13:18 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: dracut: Add basename() fallback
......................................................................

dracut: Add basename() fallback

basename got removed during the F18 dev cycle, this patch intrdocues a
fallback.
An optimized dirname fallback is also added.

Change-Id: I385a0feafbf5e4c279e4467acd10b8155df440cc
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M dracut/ovirt-boot-functions
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/00/10800/1

diff --git a/dracut/ovirt-boot-functions b/dracut/ovirt-boot-functions
index d59133b..d6c2dfd 100644
--- a/dracut/ovirt-boot-functions
+++ b/dracut/ovirt-boot-functions
@@ -4,13 +4,8 @@
 SEP=','
 TAB=$'\t'
 
-dirname() {
-    if [ -e /usr/bin/dirname ]; then
-        /usr/bin/dirname $@
-    else
-        echo $1 | sed 's/\/'$(basename $1)'$//'
-    fi
-}
+basename() { echo ${1##*/}; }
+dirname() { echo ${1%/*}; }
 
 # compat function to handle different udev versions
 udev_info() {


--
To view, visit http://gerrit.ovirt.org/10800
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I385a0feafbf5e4c279e4467acd10b8155df440cc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list