Skip to contentSkip to conversation

qemu_iotests: Remove _readlink()

PATCH In review Kevin Wolf 4 participants 4 messages Apr 21, 2017 – Apr 22, 2017

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 qemu_iotests: Remove _readlink()

It is unused.

---
 tests/qemu-iotests/common.config | 18 ------------------
 1 file changed, 18 deletions(-)
tests/qemu-iotests/common.config +0 -18
index 1222e43..66f4e0b 100644
@@ -204,23 +204,5 @@ fi
 
 export SAMPLE_IMG_DIR
 
-_readlink()
-{
-    if [ $# -ne 1 ]; then
-        echo "Usage: _readlink filename" 1>&2
-        exit 1
-    fi
-
-    perl -e "\$in=\"$1\";" -e '
-    $lnk = readlink($in);
-    if ($lnk =~ m!^/.*!) {
-        print "$lnk\n";
-    }
-    else {
-        chomp($dir = `dirname $in`);
-        print "$dir/$lnk\n";
-    }'
-}
-
 # make sure this script returns success
 true
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 39 lines · Kevin Wolf

It is unused.

---
 tests/qemu-iotests/common.config | 18 ------------------
 1 file changed, 18 deletions(-)
tests/qemu-iotests/common.config +0 -18
index 1222e43..66f4e0b 100644
@@ -204,23 +204,5 @@ fi
 
 export SAMPLE_IMG_DIR
 
-_readlink()
-{
-    if [ $# -ne 1 ]; then
-        echo "Usage: _readlink filename" 1>&2
-        exit 1
-    fi
-
-    perl -e "\$in=\"$1\";" -e '
-    $lnk = readlink($in);
-    if ($lnk =~ m!^/.*!) {
-        print "$lnk\n";
-    }
-    else {
-        chomp($dir = `dirname $in`);
-        print "$dir/$lnk\n";
-    }'
-}
-
 # make sure this script returns success
 true
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kevin Wolf
Quoted 1 line · Kevin Wolf

It is unused.

Might be worth also mentioning that it was the file's only client of perl, so removing it also makes it easier to justify removing a check for $PERL.

Quoted 6 lines
---
 tests/qemu-iotests/common.config | 18 ------------------
 1 file changed, 18 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v1 1/1
#3 lore raw
In reply to Kevin Wolf
Quoted 3 lines · Kevin Wolf

It is unused.

*Suggested

And, since it now would be rude not to, with that fixed:

Quoted 34 lines
---
 tests/qemu-iotests/common.config | 18 ------------------
 1 file changed, 18 deletions(-)
tests/qemu-iotests/common.config +0 -18
index 1222e43..66f4e0b 100644
@@ -204,23 +204,5 @@ fi
 
 export SAMPLE_IMG_DIR
 
-_readlink()
-{
-    if [ $# -ne 1 ]; then
-        echo "Usage: _readlink filename" 1>&2
-        exit 1
-    fi
-
-    perl -e "\$in=\"$1\";" -e '
-    $lnk = readlink($in);
-    if ($lnk =~ m!^/.*!) {
-        print "$lnk\n";
-    }
-    else {
-        chomp($dir = `dirname $in`);
-        print "$dir/$lnk\n";
-    }'
-}
-
 # make sure this script returns success
 true