question about SqueakMap and prerequisites

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Wed Apr 16 08:54:45 UTC 2003


Stephan B. Wessels <swessels at one.net> wrote:
> Is there a mechanism for Squeak Map where I can create a "package" that 
> identifies prerequisites of other packages on Squeak Map before they 
> can be installed?

Not yet. Well, Ned has made mechanisms in SAR to do some form of prereq
checking/loading but in the end I personally really think this is a
mechanism that should be *outside* of the packages.

And coming to that - dependencies are planned for SM1.2 - first we need
SM1.1 which will introduce the concept of "package releases" and a few
other needed base mechanisms, without that dependencies fall flat on the
face. Then I have a nice dependency scheme all lined up in my head and I
think it will be really nice.

So in short - nope, we don't have it yet (except for SAR tricks) but it
is coming. What we do have though are "load scripts" which may get you a
bit along the way, see below.

> For example, let's say I have package A and package B.  Package B 
> requires that package A be installed first for proper operation.  Is 
> there a way for package B to specify that package A is installed as a 
> prerequisite of installing B?

Well, you could package A and B separately and then make a third package
C which is just a load script that checks that A is installed and
installs it if not and then proceeds and installs B.

A trivial example follows (just store your load script as an .st file
and compress it into .st.gz and register it on SM). This particular
example makes sure Comanche and HttpView is installed before installing
SqueakMap Server.

----
| map comancheId httpViewId |
comancheId _ 'b308c414-1b4e-470f-90e3-e0d1d79c6981'.
httpViewId _ 'e0e7dee1-cc37-4d75-95df-5722ea6c629a'.
smServerId _ '3030ae71-3ebd-405f-be71-cf1ec1585edb'.
map _ SMSqueakMap default.
map loadUpdates. "Make sure it is fresh"

"Is SqueakMap Server already installed?"
(map cardWithId: smServerId) isInstalled
	ifTrue: [self inform: 'SqueakMap Server already installed']
	ifFalse: [

	"Make sure latest Comanche is installed"
	(map cardWithId: comancheId) isInstalled
		ifFalse: [map installPackageWithId: comancheId ].
	
	"Make sure latest HttpView is installed"
	(map cardWithId: httpViewId) isInstalled
		ifFalse: [map installPackageWithId: comancheId ].

	"Warn if Comanche is different from 5.1.1"
	v _ (map cardWithId: comancheId) installedVersion.
	((v = '5.1.1') or: [
		self confirm: 'Comanche' is version ', v, ' and HttpView has only been
tested with 5.1.1.
Proceed with install of SqueakMap Server anyway?'])
		ifTrue: [
			"Finally install SqueakMap Server"
			map installPackageWithId: comancheId]]
-----

As you all can see the need for package releases is really high. SM
today only knows about the latest and greatest version. Note: I haven't
really run the script above - it may contain bugs/typos.

regards, Göran



More information about the Squeak-dev mailing list