3780 |
3780 |
3781 defaultPackagePath |
3781 defaultPackagePath |
3782 "return a default packagePath - thats a collection of |
3782 "return a default packagePath - thats a collection of |
3783 dirnames, where ST/X searches for its package subdirs. |
3783 dirnames, where ST/X searches for its package subdirs. |
3784 This method might be redefined in concrete OS's to add |
3784 This method might be redefined in concrete OS's to add |
3785 OS-specific directory names." |
3785 OS-specific directory names. |
|
3786 If you set the STX_PACKAGEPATH shell variable, ensure that some of its component |
|
3787 points to the directory which *contains* the stx/libbasic directory." |
3786 |
3788 |
3787 |pPath p homePath priv userPrivateSTXDir| |
3789 |pPath p homePath priv userPrivateSTXDir| |
3788 |
3790 |
3789 " |
3791 " |
3790 the path is set to search files first locally |
3792 the path is set to search files first locally |
3800 "/ |
3802 "/ |
3801 "/ the users home (login) directory |
3803 "/ the users home (login) directory |
3802 "/ |
3804 "/ |
3803 homePath := OperatingSystem getHomeDirectory. |
3805 homePath := OperatingSystem getHomeDirectory. |
3804 homePath notNil ifTrue:[ |
3806 homePath notNil ifTrue:[ |
3805 (pPath includes:homePath) ifFalse:[ |
3807 (pPath includes:homePath) ifFalse:[ |
3806 pPath add:homePath. |
3808 pPath add:homePath. |
3807 ]. |
3809 ]. |
3808 |
3810 |
3809 "/ |
3811 "/ |
3810 "/ a users private smalltalk directory in its home (login) directory |
3812 "/ a users private smalltalk directory in its home (login) directory |
3811 "/ |
3813 "/ |
3812 OperatingSystem isUNIXlike ifTrue:[ |
3814 OperatingSystem isUNIXlike ifTrue:[ |
3813 priv := '.smalltalk'. |
3815 priv := '.smalltalk'. |
3814 ] ifFalse:[ |
3816 ] ifFalse:[ |
3815 priv := 'smalltalk'. |
3817 priv := 'smalltalk'. |
3816 ]. |
3818 ]. |
3817 userPrivateSTXDir := homePath asFilename constructString:priv. |
3819 userPrivateSTXDir := homePath asFilename constructString:priv. |
3818 (userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
3820 (userPrivateSTXDir asFilename isDirectory) ifTrue:[ |
3819 (pPath includes:userPrivateSTXDir) ifFalse:[ |
3821 (pPath includes:userPrivateSTXDir) ifFalse:[ |
3820 pPath add:userPrivateSTXDir |
3822 pPath add:userPrivateSTXDir |
3821 ] |
3823 ] |
3822 ]. |
3824 ]. |
3823 ]. |
3825 ]. |
3824 |
3826 |
3825 "/ |
3827 "/ |
3826 "/ STX_TOPDIR from the environment |
3828 "/ STX_TOPDIR from the environment |
3827 "/ |
3829 "/ |
3828 p := OperatingSystem getEnvironment:'STX_TOPDIR'. |
3830 p := OperatingSystem getEnvironment:'STX_TOPDIR'. |
3829 p notNil ifTrue:[ |
3831 p notNil ifTrue:[ |
3830 (pPath includes:p) ifFalse:[ |
3832 (pPath includes:p) ifFalse:[ |
3831 pPath add:p |
3833 pPath add:p |
3832 ]. |
3834 ]. |
3833 ]. |
3835 ]. |
3834 pPath add:'/opt/smalltalk'. |
3836 pPath add:'/opt/smalltalk'. |
3835 pPath := pPath select:[:p | (p asFilename construct:'packages') exists]. |
3837 pPath := pPath select:[:p | (p asFilename construct:'packages') exists]. |
3836 pPath := pPath collect:[:p | (p asFilename constructString:'packages')]. |
3838 pPath := pPath collect:[:p | (p asFilename constructString:'packages')]. |
3837 |
3839 |
3838 (p := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ |
3840 (p := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[ |
3839 p := p asCollectionOfSubstringsSeparatedBy:$:. |
3841 p := p asCollectionOfSubstringsSeparatedBy:$:. |
3840 p reverseDo:[:dir| |
3842 p reverseDo:[:dir| |
3841 (pPath includes:dir) ifFalse:[ |
3843 (pPath includes:dir) ifFalse:[ |
3842 pPath addFirst:dir. |
3844 pPath addFirst:dir. |
3843 ]. |
3845 ]. |
3844 ]. |
3846 ]. |
3845 ]. |
3847 ]. |
3846 |
3848 |
3847 ^ pPath |
3849 ^ pPath |
3848 |
3850 |
3849 " |
3851 " |