File: Class_Hierarchy

package info (click to toggle)
pkg-order 1.02
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 484 kB
  • ctags: 172
  • sloc: perl: 4,094; makefile: 81
file content (252 lines) | stat: -rw-r--r-- 11,331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252

Class Hierarchy:
------ ---------

*)Debian::Package::Virtual

 This class handles the list of legal virtual packages, initialized
 from a space separated list of virtual package names, or by a static
 built in list valid at the time of writing.
 
 Data Structures:
 	Associative array keyed on virtual package name (associative
 	array was chosen for ease of determining membership)
 methods:
        new: Initializer
	print: Prints the list of virtual Packages
	is_member: Checks if argument is a member of the list.
        add:       Adds a package name to the list
        test:           Tests the package.

*)Debian::Package::List

 This class handles lists of packages. It creates an associative array
 of Debian::Package:Package objects, keyed on package name. The most
 common entry point takes in Packages files. It also records packages
 which are provided; provided packages do not figure in package
 ordering, 
 
 Data Structures:
 	Associative array 	
	   Separate Runs: List of types which, if they appear as targets,
                  force installation to break at that point into a
                  separate run 
 methods:
        new: Initializer  This takes a named parameter, filename,
             which should be the path of a Packages file to use as the
             data for the list. If an empty string, create an empty
             list.
	check : virtual functions to be instantiated in the
	extra : derived classes.  
	print: loops through the packages in the list, calling the
	       print function of each package object. 
	print_name: Like print, but just prints package names.
        add:       Adds a package to the list
        delete:    Removes a package from the list
        init_depends: A per package routine meant to be called from
                      extra to add Dependency_List objects to the
                      package. Typically called from the New packages
                      list, but can be called from any package list.
	check_relations: Performs the dependency checks for all the
                         packages in the list for a given field
	order: Gathers ordering infrmation for all packages in the
	       list based on a give  field (usually depends or
	       pre-depends) 
        order_string: When all ordering informaton has been gathered
                      by the previous routine, this returns it all in
                      one big string, ready to be printed out.
	grt_ordering: Run tsort on the ordering data in the list, and
	              return output
        set_fatal_failure_on_types: For all packages, records which
                                    fields should be considered
                                    critical when determining critical
                                    errors.
        print_result: for a field (type) and category (failed, found,
                      conflict, etc) for all packages in the list.
        result_as_string: same as above, except return the result as a
                          string.
        check_result: count for a field (type) and category (failed, found,
                      conflict, etc) for all packages in the list.
        reset_result: recalculates the results field for all the
                      packages in the list.
        test:           Tests the package.
	set_break_on_types: Sets installation  types which, if they
	                    appear as targets, force installation to
	                    break at that point into a separate run.
	insert_breaks: takes a ordered list of package names, and
	               inserts breaks into the list for the types
	               specified above.
	mark: mark a given package with a mark
	unmark: remove a mark from a given package
	test_mark: test if a package has been marked with a given mark
	show_mark: show all marks on a given package

*@)Debian::Package::Installed

 This is a sub class derived from Debian::Package:List, it imports
 /var/lib/dpkg/status by default unless given Packages files of
 installed  packages. Handles Status fields.
 methods:
	new: Initializer  defaults Packages file to
             /var/lib/dpkg/status. If a filename is given as an
             argument, use that, if an empty string is given, create
             an empty installed list.
	check: Reject packages with a status field that is not 
               OK installed OK.
        test:           Tests the package.

*@)Debian::Package::New

 This is a sub class derived from Debian::Package:List, all dependency
 and ordering runs are started on the list of new packages.
 methods:
	extra: As an extra processing of every package, creates a
	       dependency list object for various fields. 
	tsort:       Run tsort on the given file. (How hard is it to
                     write a topological sort in Perl?)
        test:           Tests the package.

***)Debian::Package::List::Targets

 This is a class contained in the class Debian::Package::List, and is
 used internally to hold reverse information about dependency (or
 conflict) hits. 
 Data: 
   Separate Runs: List of types which, if they appear as targets,
                  force installation to break at that point into a
                  separate run 
   Package List   Pointer to the containing package list
   
 methods:
	new: constructor. 
	add: adds to the current set of dependency targets
	remove: deletes a target from the current set of dependency
	        targets for this package list. 
	is_target: Returns the packages dependent on this target, if
	           any. 
	print_target: prints out the current set of dependency targets
	              for this package list.
	set_break_on_types: Sets installation  types which, if they
	                    appear as targets, force installation to
	                    break at that point into a separate run.
	insert_breaks: takes a ordered list of package names, and
	               inserts breaks into the list for the types
	               specified above.

