[wpkg-users] wpkg and unattended

Frank Lee rl201 at cam.ac.uk
Tue Nov 8 21:27:02 CET 2005


>> I use a database of packages, computers and licences - XML files are built 
>> up from a query or two which makes things a bit more manageable.
> could you tell your "secret" :) and describe us how you do it?

Certainly!

tbl_Software contains information about each bit of software I know how to 
install using WPKG. (And a few I don't, because I use this database to do 
a few different jobs.) Each entry contains at least the name of the 
software, the XML needed for packages.XML and the 'package-id' used to 
refer to the package.

tbl_Licences lets me set up a licence to use each bit of software. Perhaps 
it's a site licence, perhaps a licence for a single machine. Either way, 
a line in this table represents the licence to use the software.

Life gets a little complicated here in my real database but what I 
effectively then have is a table 'tbl_packages' which links a computer 
name to a Licence.

I then do something like this:

#Generate packages.xml

Remove old packages.xml

Foreach SoftwareItem in tbl_Software {
  print SoftwareItem.XML >>packages.xml
}

#Generate hosts.xml - we say each host has its own profile.

Remove old hosts.xml

Foreach Host in tbl_Computers {
  print <host name="Host.Name" profile-id="Host.Name" /> >>hosts.xml
}

#Generate profiles.xml

Remove old profiles.xml

Foreach Host in tbl_Computers {
  print <profile "id=Host.Name">
  Foreach SoftwareItem in (tbl_Licences INNER JOIN tbl_Software ON
                       tbl_Licences.SoftwareID=tbl_Software.SoftwareID
                       WHERE tbl_Licences.Host=Host) {
   print <package package-id="SoftwareItem.packageid" /> >>profiles.xml
  }
}

That's an outline - I'm happy to provide more details (scripts, MySQL 
table definitions, even my MS Access frontend if people would like such 
things).

Yours,

Frank




More information about the wpkg-users mailing list