aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Denia <naoir@gmx.net>2015-08-24 16:27:22 +0200
committerMarcel Denia <naoir@gmx.net>2015-09-01 09:23:24 +0200
commit7d38a15bc4f853046edc840d50fe346e89e0b21d (patch)
tree03aa01e2d08183245e1dbfefdabc149682bb2a39
parent948a4cc165d3c8eacadbdc5e5ebcf52e86d5301e (diff)
perl: Skip $0 test on busybox in dist/threads/t/join.t
This test requires a ps which provides the -f option, as well as suitable output. We can't provide either with busybox. Just skip it for now. Signed-off-by: Marcel Denia <naoir@gmx.net>
-rw-r--r--lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch b/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch
new file mode 100644
index 000000000..27ee75749
--- /dev/null
+++ b/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch
@@ -0,0 +1,83 @@
+perl: Skip $0 test on busybox
+
+This test requires a ps which provides the -f option, as well as suitable output.
+We can't provide either with busybox. Just skip it for now.
+
+Signed-off-by: Marcel Denia <naoir@gmx.net>
+
+Index: perl-5.22.0/dist/threads/t/join.t
+===================================================================
+--- perl-5.22.0.orig/dist/threads/t/join.t
++++ perl-5.22.0/dist/threads/t/join.t
+@@ -110,36 +110,41 @@ sub skip {
+
+ # We parse ps output so this is OS-dependent.
+ if ($^O eq 'linux') {
+- # First modify $0 in a subthread.
+- #print "# mainthread: \$0 = $0\n";
+- threads->create(sub{ #print "# subthread: \$0 = $0\n";
+- $0 = "foobar";
+- #print "# subthread: \$0 = $0\n"
+- })->join;
+- #print "# mainthread: \$0 = $0\n";
+- #print "# pid = $$\n";
+- if (open PS, "ps -f |") { # Note: must work in (all) systems.
+- my ($sawpid, $sawexe);
+- while (<PS>) {
+- chomp;
+- #print "# [$_]\n";
+- if (/^\s*\S+\s+$$\s/) {
+- $sawpid++;
+- if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
+- $sawexe++;
+- }
+- last;
+- }
+- }
+- close PS or die;
+- if ($sawpid) {
+- ok($sawpid && $sawexe, 'altering $0 is effective');
+- } else {
+- skip("\$0 check: did not see pid $$ in 'ps -f |'");
+- }
+- } else {
+- skip("\$0 check: opening 'ps -f |' failed: $!");
+- }
++ if (readlink('/bin/ps') ne 'busybox') {
++ # First modify $0 in a subthread.
++ #print "# mainthread: \$0 = $0\n";
++ threads->create(sub{ #print "# subthread: \$0 = $0\n";
++ $0 = "foobar";
++ #print "# subthread: \$0 = $0\n"
++ })->join;
++ #print "# mainthread: \$0 = $0\n";
++ #print "# pid = $$\n";
++ if (open PS, "ps -f |") { # Note: must work in (all) systems.
++ my ($sawpid, $sawexe);
++ while (<PS>) {
++ chomp;
++ #print "# [$_]\n";
++ if (/^\s*\S+\s+$$\s/) {
++ $sawpid++;
++ if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
++ $sawexe++;
++ }
++ last;
++ }
++ }
++ close PS or die;
++ if ($sawpid) {
++ ok($sawpid && $sawexe, 'altering $0 is effective');
++ } else {
++ skip("\$0 check: did not see pid $$ in 'ps -f |'");
++ }
++ } else {
++ skip("\$0 check: opening 'ps -f |' failed: $!");
++ }
++ }
++ else {
++ skip("\$0 check: incompatible with busybox");
++ }
+ } else {
+ skip("\$0 check: only on Linux");
+ }