root/main/tags/r1-2-5/DESIGN

Revision 732, 6.9 kB (checked in by mike, 5 years ago)

Initial revision

  • Property svn:keywords set to Author Date Id Revision
Line 
1 ( THIS IS REALLY REALLY OUT OF DATE, AND SHOULD BE DELETED )
2
3
4 Notes on newnew design
5
6 Root names never ever represent an actual release, only an
7 interface. If your package depends on a particular release that didn't
8 change the interface, tough, you'll have to do it manually.
9
10 Let's take libpng as an example:
11
12 0) run makeinstaller
13
14 1) require @libpng.org/libpng/3
15
16 2) Check local database, what skeleton version does
17 @libpng.org/libpng/3 need? It's not in the local database. Go resolve
18 it from the network.
19
20 3) Network says you need @libpng.org/libpng/skeleton.1
21
22 4) Do we have this file? Yes, we do, so bundle that into the .package
23 and continue
24
25 5) User runs package
26
27 6) skeleton.1 retrives the interface number from the argument to
28 require, and then scans for the libpng.so.$IV file, where IV is the
29 variable containing the interface version, in this case 3 (that's an
30 internal skeleton implementation detail).
31
32 7) The check fails, we only have v2 installed. Resolve
33 @libpng.org/libpng/3
34
35 8) The network resolves this to
36 http://libpng.org/packages/libpng3.package
37
38 9) Download and install........
39
40
41 Now let's try with GTK:
42
43 1) makeinstaller
44
45 2) require @gtk.org/gtk#2.2
46
47 3) OK. What skeleton does this require? @gtk.org/gtk/skeleton.2 - we
48 already have it locally in /var/packages/@gtk.org/gtk/skeleton.2
49
50 4) Bundle the skeleton into the .package
51
52 5) user installs package
53
54 6) The skeleton is called to check if gtk2.2 is present (extracted
55 from the root name) It's not, so we need to upgrade the system (let's
56 pretend gtk2.0 is present, installed via the distros packaging
57 system).
58
59 7) Resolve @gtk.org/gtk#2.2
60
61 8) In the meantime, 2.4 has come out. GTK2.4 also implements the 2.2
62 ABI, so in fact it resolves to say
63 http://gtk.org/packages/gtk-x11-2.4.package: the fact that we're not
64 downloading 2.2 is irrelevant.
65
66 9) WAIT! We don't necessarily want to use autopackage to upgrade gtk,
67 there may be a distro provided update for it too. If the network comes
68 back with an apt repository that provides it, we can use that to
69 upgrade it.
70
71
72 How is the network mirrored locally? We need to know this for now,
73 because we have no network!
74
75 /var/packages/@gnome.org/libxml/2.0
76 /var/packages/@gnome.org/libxml/2.0.1
77 /var/packages/@gnome.org/libxml/2.0.2
78 /var/packages/@gnome.org/libxml/2.1.0
79
80 noooooooooo! too many directories! They'd all contain the same file,
81 with the same contents! Better:
82
83 /var/packages/@gnome.org/libxml/2.x
84
85
86 New versioning design
87 ---------------------
88
89 Skeletons represent a package as a whole. It doesn't matter how many
90 times that package has broken interface/ABI compatability, it has one
91 skeleton. Skeletons actually represent *interfaces*, not packages
92 themselves. That's a very important distinction. When you depend upon
93 another piece of software, there is an implicit contract between your
94 package and the other package. They presumably interact in some way,
95 otherwise you wouldn't depend on them.
96
97 The concept of IC, or interface compatability is an important one. A
98 package may keep the same interface for ever, or it may break it in
99 unpredictable ways. Other packages have uniform version numbering
100 systems that allow you to tell if you will be compatable with it by
101 examining the number.
102
103 There are two ways to identify when an interface changes. The first is
104 the version number of the underlying package. Some programs/libraries
105 use GTK/libtool versioning, whereby the major version number indicates
106 the interface version. The 1.x series has one set of interfaces, 2.x
107 has another and so on.
108
109 However, that doesn't work for all things. Sometimes, packages don't
110 use libtool versioning, or the interface is basically stable and won't
111 ever change. For instance Nautilus scripts have a very simple
112 interface that will probably remain constant for as long as the
113 feature exists and Netscape plugins have kept the same interface across
114 multiple major versions.
115
116 So, to deal with cases like these, we have interface serial
117 numbers. For packages where you can't determine the interface from
118 examining the version number, you can pass the skeleton an interface
119 number, and the skeleton will map version numbers to interface
120 numbers.
121
122 New function call:
123
124 require --matches 2.x @gtk.org/gtk       : this specifies that any version of GTK in the 2.x series will work, ie it was linked with gtk2.0
125 require --between 2.2 3.0 @gtk.org/gtk   : any version between 2.2 and 3.0 will work (but not including 3.0).
126                                            This means it depends on a feature of 2.2
127 require --interface 1 @gnome.org/scripts : Only interface serial number 1 will work. If later on an extended interface is added (2), then
128                                            the package supports both 1 and 2, but you can only ever depend upon a specific number, not a range
129
130 These have shortened forms:
131
132 require -m 2.x @gtk.org/gtk
133 require -b 2.2 3.0 @gtk.org/gtk
134 require -i 1 @gnome.org/scripts
135
136
137 New dependancy design
138 ---------------------
139
140 Autopackage comes with a library of package skeletons. These are sets of tests associated
141 with a root name, that are triggered by the require function in the install script. For
142 instance, @gnome.org/libxml/2.0 is the rootname for libxml version 2. As part of
143 autopackage, a module is provided that can test for the presence of this package by
144 probing for its actual component parts, as opposed to querying for its presence in a
145 database. When makeinstaller creates the .package file, the scripts are scanned for the
146 require function and the necessary tests are automatically included. The require command
147 therefore does the following things:
148
149 - Flags a package skeleton to be included in the .package file,
150   so it can later be used when the install scripts are run to check
151   for the presence of the required "package", which can be a
152   library/file/set of files/correct output of xxx-info
153   program/whatever and then finally be used to verify the package if
154   something goes blooey with it.
155
156 - When the script is run, it uses the package skeleton to test for the
157   package presence, and to auto-download the package if it's not
158   there.
159
160 - It adds a dependancy to the required package. This takes the form of
161   dual symlinks between the two package-info directories. Integration
162   with RPM/DPKG??? not sure if it will always be possible. These
163   dependancy symlinks can later be used to verify and repair the
164   package.
165
166 So if I have package "genst.package" which requires libxml and dialog
167 0.9, the genst.package will include 2 package skeletons: for
168 @gnome.org/libxml/2.0 and @advancedresearch.org/dialog/0.9
169
170 The package skeleton is a file that includes a test for it's
171 presence, and instructions for how to retrieve or upgrade it if
172 necessary. A big part of the success of autopackage will depend on the
173 quality and abundance of the package skeletons. They will probably be
174 included in a directory that can be automatically updated by CVS from
175 the main autopackage servers. The package skeleton can also contain a
176 description of what the package is, so the user can see what they are
177 downloading, and perhaps other metadata.
Note: See TracBrowser for help on using the browser.