**)Debian::Package::Package:

 This class handles information about a Debian Package. It initializes
 the package details with a snippet of a Packages file, and also
 creates and manipulates internal fields by creating fields names
 starting with a blank and underscore ' _'.  Additional Fields
 correspond to dependency list object for the fields Depends,
 Pre-Depends, Recommends, Suggests, Conflicts, and Replaces.
 Also, the ordering information for a package is kept in '
 _Order'. and the status (Success and Failure information) is also
 maintained here.

 Data Structures:
 	Associative array keyed on Field name. The values of internal
 	fields need not be simple strings.
 methods:
        new: Initializer  It takes an required argument, which is a
             snippet from the Packages file.
        init_depends: Creates a Dependency List object. Stored in
                      internal fields whose names start with a blank
                      followed by an underscore " _")
        print takes the key value pairs that constitute a Package
              definition and prints it out. 
	order_string:  Return a string containing the order information
                      gathered so far.
        reset_result: recalculates the results field.
        test:           Tests the package.
	mark: mark with a mark
	unmark: remove a mark.
	test_mark: test if we have been marked with a given mark
	show_mark: show all marks


***) Debian::Package::Results	
  This module handles storing and retrieving information about the
  package ascertained by dependency check runs. 
 Data Structures:
 	Associative array containing the results under key results,
 	further keyed on Type, and then keyed on categories.
methods:
        new: Initializer. Takes a package neame as an argument.
	set_fatal_failure_on_types: records which fields should be
	                            considered critical when
	                            determining critical errors.
	add: add a new result for a given type and category.
	print_result: Print the result for a given type and category.
	result_as_string: As above, except it returns a string.
	check: Return the number of reports for a given type and
	       category. There are special types Critical and All.

***)Debian::Package::Dependency_List

    This class implements a dependency list object. It is expected
    that one Debian::Package::Dependency_List object shall be created
    for each of the relationship fields in a package description.

 Data Structures:
 	Associative array keyed on the package name of the package we
 	depend on. Handles the or `|' operator (used to denote
 	alternates, and, the most desirable package .
 methods:
        new: Initializer It takes an required named argument, string,
             whose value is the value of the Pre-Depends, Depends,
             Recommends, Suggests, Conflicts, or Replaces field values
             for the package. argument, which is a snippet from the
             Packages file.
        add  Adds a new dependency to the list.
        delete  Deletes a dependency from the list.
	match: This method takes a dependency object as an argument,
	       compares it with all the dependencies in the list, and 
	       returns 'Yes' if there is a match.
        print takes the internal representation of a dependency list
              (complete with alternatives) and produces a string,
              which should be the string used to initialize the
              object.
        depend: This method performs dependency checks for all
                elements of the dependency list. It takes required
                named argument  Package, which is the package object
                to whom this dependency list belongs. It cycles
                through all dependencies, calling the depend method of
                each dependency object, handling alternates as it
                goes.  
	order:  Return the order information from all dependencies in 
		the list.
        test:           Tests the package.

****)Debian::Package::Dependency

 This module implements a Debian::Package::Dependency object, which
 contains Meta info for a single dependency.

 Data Structures:
 	Associative array  
 methods
	new: Initializer It takes a named argument, string, whose
	     value is the value of an element in a dependency
	     list. This is a fancy way of saying we record the name,
	     relationship, and version number of the package we have a
	     relationship with, with only the name being required. The
	     relation ship is one of = << <= >>, or >=.
	match: This method takes a dependency object as an argument,
	       compares it with self, and return 'Yes' if they are
	       identical. 
	print: This method takes the internal representation of a
	       dependency and prints it. 
	as_string This method takes the internal representation of a
                  dependency and converts it into a string  
	depend This method takes Named package lists New and
               Installed, and check self to see if the dependencies
               are satisfied. It first checks the package list new,
               and then the package list installed, ignoring specially
               marked packages.
	order:  Return the order information for this dependency
        test:           Tests the package.