Automatic dependency retrieval

Autopackage is capable of downloading packages from the network in order to satisfy dependencies. This functionality is provided by luau, and for it to work correctly a few pieces of information are required:

The URL is stored in the Repository key of the skeleton file. This isn't the only way register a repository for a particular package - the registerRepository function is available as well. The XML file pointed to by the URL should be on an HTTP or FTP server.

A sample repository XML file from the autopackage.org's GTK+ Front End is below:

                
<?xml version="1.0" ?>
<!DOCTYPE luau-repository SYSTEM
        "http://luau.sourceforge.net/luau-repository-1.1.dtd">

<luau-repository interface="1.1">

        <program-info id="@autopackage.org/autopackage-gtk"> 

                <shortname>autopackage-gtk</shortname>
                <fullname>Autopackage GTK+ Graphical User Interface</fullname>
                <desc>A graphical (GTK+) frontend for installing Autopackage packages.</desc> 

        </program-info>

        <software version="0.6">
                <date>2004-07-14</date>
                <interface version="0.0" />
                <keyword>UNSTABLE</keyword> 

                <short>Short declarative statement(s) about release for language en.</short>
                <long>
                        Paragraphs describing the release for language en.
                </long> 

                <package type="autopackage"
                         size="8746"
                         md5="e5ece8caf2b00d37d30cab0def847dd6">
                        http://autopackage.org/downloads/0.6/autopackage-gtk-0.6.package
                </package>
        </software>

</luau-repository>

Most of the information in the repository XML file should match the package .apspec file, but particular details of this release need to be added to the software section.

Adding parameters b and x to makeinstaller when the package is generated will automatically create a new repository XML file for the package. makeinstaller will generate a single full package and two split packages into a meta package and a software payload package. In the above instance, the automatically created repository XML file would be named autopackage-gtk.xml or autopackage-gtk.xml.new to not overwrite a previous repository XML file.

                
gtkfe]$ makeinstaller -bx default

generates files:
    autopackage-gtk-0.6.package
    autopackage-gtk-0.6.package.meta
    autopackage-gtk-0.6.package.payload
    autopackage-gtk.xml or autopackage-gtk.xml.new [if .xml file already exists]

The table shows how the .apspec file relates to the repository XML file with some comments.

Table 6.4. Data Definitions between Package Repository File and .apspec File

XML Tag/Argument .apspec Meta Key Comments REQ?
program-info id Unversioned RootName Yes
shortname ShortName Yes
fullname DisplayName Yes
desc Summary No
url Matches Repository key in .apspec specfile No
date Matches the build date from the package environment file. No
short Short declarative statements about this release. No
long Paragraphs to describe this release. No
type Use 'autopackage' to describe package as an autopackage. Yes
size File size in bytes of the meta package. No
md5 md5 of the meta package. No
software version SoftwareVersion Yes
interface version InterfaceVersion Yes
version PackageVersion No
weight Proportional amount of time that the following mirror uri should be used. No
mirror Uri to be used to retrieve the package. http, https or ftp are available through curl. Yes

Note

The md5 and size are of the meta package. autopackage initially downloads the meta package to determine dependencies. The luau downloader uses the md5 to validate what to download and size gives some additional status information to the user.

All of the package files should all be in the same directory so that autopackage can find what it needs. If a user wants to start installing this package, the user would download and execute the full package ( .package ) . If another package has a dependency for this package, then autopackage would download the package repository XML file (.skeleton key) to determine where to find the packages. autopackage proceeds to download the meta package ( .package.meta ) to validate the package and determine what dependencies exist. This process is repeated until all the dependencies are fulfilled.