public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: scox@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Follow Unix ./executable convention.
Date: Fri, 02 May 2008 14:54:00 -0000	[thread overview]
Message-ID: <20080502145440.31639.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  bd4079f3265adffbd81e8fc1a8d2dd0314cd27b1 (commit)
      from  8d06b9bb3c74976b8913336c5392867f06846e9c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit bd4079f3265adffbd81e8fc1a8d2dd0314cd27b1
Author: Stan Cox <scox@redhat.com>
Date:   Fri May 2 10:52:16 2008 -0400

    Follow Unix ./executable convention.
    
    * SysRoot.java (findExe): Follow Unix ./executable convention.
    * TestSysRoot.java (testExePath): New

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/sysroot/ChangeLog        |    5 +++++
 frysk-core/frysk/sysroot/SysRoot.java     |   11 +++++++----
 frysk-core/frysk/sysroot/TestSysRoot.java |   24 ++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/sysroot/ChangeLog b/frysk-core/frysk/sysroot/ChangeLog
index 3309028..fa0a22b 100644
--- a/frysk-core/frysk/sysroot/ChangeLog
+++ b/frysk-core/frysk/sysroot/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-02  Stan Cox  <scox@redhat.com>
+
+	* SysRoot.java (findExe): Follow Unix ./executable convention.
+	* TestSysRoot.java (testExePath): New.
+
 2008-04-30  Stan Cox  <scox@redhat.com>
 
 	* SysRoot.java (findExe): Consider relative paths.
diff --git a/frysk-core/frysk/sysroot/SysRoot.java b/frysk-core/frysk/sysroot/SysRoot.java
index 7bbbdd3..38c355a 100644
--- a/frysk-core/frysk/sysroot/SysRoot.java
+++ b/frysk-core/frysk/sysroot/SysRoot.java
@@ -120,7 +120,7 @@ public class SysRoot {
             return exeFile;
         }
 
-        if (arg0.startsWith("/")) {
+        if (arg0.startsWith(File.separator)) {
             return exeFile;
         }
 
@@ -129,13 +129,16 @@ public class SysRoot {
             return exeFile;
         }
         
-        if (sysRoot.getPath().compareTo("/") == 0) { 
-            if (! exeFile.isAbsolute() && exeFile.exists()) {
-        	// given "./executable" with sysroot "/"
+	// Given "./executable" with sysroot "/"
+        if (sysRoot.getPath().compareTo(File.separator) == 0) { 
+            if (! exeFile.isAbsolute() 
+        	    && exeFile.getPath().indexOf(File.separator) != -1
+        	    && exeFile.exists()) {
         	return exeFile;
             }
         }
 
+        // Otherwise search in $PATH
         for (int i = 0; i < path.length; i++) {
             File file = new File(new File(sysRoot.getPath(), path[i]), arg0);
             if (file.exists()) {
diff --git a/frysk-core/frysk/sysroot/TestSysRoot.java b/frysk-core/frysk/sysroot/TestSysRoot.java
index a989aa0..208f4a9 100644
--- a/frysk-core/frysk/sysroot/TestSysRoot.java
+++ b/frysk-core/frysk/sysroot/TestSysRoot.java
@@ -42,6 +42,7 @@ package frysk.sysroot;
 import java.io.File;
 
 import frysk.config.Prefix;
+import frysk.testbed.TearDownExpect;
 import frysk.testbed.TestLib;
 
 public class TestSysRoot extends TestLib {
@@ -124,4 +125,27 @@ public class TestSysRoot extends TestLib {
 	assertEquals("getSourcePathViaSysRoot relative", 0, 
 		testPath.getSysRootedFile().compareTo(correctPath));
     }
+    
+    public void testExePath() {
+	String sysRootPath = Prefix.pkgLibFile(".").getParent()
+	+ "/test-sysroot/usr/bin";
+	
+        File fexe = Prefix.binFile("fexe");
+        TearDownExpect e = new TearDownExpect(new String[] {
+                "/bin/bash",
+                "-c",
+                "PATH=" + sysRootPath + " ; cd " + Prefix.pkgLibFile(".") + " ; "
+                + fexe.getAbsolutePath() + " ./funit-quicksort"
+            });
+        e.expect(Prefix.pkgLibFile(".").getParent() + "/funit-quicksort");
+
+        e = new TearDownExpect(new String[] {
+                "/bin/bash",
+                "-c",
+                "PATH=" + sysRootPath + " ; cd " + Prefix.pkgLibFile(".") + " ; "
+                + fexe.getAbsolutePath() + " funit-quicksort"
+            });
+        e.expect(sysRootPath + "/funit-quicksort");
+    }
+
 }


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-05-02 14:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080502145440.31639.qmail@sourceware.org \
    --to=scox@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).