PackageId.st
author Claus Gittinger <cg@exept.de>
Thu, 12 Oct 2006 21:33:18 +0200
changeset 10084 f6af35f81242
parent 10075 01633f527642
child 10190 806d4a4369d7
permissions -rw-r--r--
extension code refactored
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#PackageId
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'packageIdString'
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Support-Projects'
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!PackageId class methodsFor:'documentation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2006 by eXept Software AG
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    Represents packageID's.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    Knows the relationship between modules and directories in the package-organization.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!PackageId class methodsFor:'instance creation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
from: aStringOrSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    ^ self new packageIdString:aStringOrSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
9840
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    49
    "
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    50
     (self from:'stx:libbasic') module      
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    51
     (self from:'stx:libbasic') directory      
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    52
    "
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    53
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "Created: / 18-08-2006 / 12:11:58 / cg"
9840
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    55
    "Modified: / 12-09-2006 / 15:27:42 / cg"
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    56
!
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    57
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    58
module:moduleString directory:directoryString
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    59
    ^ self new module:moduleString directory:directoryString
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    60
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    61
    "
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    62
     (self module:'stx' directory:'libbasic') module      
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    63
     (self module:'stx' directory:'libbasic') directory      
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    64
    "
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    65
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    66
    "Created: / 12-09-2006 / 15:26:24 / cg"
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!PackageId methodsFor:'accessing'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
9840
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    71
module:moduleString directory:directoryString
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    72
    packageIdString := moduleString,':',directoryString.
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    73
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    74
    "Created: / 12-09-2006 / 15:26:48 / cg"
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    75
!
ed3d263c9109 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9668
diff changeset
    76
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
packageIdString:something
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    packageIdString := something.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    "Created: / 18-08-2006 / 12:14:45 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
string
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    ^ packageIdString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "Created: / 18-08-2006 / 12:20:54 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
!PackageId methodsFor:'comparing'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
= aPackageId
9841
29d622566819 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9840
diff changeset
    92
    "compares equal to a corresponding string"
29d622566819 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9840
diff changeset
    93
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    ^ packageIdString = aPackageId asPackageId string
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "
9841
29d622566819 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9840
diff changeset
    97
     'stx:libbasic' asPackageId = 'stx:libbasic' 
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
     'stx:libbasic' asPackageId = 'stx:libbasic' asSymbol asPackageId  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
     'stx:libbasic' asPackageId = 'stx:libbasic' asPackageId    
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
     'stx:libbasic2' asPackageId = 'stx:libbasic3' asPackageId  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "Created: / 18-08-2006 / 12:20:47 / cg"
9841
29d622566819 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9840
diff changeset
   104
    "Modified: / 12-09-2006 / 15:33:00 / cg"
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
hash
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    ^ packageIdString hash
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "Created: / 18-08-2006 / 12:21:19 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!PackageId methodsFor:'converting'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
asPackageId
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    ^ self
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    "Created: / 18-08-2006 / 12:22:10 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
asString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    ^ packageIdString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    "Created: / 18-08-2006 / 12:12:22 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
asSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    ^ packageIdString asSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    "Created: / 18-08-2006 / 12:12:29 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
10075
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   133
!PackageId methodsFor:'printing'!
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   134
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   135
printOn:aStream
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   136
    aStream 
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   137
        nextPutAll:'PackageId('; nextPutAll:packageIdString; nextPutAll:')'
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   138
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   139
    "Created: / 12-10-2006 / 10:30:10 / cg"
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   140
! !
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   141
9577
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   142
!PackageId methodsFor:'queries'!
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   143
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   144
directory
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   145
    "return the directory component. Thats the rest after the colon.
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   146
     The module is typically used to define the project-path or project-id within its
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   147
     sourcecode repository (which is selected via the module)."
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   148
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   149
    ^ packageIdString copyFrom:(packageIdString indexOf:$:)+1
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   150
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   151
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   152
     (PackageId from:'stx:libbasic') module  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   153
     (PackageId from:'stx:libbasic') directory  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   154
     (PackageId from:'stx:goodies/xml/stx') module  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   155
     (PackageId from:'stx:goodies/xml/stx') directory  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   156
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   157
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   158
    "Created: / 18-08-2006 / 12:15:33 / cg"
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   159
!
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   160
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   161
libraryName
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   162
    "return the name of the library, when compiled to a binary (i.e. dll/so).
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   163
     To avoid conflicts with the projectDefinition class 
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   164
     (which is named <module>_<directory_components>), we prefix the library name
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   165
     with 'lib'. This has the added advantage, that under unix, linking can be done with
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   166
     '-l'shortName."
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   167
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   168
    ^ 'lib' , (packageIdString copy asString replaceAny:':/' with:$_)
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   169
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   170
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   171
     (PackageId from:'stx:libbasic') libraryName        
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   172
     (PackageId from:'stx:goodies/xml/stx') libraryName   
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   173
     (PackageId from:'bosch:dapasx') libraryName  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   174
     (PackageId from:'exept:expecco') libraryName  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   175
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   176
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   177
    "Created: / 18-08-2006 / 12:35:04 / cg"
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   178
!
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   179
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   180
module
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   181
    "return the module component. Thats the first component up to the colon.
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   182
     The module is typically used to select a corresponding sourcecode repository."
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   183
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   184
    ^ packageIdString upTo:$:
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   185
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   186
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   187
     (PackageId from:'stx:libbasic') module  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   188
     (PackageId from:'stx:libbasic') directory  
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   189
    "
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   190
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   191
    "Created: / 18-08-2006 / 12:13:53 / cg"
9668
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   192
!
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   193
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   194
parentPackage
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   195
    |dir idx|
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   196
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   197
    dir := self directory.
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   198
    idx := dir lastIndexOf:$/.
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   199
    idx == 0 ifTrue:[
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   200
        ^ nil
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   201
    ].
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   202
    ^ self class from:(self module , ':' , (dir copyTo:idx-1))
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   203
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   204
    "
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   205
     (PackageId from:'stx:libbasic') parentPackage  
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   206
     (PackageId from:'stx:goodies/xml/stx') parentPackage  
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   207
     (PackageId from:'stx:goodies/xml/stx') parentPackage parentPackage  
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   208
    "
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   209
aa1d5186bd46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9577
diff changeset
   210
    "Created: / 23-08-2006 / 15:10:13 / cg"
9577
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   211
! !
03cce2fb9e0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9571
diff changeset
   212
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
!PackageId class methodsFor:'documentation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
version
10075
01633f527642 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9841
diff changeset
   216
    ^ '$Header: /cvs/stx/stx/libbasic/PackageId.st,v 1.6 2006-10-12 08:30:20 cg Exp $'
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
! !