help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [PATCH] Relocatable install, 2/3


From: Paolo Bonzini
Subject: [Help-smalltalk] [PATCH] Relocatable install, 2/3
Date: Mon, 17 Mar 2008 17:09:10 +0100
User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213)

This gives a meaning to FileSegments with a relative path. They are made relative to the kernel path.

The next patch will use this, so that when you relocate the package the paths from the image to the kernel directory still work. The idea is to make sure that all such paths are kept in relative form.

Paolo

2008-03-15  Paolo Bonzini  <address@hidden>

       * kernel/FileSegment.st: Add a warning that relative FileSegments
       are always interpreted from the kernel directory, and apply this
       rule in #fileName.

diff --git a/kernel/FileSegment.st b/kernel/FileSegment.st
index a767e8b..cd66729 100644
--- a/kernel/FileSegment.st
+++ b/kernel/FileSegment.st
@@ -57,7 +57,10 @@ Smalltalk-80 kernel; I am specific to the GNU Smalltalk implementation.'>

     FileSegment class >> on: aFile startingAt: startPos for: sizeInteger [
"Create a new FileSegment referring to the contents of the given file,
-        from the startPos-th byte and for sizeInteger bytes"
+        from the startPos-th byte and for sizeInteger bytes.  Note that
+        FileSegments should always be created with full paths because
+        relative paths are interpreted to be relative to the kernel
+        directory."

        <category: 'basic'>
        ^self new
@@ -126,7 +129,7 @@ Smalltalk-80 kernel; I am specific to the GNU Smalltalk implementation.'>
        "Answer the name of the file containing the segment"

        <category: 'basic'>
-       ^file
+       ^Directory append: file to: Directory kernel
     ]

     filePos [





reply via email to

[Prev in Thread] Current Thread [Next in Thread]