306 ! |
306 ! |
307 |
307 |
308 msdosPathToPackage:toPackageID from:fromPackageID |
308 msdosPathToPackage:toPackageID from:fromPackageID |
309 "Returns the path to the package defined by aPackageID relative to my path" |
309 "Returns the path to the package defined by aPackageID relative to my path" |
310 |
310 |
311 |parts1 parts2 common up down rel| |
311 |parts1 parts2 common up down| |
312 |
312 |
313 parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
313 parts1 := fromPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
314 parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
314 parts2 := toPackageID asCollectionOfSubstringsSeparatedByAny:':/'. |
315 common := parts1 commonPrefixWith:parts2. |
315 common := parts1 commonPrefixWith:parts2. |
316 common notEmpty ifTrue:[ |
316 up := ((1 to:parts1 size - common size) collect:[:p | '..']) asStringWith:'\'. |
317 up := ((1 to:parts1 size - common size) collect:[:p | '..\']) asStringWith:''. |
317 down := (parts2 copyFrom:common size+1) asStringWith:'\'. |
318 down := (parts2 copyFrom:common size+1) asStringWith:'\'. |
318 up isEmpty ifTrue:[ |
319 (up isEmpty and:[down isEmpty]) ifTrue:[^ '.']. |
319 down isEmpty ifTrue:[^ '.']. |
320 ^ up,down |
320 ^ down. |
321 ]. |
321 ]. |
322 |
322 down isEmpty ifTrue:[ |
323 rel := (self topRelativePathToPackage_win32:toPackageID). |
323 ^ up. |
324 (rel startsWith:'stx\') ifTrue:[ |
324 ]. |
325 ^ '$(TOP)',(rel copyFrom:'stx\' size) |
325 ^ up, '\', down |
326 ]. |
|
327 |
|
328 ^ '$(TOP)\..\',rel. |
|
329 |
|
330 "/ pTop := self msdosPathToTopFor:fromPackageID. |
|
331 "/ (pTop endsWith:'\stx') ifTrue:[ |
|
332 "/ ^ (pTop copyButLast:'stx' size),(self topRelativePathToPackage_win32:toPackageID) |
|
333 "/ ] ifFalse:[ |
|
334 "/ ^ pTop,'\..\',(self topRelativePathToPackage_win32:toPackageID) |
|
335 "/ ]. |
|
336 |
326 |
337 " |
327 " |
338 self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
328 self msdosPathToPackage:'bosch:dapasx/kernel' from:'bosch:dapasx/application' |
339 self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
329 self msdosPathToPackage:'stx:libbasic' from:'bosch:dapasx/application' |
340 self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
330 self msdosPathToPackage:'bosch:dapasx/application' from:'stx:libbasic' |
|
331 self msdosPathToPackage:'exept:expecco' from:'exept:expecco/application' |
|
332 self msdosPathToPackage:'exept:expecco/application' from:'exept:expecco' |
341 " |
333 " |
342 |
334 |
343 "Created: / 17-08-2006 / 14:26:39 / cg" |
335 "Created: / 17-08-2006 / 14:26:39 / cg" |
344 "Modified: / 14-09-2006 / 22:04:56 / cg" |
336 "Modified: / 14-09-2006 / 22:04:56 / cg" |
345 ! |
337 ! |