raptget 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/README +2 -1
  3. data/lib/raptget/version.rb +2 -2
  4. data/lib/raptget.rb +805 -804
  5. metadata +20 -44
data/lib/raptget.rb CHANGED
@@ -8,907 +8,908 @@
8
8
  # class Raptget::Package.new( array, str, array)
9
9
 
10
10
  require 'tempfile'
11
-
12
- class Raptget
13
- #
14
- # All accessors are boolean unless otherwise noted.
15
- #
16
-
17
- #
18
- # Download only; package files are only retrieved,
19
- # not unpacked or installed.
20
- # Configuration Item: APT::Get::Download-Only.
21
- #
22
- attr_accessor :download_only
23
-
24
- #
25
- # Fix; attempt to correct a system with broken dependencies
26
- # in place. This option, when used with install/remove,
27
- # can omit any packages to permit APT to deduce a likely solution.
28
- # Any Package that are specified must completely correct the problem.
29
- # The option is sometimes necessary when running APT for the first time;
30
- # APT itself does not allow broken package dependencies to exist
31
- # on a system. It is possible that a system's dependency structure can be
32
- # so corrupt as to require manual intervention (which usually means using
33
- # dselect or 'remove' to eliminate some of the offending packages).
34
- # Use of this option together with 'fix_missing' may produce
35
- # an error in some situations.
36
- # Configuration Item: APT::Get::Fix-Broken.
37
- #
38
- attr_accessor :fix_broken
39
-
40
- #
41
- # Ignore missing packages; If packages cannot be retrieved or fail the
42
- # integrity check after retrieval (corrupted package files), hold back
43
- # those packages and handle the result. Use of this option together
44
- # with 'fix_broken' may produce an error in some
45
- # situations. If a package is selected for installation
46
- # (particularly if it is mentioned on the command line) and it could not be
47
- # downloaded then it will be silently held back.
48
- # Configuration Item: APT::Get::Fix-Missing.
49
- #
50
- attr_accessor :fix_missing
51
-
52
- #
53
- # Alias to fix_missing
54
- #
55
- attr_accessor :ignore_missing
56
-
57
- #
58
- # Disables downloading of packages.
59
- # This is best used with ignore_missing to force APT
60
- # to use only the .debs it has already downloaded.
61
- # Configuration Item: APT::Get::Download.
62
- #
63
- attr_accessor :no_download
64
-
65
- #
66
- # Quiet; produces output suitable for logging, omitting progress
67
- # indicators. You can also use 'quiet=#' to set the quiet level,
68
- # overriding the configuration file. Note that quiet level 2 implies 'yes',
69
- # you should never use 'quiet=2' without a no-action modifier
70
- # such as 'download_only', 'print_uris' or 'simulate' as APT may decided to
71
- # do something you did not expect.
72
- # Configuration Item: quiet.
73
- #
74
- attr_accessor :quiet
75
-
76
- #
77
- # No action; perform a simulation of events that would occur
78
- # but do not actually change the system.
79
- # Configuration Item: APT::Get::Simulate.
80
- # Simulate prints out a series of lines each one representing a
81
- # dpkg operation, Configure (Conf), Remove (Remv), Unpack (Inst).
82
- # Square brackets indicate broken packages with and empty set of square
83
- # brackets meaning breaks that are of no consequence (rare).
84
- #
85
- attr_accessor :simulate
86
-
87
- #
88
- # Alias to simulate
89
- #
90
- attr_accessor :just_print
91
-
92
- #
93
- # Alias to simulate
94
- #
95
- attr_accessor :dry_run
96
-
97
- #
98
- # Alias to simulate
99
- #
100
- attr_accessor :recon
101
-
102
- #
103
- # Alias to simulate
104
- #
105
- attr_accessor :no_act
106
-
107
- #
108
- # Automatic yes to prompts; assume "yes" as answer to all
109
- # prompts and run non-interactively. If an undesirable situation,
110
- # such as changing a held package or removing an essential package
111
- # occurs then apt-get will abort.
112
- # Configuration Item: APT::Get::Assume-Yes.
113
- #
114
- attr_accessor :assume_yes
115
-
116
- #
117
- # Alias to assume_yes
118
- #
119
- attr_accessor :yes
120
-
121
- #
122
- # Show upgraded packages; Print out a list of all packages
123
- # that are to be upgraded.
124
- # Configuration Item: APT::Get::Show-Upgraded.
125
- #
126
- attr_accessor :show_upgraded
127
-
128
- #
129
- # Show full versions for upgraded and installed packages.
130
- # Configuration Item: APT::Get::Show-Versions.
131
- #
132
- attr_accessor :verbose_version
133
-
134
- #
135
- # Compile source packages after downloading them.
136
- # Configuration Item: APT::Get::Compile.
137
- #
138
- attr_accessor :build
139
-
140
- #
141
- # Alias to build
142
- #
143
- attr_accessor :compile
144
-
145
- #
146
- # Also install recommended packages.
147
- #
148
- attr_accessor :install_recommends
149
-
150
- #
151
- # Do not install recommended packages.
152
- #
153
- attr_accessor :no_install_recommends
154
-
155
- #
156
- # Ignore package Holds; This causes apt-get to ignore a
157
- # hold placed on a package.
158
- # This may be useful in conjunction with dist-upgrade
159
- # to override a large number of undesired holds.
160
- # Configuration Item: APT::Ignore-Hold.
161
- #
162
- attr_accessor :ignore_hold
163
-
164
- #
165
- # Do not upgrade packages; When used in conjunction with
166
- # install no-upgrade will prevent packages listed from being
167
- # upgraded if they are already installed.
168
- # Configuration Item: APT::Get::Upgrade.
169
- #
170
- attr_accessor :no_upgrade
171
-
172
- #
173
- # Force yes; This is a dangerous option that will cause
174
- # apt to continue without prompting if it is doing something
175
- # potentially harmful. It should not be used except in very special
176
- # situations. Using 'force_yes' can potentially destroy your system!
177
- # Configuration Item: APT::Get::force-yes.
178
- #
179
- attr_accessor :force_yes
180
-
181
- #
182
- # Instead of fetching the files to install their URIs are printed.
183
- # Each URI will have the path, the destination file name, the size
184
- # and the expected md5 hash. Note that the file name to write to will
185
- # not always match the file name on the remote site!
186
- # This also works with the source and update commands.
187
- # When used with the update command the MD5 and size are not included,
188
- # and it is up to the user to decompress any compressed files.
189
- # Configuration Item: APT::Get::Print-URIs.
190
- #
191
- attr_accessor :print_uris
192
-
193
- #
194
- # Use purge instead of remove for anything that would be removed.
195
- # An asterisk ("*") will be displayed next to packages which are
196
- # scheduled to be purged.
197
- # Configuration Item: APT::Get::Purge.
198
- #
199
- attr_accessor :purge
200
-
201
- #
202
- # Re-Install packages that are already installed and at the
203
- # newest version.
204
- # Configuration Item: APT::Get::ReInstall.
205
- #
206
- attr_accessor :reinstall
207
-
208
- #
209
- # This option defaults to on, use 'no_list_cleanup' to turn it off.
210
- # When on apt-get will automatically manage the contents of
211
- # /var/lib/apt/lists to ensure that obsolete files are erased.
212
- # The only reason to turn it off is if you frequently change your
213
- # source list.
214
- # Configuration Item: APT::Get::List-Cleanup.
215
- #
216
- attr_accessor :list_cleanup
217
-
218
- #
219
- # This option controls the default input to the policy engine,
220
- # it creates a default pin at priority 990 using the specified
221
- # release string. The preferences file may further override this setting.
222
- # In short, this option lets you have simple control over which
223
- # distribution packages will be retrieved from.
224
- # Some common examples might be 'default_release = 2.1*' or
225
- # 'default_release = unstable'.
226
- # Configuration Item: APT::Default-Release;
227
- #
228
- attr_accessor :default_release
229
-
230
- #
231
- # Alias to default_release
232
- #
233
- attr_accessor :target_release
234
-
235
- #
236
- # Only perform operations that are 'trivial'. Logically this can
237
- # be considered related to 'assume_yes', where 'assume_yes' will
238
- # answer yes to any prompt, 'trivial_only' will answer no.
239
- # Configuration Item: APT::Get::Trivial-Only.
240
- #
241
- attr_accessor :trivial_only
242
-
243
- #
244
- # If any packages are to be removed apt-get immediately aborts
245
- # without prompting.
246
- # Configuration Item: APT::Get::Remove
247
- #
248
- attr_accessor :no_remove
249
-
250
- #
251
- # If the command is either install or remove, then this option acts
252
- # like running autoremove command, removing the unused dependency
253
- # packages.
254
- # Configuration Item: APT::Get::AutomaticRemove.
255
- #
256
- attr_accessor :auto_remove
257
-
258
- #
259
- # Only has meaning for the source command.
260
- # Indicates that the given source names are not to be mapped
261
- # through the binary table. This means that if this option is specified,
262
- # the source command will only accept source package names as arguments,
263
- # rather than accepting binary package names and looking up the
264
- # corresponding source package.
265
- # Configuration Item: APT::Get::Only-Source
266
- #
267
- attr_accessor :only_source
268
-
269
- #
270
- # Download only the tar file of a source archive.
271
- # Configuration Item: APT::Get::Tar-Only
272
- #
273
- attr_accessor :tar_only
274
-
275
- #
276
- # Download only the dsc file of a source archive.
277
- # Configuration Item: APT::Get::Dsc-Only
278
- #
279
- attr_accessor :dsc_only
280
-
281
- #
282
- # Download only the diff file of a source archive.
283
- # Configuration Item: APT::Get::Diff-Only
284
- #
285
- attr_accessor :diff_only
286
-
287
- #
288
- # Ignore if packages can't be authenticated and don't prompt about
289
- # it. This is useful for tools like pbuilder.
290
- # Configuration Item: APT::Get::AllowUnauthenticated.
291
- #
292
- attr_accessor :allow_unauthenticated
293
-
294
- #
295
- # Only process architecture-dependent build-dependencies.
296
- # Configuration Item: APT::Get::Arch-Only
297
- #
298
- attr_accessor :arch_only
299
-
300
- #
301
- # Configuration File; Specify a configuration file to use.
302
- # The program will read the default configuration file and
303
- # then this configuration file.
304
- #
305
- attr_accessor :config_file
306
-
307
- #
308
- # Set a Configuration Option; This will set an arbitrary
309
- # configuration option.
310
- # The syntax is raptget.option = "Foo::Bar=bar"
311
- #
312
- attr_accessor :option
313
-
314
- #
315
- # Disable sudo. If this is not set, sudo
316
- # is used.
317
- #
318
- attr_accessor :disable_sudo
319
-
320
- #
321
- # Returns a new Raptget Object
322
- #
323
- def initialize()
324
- end
325
-
326
- #
327
- # install is followed by one or more packages desired for
328
- # installation or upgrading. Each package is a package name, not a
329
- # fully qualified filename (for instance, in a Debian GNU/Linux
330
- # system, libc6 would be the argument provided, not
331
- # libc6_1.9.6-2.deb). All packages required by the package(s)
332
- # specified for installation will also be retrieved and installed.
333
- # The /etc/apt/sources.list file is used to locate the desired
334
- # packages. If a hyphen is appended to the package name (with no
335
- # intervening space), the identified package will be removed if it is
336
- # installed. Similarly a plus sign can be used to designate a package
337
- # to install. These latter features may be used to override decisions
338
- # made by apt-get's conflict resolution system.
339
- #
340
- # A specific version of a package can be selected for installation by
341
- # following the package name with an equals and the version of the
342
- # package to select. This will cause that version to be located and
343
- # selected for install. Alternatively a specific distribution can be
344
- # selected by following the package name with a slash and the version
345
- # of the distribution or the Archive name (stable, testing,
346
- # unstable).
347
- #
348
- # Both of the version selection mechanisms can downgrade packages and
349
- # must be used with care.
350
- #
351
- # This is also the target to use if you want to upgrade one or more
352
- # already-installed packages without upgrading every package you have
353
- # on your system. Unlike the "upgrade" target, which installs the
354
- # newest version of all currently installed packages, "install" will
355
- # install the newest version of only the package(s) specified. Simply
356
- # provide the name of the package(s) you wish to upgrade, and if a
357
- # newer version is available, it (and its dependencies, as described
358
- # above) will be downloaded and installed.
359
- #
360
- # Finally, the apt_preferences mechanism allows you to create an
361
- # alternative installation policy for individual packages.
362
- #
363
- # If no package matches the given expression and the expression
364
- # contains one of '.', '?' or '*' then it is assumed to be a POSIX
365
- # regular expression, and it is applied to all package names in the
366
- # database. Any matches are then installed (or removed). Note that
367
- # matching is done by substring so 'lo.*' matches 'how-lo' and
368
- # 'lowest'. If this is undesired, anchor the regular expression with
369
- # a '^' or '$' character, or create a more specific regular
370
- # expression.
371
- #
372
- def install(packages)
373
-
374
- tmp = Tempfile.new('raptget_install')
375
- packages.collect! { |i| i + " " }
376
- command = option_string() + "install " + packages.to_s + " 2> " + tmp.path
377
- success = system(command)
378
- if success
379
- begin
380
- while (line = tmp.readline)
381
- line.chomp
382
- selected_string = line if line =~ /Setting up/
11
+ require_relative 'raptget/version'
12
+
13
+ module Raptget
14
+ class Aptget
15
+ VERSION = Raptget::VERSION::STRING
16
+
17
+ #
18
+ # All accessors are boolean unless otherwise noted.
19
+ #
20
+
21
+ #
22
+ # Download only; package files are only retrieved,
23
+ # not unpacked or installed.
24
+ # Configuration Item: APT::Get::Download-Only.
25
+ #
26
+ attr_accessor :download_only
27
+
28
+ #
29
+ # Fix; attempt to correct a system with broken dependencies
30
+ # in place. This option, when used with install/remove,
31
+ # can omit any packages to permit APT to deduce a likely solution.
32
+ # Any Package that are specified must completely correct the problem.
33
+ # The option is sometimes necessary when running APT for the first time;
34
+ # APT itself does not allow broken package dependencies to exist
35
+ # on a system. It is possible that a system's dependency structure can be
36
+ # so corrupt as to require manual intervention (which usually means using
37
+ # dselect or 'remove' to eliminate some of the offending packages).
38
+ # Use of this option together with 'fix_missing' may produce
39
+ # an error in some situations.
40
+ # Configuration Item: APT::Get::Fix-Broken.
41
+ #
42
+ attr_accessor :fix_broken
43
+
44
+ #
45
+ # Ignore missing packages; If packages cannot be retrieved or fail the
46
+ # integrity check after retrieval (corrupted package files), hold back
47
+ # those packages and handle the result. Use of this option together
48
+ # with 'fix_broken' may produce an error in some
49
+ # situations. If a package is selected for installation
50
+ # (particularly if it is mentioned on the command line) and it could not be
51
+ # downloaded then it will be silently held back.
52
+ # Configuration Item: APT::Get::Fix-Missing.
53
+ #
54
+ attr_accessor :fix_missing
55
+
56
+ #
57
+ # Alias to fix_missing
58
+ #
59
+ attr_accessor :ignore_missing
60
+
61
+ #
62
+ # Disables downloading of packages.
63
+ # This is best used with ignore_missing to force APT
64
+ # to use only the .debs it has already downloaded.
65
+ # Configuration Item: APT::Get::Download.
66
+ #
67
+ attr_accessor :no_download
68
+
69
+ #
70
+ # Quiet; produces output suitable for logging, omitting progress
71
+ # indicators. You can also use 'quiet=#' to set the quiet level,
72
+ # overriding the configuration file. Note that quiet level 2 implies 'yes',
73
+ # you should never use 'quiet=2' without a no-action modifier
74
+ # such as 'download_only', 'print_uris' or 'simulate' as APT may decided to
75
+ # do something you did not expect.
76
+ # Configuration Item: quiet.
77
+ #
78
+ attr_accessor :quiet
79
+
80
+ #
81
+ # No action; perform a simulation of events that would occur
82
+ # but do not actually change the system.
83
+ # Configuration Item: APT::Get::Simulate.
84
+ # Simulate prints out a series of lines each one representing a
85
+ # dpkg operation, Configure (Conf), Remove (Remv), Unpack (Inst).
86
+ # Square brackets indicate broken packages with and empty set of square
87
+ # brackets meaning breaks that are of no consequence (rare).
88
+ #
89
+ attr_accessor :simulate
90
+
91
+ #
92
+ # Alias to simulate
93
+ #
94
+ attr_accessor :just_print
95
+
96
+ #
97
+ # Alias to simulate
98
+ #
99
+ attr_accessor :dry_run
100
+
101
+ #
102
+ # Alias to simulate
103
+ #
104
+ attr_accessor :recon
105
+
106
+ #
107
+ # Alias to simulate
108
+ #
109
+ attr_accessor :no_act
110
+
111
+ #
112
+ # Automatic yes to prompts; assume "yes" as answer to all
113
+ # prompts and run non-interactively. If an undesirable situation,
114
+ # such as changing a held package or removing an essential package
115
+ # occurs then apt-get will abort.
116
+ # Configuration Item: APT::Get::Assume-Yes.
117
+ #
118
+ attr_accessor :assume_yes
119
+
120
+ #
121
+ # Alias to assume_yes
122
+ #
123
+ attr_accessor :yes
124
+
125
+ #
126
+ # Show upgraded packages; Print out a list of all packages
127
+ # that are to be upgraded.
128
+ # Configuration Item: APT::Get::Show-Upgraded.
129
+ #
130
+ attr_accessor :show_upgraded
131
+
132
+ #
133
+ # Show full versions for upgraded and installed packages.
134
+ # Configuration Item: APT::Get::Show-Versions.
135
+ #
136
+ attr_accessor :verbose_version
137
+
138
+ #
139
+ # Compile source packages after downloading them.
140
+ # Configuration Item: APT::Get::Compile.
141
+ #
142
+ attr_accessor :build
143
+
144
+ #
145
+ # Alias to build
146
+ #
147
+ attr_accessor :compile
148
+
149
+ #
150
+ # Also install recommended packages.
151
+ #
152
+ attr_accessor :install_recommends
153
+
154
+ #
155
+ # Do not install recommended packages.
156
+ #
157
+ attr_accessor :no_install_recommends
158
+
159
+ #
160
+ # Ignore package Holds; This causes apt-get to ignore a
161
+ # hold placed on a package.
162
+ # This may be useful in conjunction with dist-upgrade
163
+ # to override a large number of undesired holds.
164
+ # Configuration Item: APT::Ignore-Hold.
165
+ #
166
+ attr_accessor :ignore_hold
167
+
168
+ #
169
+ # Do not upgrade packages; When used in conjunction with
170
+ # install no-upgrade will prevent packages listed from being
171
+ # upgraded if they are already installed.
172
+ # Configuration Item: APT::Get::Upgrade.
173
+ #
174
+ attr_accessor :no_upgrade
175
+
176
+ #
177
+ # Force yes; This is a dangerous option that will cause
178
+ # apt to continue without prompting if it is doing something
179
+ # potentially harmful. It should not be used except in very special
180
+ # situations. Using 'force_yes' can potentially destroy your system!
181
+ # Configuration Item: APT::Get::force-yes.
182
+ #
183
+ attr_accessor :force_yes
184
+
185
+ #
186
+ # Instead of fetching the files to install their URIs are printed.
187
+ # Each URI will have the path, the destination file name, the size
188
+ # and the expected md5 hash. Note that the file name to write to will
189
+ # not always match the file name on the remote site!
190
+ # This also works with the source and update commands.
191
+ # When used with the update command the MD5 and size are not included,
192
+ # and it is up to the user to decompress any compressed files.
193
+ # Configuration Item: APT::Get::Print-URIs.
194
+ #
195
+ attr_accessor :print_uris
196
+
197
+ #
198
+ # Use purge instead of remove for anything that would be removed.
199
+ # An asterisk ("*") will be displayed next to packages which are
200
+ # scheduled to be purged.
201
+ # Configuration Item: APT::Get::Purge.
202
+ #
203
+ attr_accessor :purge
204
+
205
+ #
206
+ # Re-Install packages that are already installed and at the
207
+ # newest version.
208
+ # Configuration Item: APT::Get::ReInstall.
209
+ #
210
+ attr_accessor :reinstall
211
+
212
+ #
213
+ # This option defaults to on, use 'no_list_cleanup' to turn it off.
214
+ # When on apt-get will automatically manage the contents of
215
+ # /var/lib/apt/lists to ensure that obsolete files are erased.
216
+ # The only reason to turn it off is if you frequently change your
217
+ # source list.
218
+ # Configuration Item: APT::Get::List-Cleanup.
219
+ #
220
+ attr_accessor :list_cleanup
221
+
222
+ #
223
+ # This option controls the default input to the policy engine,
224
+ # it creates a default pin at priority 990 using the specified
225
+ # release string. The preferences file may further override this setting.
226
+ # In short, this option lets you have simple control over which
227
+ # distribution packages will be retrieved from.
228
+ # Some common examples might be 'default_release = 2.1*' or
229
+ # 'default_release = unstable'.
230
+ # Configuration Item: APT::Default-Release;
231
+ #
232
+ attr_accessor :default_release
233
+
234
+ #
235
+ # Alias to default_release
236
+ #
237
+ attr_accessor :target_release
238
+
239
+ #
240
+ # Only perform operations that are 'trivial'. Logically this can
241
+ # be considered related to 'assume_yes', where 'assume_yes' will
242
+ # answer yes to any prompt, 'trivial_only' will answer no.
243
+ # Configuration Item: APT::Get::Trivial-Only.
244
+ #
245
+ attr_accessor :trivial_only
246
+
247
+ #
248
+ # If any packages are to be removed apt-get immediately aborts
249
+ # without prompting.
250
+ # Configuration Item: APT::Get::Remove
251
+ #
252
+ attr_accessor :no_remove
253
+
254
+ #
255
+ # If the command is either install or remove, then this option acts
256
+ # like running autoremove command, removing the unused dependency
257
+ # packages.
258
+ # Configuration Item: APT::Get::AutomaticRemove.
259
+ #
260
+ attr_accessor :auto_remove
261
+
262
+ #
263
+ # Only has meaning for the source command.
264
+ # Indicates that the given source names are not to be mapped
265
+ # through the binary table. This means that if this option is specified,
266
+ # the source command will only accept source package names as arguments,
267
+ # rather than accepting binary package names and looking up the
268
+ # corresponding source package.
269
+ # Configuration Item: APT::Get::Only-Source
270
+ #
271
+ attr_accessor :only_source
272
+
273
+ #
274
+ # Download only the tar file of a source archive.
275
+ # Configuration Item: APT::Get::Tar-Only
276
+ #
277
+ attr_accessor :tar_only
278
+
279
+ #
280
+ # Download only the dsc file of a source archive.
281
+ # Configuration Item: APT::Get::Dsc-Only
282
+ #
283
+ attr_accessor :dsc_only
284
+
285
+ #
286
+ # Download only the diff file of a source archive.
287
+ # Configuration Item: APT::Get::Diff-Only
288
+ #
289
+ attr_accessor :diff_only
290
+
291
+ #
292
+ # Ignore if packages can't be authenticated and don't prompt about
293
+ # it. This is useful for tools like pbuilder.
294
+ # Configuration Item: APT::Get::AllowUnauthenticated.
295
+ #
296
+ attr_accessor :allow_unauthenticated
297
+
298
+ #
299
+ # Only process architecture-dependent build-dependencies.
300
+ # Configuration Item: APT::Get::Arch-Only
301
+ #
302
+ attr_accessor :arch_only
303
+
304
+ #
305
+ # Configuration File; Specify a configuration file to use.
306
+ # The program will read the default configuration file and
307
+ # then this configuration file.
308
+ #
309
+ attr_accessor :config_file
310
+
311
+ #
312
+ # Set a Configuration Option; This will set an arbitrary
313
+ # configuration option.
314
+ # The syntax is raptget.option = "Foo::Bar=bar"
315
+ #
316
+ attr_accessor :option
317
+
318
+ #
319
+ # Disable sudo. If this is not set, sudo
320
+ # is used.
321
+ #
322
+ attr_accessor :disable_sudo
323
+
324
+ #
325
+ # Returns a new Raptget Object
326
+ #
327
+ def initialize()
328
+ end
329
+
330
+ #
331
+ # install is followed by one or more packages desired for
332
+ # installation or upgrading. Each package is a package name, not a
333
+ # fully qualified filename (for instance, in a Debian GNU/Linux
334
+ # system, libc6 would be the argument provided, not
335
+ # libc6_1.9.6-2.deb). All packages required by the package(s)
336
+ # specified for installation will also be retrieved and installed.
337
+ # The /etc/apt/sources.list file is used to locate the desired
338
+ # packages. If a hyphen is appended to the package name (with no
339
+ # intervening space), the identified package will be removed if it is
340
+ # installed. Similarly a plus sign can be used to designate a package
341
+ # to install. These latter features may be used to override decisions
342
+ # made by apt-get's conflict resolution system.
343
+ #
344
+ # A specific version of a package can be selected for installation by
345
+ # following the package name with an equals and the version of the
346
+ # package to select. This will cause that version to be located and
347
+ # selected for install. Alternatively a specific distribution can be
348
+ # selected by following the package name with a slash and the version
349
+ # of the distribution or the Archive name (stable, testing,
350
+ # unstable).
351
+ #
352
+ # Both of the version selection mechanisms can downgrade packages and
353
+ # must be used with care.
354
+ #
355
+ # This is also the target to use if you want to upgrade one or more
356
+ # already-installed packages without upgrading every package you have
357
+ # on your system. Unlike the "upgrade" target, which installs the
358
+ # newest version of all currently installed packages, "install" will
359
+ # install the newest version of only the package(s) specified. Simply
360
+ # provide the name of the package(s) you wish to upgrade, and if a
361
+ # newer version is available, it (and its dependencies, as described
362
+ # above) will be downloaded and installed.
363
+ #
364
+ # Finally, the apt_preferences mechanism allows you to create an
365
+ # alternative installation policy for individual packages.
366
+ #
367
+ # If no package matches the given expression and the expression
368
+ # contains one of '.', '?' or '*' then it is assumed to be a POSIX
369
+ # regular expression, and it is applied to all package names in the
370
+ # database. Any matches are then installed (or removed). Note that
371
+ # matching is done by substring so 'lo.*' matches 'how-lo' and
372
+ # 'lowest'. If this is undesired, anchor the regular expression with
373
+ # a '^' or '$' character, or create a more specific regular
374
+ # expression.
375
+ #
376
+ def install(packages)
377
+
378
+ tmp = Tempfile.new('raptget_install')
379
+ packages.collect! { |i| i + " " }
380
+ command = option_string() + "install " + packages.to_s + " 2> " + tmp.path
381
+ success = system(command)
382
+ if success
383
+ begin
384
+ while (line = tmp.readline)
385
+ line.chomp
386
+ selected_string = line if line =~ /Setting up/
387
+ end
388
+ rescue EOFError
389
+ tmp.close
383
390
  end
384
- rescue EOFError
385
- tmp.close
391
+ return selected_string
392
+ else
393
+ tmp.close!
394
+ return success
386
395
  end
387
- return selected_string
388
- else
389
- tmp.close!
390
- return success
391
- end
392
396
 
393
- end
397
+ end
394
398
 
395
- # update is used to resynchronize the package index files from their
396
- # sources. The indexes of available packages are fetched from the
397
- # location(s) specified in /etc/apt/sources.list. For example, when
398
- # using a Debian archive, this command retrieves and scans the
399
- # Packages.gz files, so that information about new and updated
400
- # packages is available. An update should always be performed before
401
- # an upgrade or dist-upgrade. Please be aware that the overall
402
- # progress meter will be incorrect as the size of the package files
403
- # cannot be known in advance.
404
- def update
405
-
406
- tmp = Tempfile.new('raptget_update')
407
- command = option_string() + "update " + " 2> " + tmp.path
408
- success = system(command)
409
- if success
410
- begin
411
- while (line = tmp.readline)
412
- line.chomp
413
- selected_string = line if line =~ /Hit/
399
+ # update is used to resynchronize the package index files from their
400
+ # sources. The indexes of available packages are fetched from the
401
+ # location(s) specified in /etc/apt/sources.list. For example, when
402
+ # using a Debian archive, this command retrieves and scans the
403
+ # Packages.gz files, so that information about new and updated
404
+ # packages is available. An update should always be performed before
405
+ # an upgrade or dist-upgrade. Please be aware that the overall
406
+ # progress meter will be incorrect as the size of the package files
407
+ # cannot be known in advance.
408
+ def update
409
+
410
+ tmp = Tempfile.new('raptget_update')
411
+ command = option_string() + "update " + " 2> " + tmp.path
412
+ success = system(command)
413
+ if success
414
+ begin
415
+ while (line = tmp.readline)
416
+ line.chomp
417
+ selected_string = line if line =~ /Hit/
418
+ end
419
+ rescue EOFError
420
+ tmp.close
414
421
  end
415
- rescue EOFError
416
- tmp.close
422
+ return selected_string
423
+ else
424
+ tmp.close!
425
+ return success
417
426
  end
418
- return selected_string
419
- else
420
- tmp.close!
421
- return success
422
- end
423
427
 
424
- end
428
+ end
425
429
 
426
- # upgrade is used to install the newest versions of all packages
427
- # currently installed on the system from the sources enumerated in
428
- # /etc/apt/sources.list. Packages currently installed with new
429
- # versions available are retrieved and upgraded; under no
430
- # circumstances are currently installed packages removed, or packages
431
- # not already installed retrieved and installed. New versions of
432
- # currently installed packages that cannot be upgraded without
433
- # changing the install status of another package will be left at
434
- # their current version. An update must be performed first so that
435
- # apt-get knows that new versions of packages are available.
436
- def upgrade
437
-
438
- tmp = Tempfile.new('raptget_upgrade')
439
- command = option_string() + "upgrade " + " 2> " + tmp.path
440
- success = system(command)
441
- if success
442
- begin
443
- while (line = tmp.readline)
444
- line.chomp
445
- selected_string = line if line =~ /^Setting up/
430
+ # upgrade is used to install the newest versions of all packages
431
+ # currently installed on the system from the sources enumerated in
432
+ # /etc/apt/sources.list. Packages currently installed with new
433
+ # versions available are retrieved and upgraded; under no
434
+ # circumstances are currently installed packages removed, or packages
435
+ # not already installed retrieved and installed. New versions of
436
+ # currently installed packages that cannot be upgraded without
437
+ # changing the install status of another package will be left at
438
+ # their current version. An update must be performed first so that
439
+ # apt-get knows that new versions of packages are available.
440
+ def upgrade
441
+
442
+ tmp = Tempfile.new('raptget_upgrade')
443
+ command = option_string() + "upgrade " + " 2> " + tmp.path
444
+ success = system(command)
445
+ if success
446
+ begin
447
+ while (line = tmp.readline)
448
+ line.chomp
449
+ selected_string = line if line =~ /^Setting up/
450
+ end
451
+ rescue EOFError
452
+ tmp.close
446
453
  end
447
- rescue EOFError
448
- tmp.close
454
+ return selected_string
455
+ else
456
+ tmp.close!
457
+ return success
449
458
  end
450
- return selected_string
451
- else
452
- tmp.close!
453
- return success
454
- end
455
459
 
456
- end
460
+ end
457
461
 
458
- # dselect_upgrade is used in conjunction with the traditional Debian
459
- # packaging front-end, dselect. 'dselect_upgrade' follows the
460
- # changes made by dselect to the Status field of available
461
- # packages, and performs the actions necessary to realize that state
462
- # (for instance, the removal of old and the installation of new
463
- # packages).
464
- def dselect_upgrade
465
-
466
- tmp = Tempfile.new('raptget_dselect_upgrade')
467
- command = option_string() + "dselect-upgrade " + " 2> " + tmp.path
468
- success = system(command)
469
- if success
470
- begin
471
- while (line = tmp.readline)
472
- line.chomp
473
- selected_string = line if line =~ /^Setting up/
462
+ # dselect_upgrade is used in conjunction with the traditional Debian
463
+ # packaging front-end, dselect. 'dselect_upgrade' follows the
464
+ # changes made by dselect to the Status field of available
465
+ # packages, and performs the actions necessary to realize that state
466
+ # (for instance, the removal of old and the installation of new
467
+ # packages).
468
+ def dselect_upgrade
469
+
470
+ tmp = Tempfile.new('raptget_dselect_upgrade')
471
+ command = option_string() + "dselect-upgrade " + " 2> " + tmp.path
472
+ success = system(command)
473
+ if success
474
+ begin
475
+ while (line = tmp.readline)
476
+ line.chomp
477
+ selected_string = line if line =~ /^Setting up/
478
+ end
479
+ rescue EOFError
480
+ tmp.close
474
481
  end
475
- rescue EOFError
476
- tmp.close
482
+ return selected_string
483
+ else
484
+ tmp.close!
485
+ return success
477
486
  end
478
- return selected_string
479
- else
480
- tmp.close!
481
- return success
482
- end
483
487
 
484
- end
488
+ end
485
489
 
486
- # dist_upgrade in addition to performing the function of upgrade,
487
- # also intelligently handles changing dependencies with new versions
488
- # of packages; apt-get has a "smart" conflict resolution system, and
489
- # it will attempt to upgrade the most important packages at the
490
- # expense of less important ones if necessary. So, 'dist_upgrade'
491
- # command may remove some packages. The /etc/apt/sources.list file
492
- # contains a list of locations from which to retrieve desired package
493
- # files. See also apt_preferences for a mechanism for overriding
494
- # the general settings for individual packages.
495
- def dist_upgrade
496
-
497
- tmp = Tempfile.new('raptget_dist_upgrade')
498
- command = option_string() + "dist-upgrade " + " 2> " + tmp.path
499
- success = system(command)
500
- if success
501
- begin
502
- while (line = tmp.readline)
503
- line.chomp
504
- selected_string = line if line =~ /^Setting up/
490
+ # dist_upgrade in addition to performing the function of upgrade,
491
+ # also intelligently handles changing dependencies with new versions
492
+ # of packages; apt-get has a "smart" conflict resolution system, and
493
+ # it will attempt to upgrade the most important packages at the
494
+ # expense of less important ones if necessary. So, 'dist_upgrade'
495
+ # command may remove some packages. The /etc/apt/sources.list file
496
+ # contains a list of locations from which to retrieve desired package
497
+ # files. See also apt_preferences for a mechanism for overriding
498
+ # the general settings for individual packages.
499
+ def dist_upgrade
500
+
501
+ tmp = Tempfile.new('raptget_dist_upgrade')
502
+ command = option_string() + "dist-upgrade " + " 2> " + tmp.path
503
+ success = system(command)
504
+ if success
505
+ begin
506
+ while (line = tmp.readline)
507
+ line.chomp
508
+ selected_string = line if line =~ /^Setting up/
509
+ end
510
+ rescue EOFError
511
+ tmp.close
505
512
  end
506
- rescue EOFError
507
- tmp.close
513
+ return selected_string
514
+ else
515
+ tmp.close!
516
+ return success
508
517
  end
509
- return selected_string
510
- else
511
- tmp.close!
512
- return success
513
- end
514
518
 
515
- end
519
+ end
516
520
 
517
- # remove is identical to install except that packages are removed
518
- # instead of installed. Note the removing a package leaves its
519
- # configuration files in system. If a plus sign is appended to the
520
- # package name (with no intervening space), the identified package
521
- # will be installed instead of removed.
522
- def remove(packages)
523
-
524
- tmp = Tempfile.new('raptget_remove')
525
- packages.collect! { |i| i + " " }
526
- command = option_string() + "remove " + packages.to_s + " 2> " + tmp.path
527
- success = system(command)
528
- if success
529
- begin
530
- while (line = tmp.readline)
531
- line.chomp
532
- selected_string = line if line =~ /Removing/
521
+ # remove is identical to install except that packages are removed
522
+ # instead of installed. Note the removing a package leaves its
523
+ # configuration files in system. If a plus sign is appended to the
524
+ # package name (with no intervening space), the identified package
525
+ # will be installed instead of removed.
526
+ def remove(packages)
527
+
528
+ tmp = Tempfile.new('raptget_remove')
529
+ packages.collect! { |i| i + " " }
530
+ command = option_string() + "remove " + packages.to_s + " 2> " + tmp.path
531
+ success = system(command)
532
+ if success
533
+ begin
534
+ while (line = tmp.readline)
535
+ line.chomp
536
+ selected_string = line if line =~ /Removing/
537
+ end
538
+ rescue EOFError
539
+ tmp.close
533
540
  end
534
- rescue EOFError
535
- tmp.close
541
+ return selected_string
542
+ else
543
+ tmp.close!
544
+ return success
536
545
  end
537
- return selected_string
538
- else
539
- tmp.close!
540
- return success
546
+
541
547
  end
542
548
 
543
- end
549
+ # purge is identical to remove except that packages are removed and
550
+ # purged (any configuration files are deleted too).
551
+ def purge(packages)
544
552
 
545
- # purge is identical to remove except that packages are removed and
546
- # purged (any configuration files are deleted too).
547
- def purge(packages)
548
-
549
- tmp = Tempfile.new('raptget_purge')
550
- packages.collect! { |i| i + " " }
551
- command = option_string() + "purge " + packages.to_s + " 2> " + tmp.path
552
- success = system(command)
553
- if success
554
- begin
555
- while (line = tmp.readline)
556
- line.chomp
557
- selected_string = line if line =~ /Removing/
553
+ tmp = Tempfile.new('raptget_purge')
554
+ packages.collect! { |i| i + " " }
555
+ command = option_string() + "purge " + packages.to_s + " 2> " + tmp.path
556
+ success = system(command)
557
+ if success
558
+ begin
559
+ while (line = tmp.readline)
560
+ line.chomp
561
+ selected_string = line if line =~ /Removing/
562
+ end
563
+ rescue EOFError
564
+ tmp.close
558
565
  end
559
- rescue EOFError
560
- tmp.close
566
+ return selected_string
567
+ else
568
+ tmp.close!
569
+ return success
561
570
  end
562
- return selected_string
563
- else
564
- tmp.close!
565
- return success
566
- end
567
571
 
568
- end
572
+ end
569
573
 
570
- # source causes apt-get to fetch source packages. APT will examine
571
- # the available packages to decide which source package to fetch. It
572
- # will then find and download into the current directory the newest
573
- # available version of that source package while respect the default
574
- # release, set with the option APT::Default-Release, the 'target_release'
575
- # option or per package with the pkg/release syntax, if possible.
576
- #
577
- # Source packages are tracked separately from binary packages via
578
- # deb-src type lines in the sources.list file. This means that you
579
- # will need to add such a line for each repository you want to get
580
- # sources from. If you don't do this you will properly get another
581
- # (newer, older or none) source version than the one you have
582
- # installed or could install.
583
- #
584
- # If the 'compile' option is specified then the package will be
585
- # compiled to a binary .deb using dpkg-buildpackage, if
586
- # 'download_only' is specified then the source package will not be
587
- # unpacked.
588
- #
589
- # A specific source version can be retrieved by postfixing the source
590
- # name with an equals and then the version to fetch, similar to the
591
- # mechanism used for the package files. This enables exact matching
592
- # of the source package name and version, implicitly enabling the
593
- # APT::Get::Only-Source option.
594
- #
595
- # Note that source packages are not tracked like binary packages,
596
- # they exist only in the current directory and are similar to
597
- # downloading source tar balls.
598
- def source(packages)
599
-
600
- tmp = Tempfile.new('raptget_source')
601
- packages.collect! { |i| i + " " }
602
- command = option_string() + "source " + packages.to_s + " 2> " + tmp.path
603
- success = system(command)
604
- if success
605
- begin
606
- while (line = tmp.readline)
607
- line.chomp
608
- selected_string = line
574
+ # source causes apt-get to fetch source packages. APT will examine
575
+ # the available packages to decide which source package to fetch. It
576
+ # will then find and download into the current directory the newest
577
+ # available version of that source package while respect the default
578
+ # release, set with the option APT::Default-Release, the 'target_release'
579
+ # option or per package with the pkg/release syntax, if possible.
580
+ #
581
+ # Source packages are tracked separately from binary packages via
582
+ # deb-src type lines in the sources.list file. This means that you
583
+ # will need to add such a line for each repository you want to get
584
+ # sources from. If you don't do this you will properly get another
585
+ # (newer, older or none) source version than the one you have
586
+ # installed or could install.
587
+ #
588
+ # If the 'compile' option is specified then the package will be
589
+ # compiled to a binary .deb using dpkg-buildpackage, if
590
+ # 'download_only' is specified then the source package will not be
591
+ # unpacked.
592
+ #
593
+ # A specific source version can be retrieved by postfixing the source
594
+ # name with an equals and then the version to fetch, similar to the
595
+ # mechanism used for the package files. This enables exact matching
596
+ # of the source package name and version, implicitly enabling the
597
+ # APT::Get::Only-Source option.
598
+ #
599
+ # Note that source packages are not tracked like binary packages,
600
+ # they exist only in the current directory and are similar to
601
+ # downloading source tar balls.
602
+ def source(packages)
603
+
604
+ tmp = Tempfile.new('raptget_source')
605
+ packages.collect! { |i| i + " " }
606
+ command = option_string() + "source " + packages.to_s + " 2> " + tmp.path
607
+ success = system(command)
608
+ if success
609
+ begin
610
+ while (line = tmp.readline)
611
+ line.chomp
612
+ selected_string = line
613
+ end
614
+ rescue EOFError
615
+ tmp.close
609
616
  end
610
- rescue EOFError
611
- tmp.close
617
+ return selected_string
618
+ else
619
+ tmp.close!
620
+ return success
612
621
  end
613
- return selected_string
614
- else
615
- tmp.close!
616
- return success
622
+
617
623
  end
618
624
 
619
- end
625
+ # 'build_dep' causes apt-get to install/remove packages in an attempt
626
+ # to satisfy the build dependencies for a source package.
627
+ def build_dep(packages)
620
628
 
621
- # 'build_dep' causes apt-get to install/remove packages in an attempt
622
- # to satisfy the build dependencies for a source package.
623
- def build_dep(packages)
624
-
625
- tmp = Tempfile.new('raptget_build_dep')
626
- packages.collect! { |i| i + " " }
627
- command = option_string() + "build-dep " + packages.to_s + " 2> " + tmp.path
628
- success = system(command)
629
- if success
630
- begin
631
- while (line = tmp.readline)
632
- line.chomp
633
- selected_string = line
629
+ tmp = Tempfile.new('raptget_build_dep')
630
+ packages.collect! { |i| i + " " }
631
+ command = option_string() + "build-dep " + packages.to_s + " 2> " + tmp.path
632
+ success = system(command)
633
+ if success
634
+ begin
635
+ while (line = tmp.readline)
636
+ line.chomp
637
+ selected_string = line
638
+ end
639
+ rescue EOFError
640
+ tmp.close
634
641
  end
635
- rescue EOFError
636
- tmp.close
642
+ return selected_string
643
+ else
644
+ tmp.close!
645
+ return success
637
646
  end
638
- return selected_string
639
- else
640
- tmp.close!
641
- return success
647
+
642
648
  end
643
649
 
644
- end
650
+ # clean clears out the local repository of retrieved package files.
651
+ # It removes everything but the lock file from
652
+ # /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
653
+ # APT is used as a dselect method, clean is run automatically.
654
+ # Those who do not use dselect will likely want to run apt-get clean
655
+ # from time to time to free up disk space.
656
+ def clean
645
657
 
646
- # clean clears out the local repository of retrieved package files.
647
- # It removes everything but the lock file from
648
- # /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
649
- # APT is used as a dselect method, clean is run automatically.
650
- # Those who do not use dselect will likely want to run apt-get clean
651
- # from time to time to free up disk space.
652
- def clean
658
+ command = option_string() + "clean "
659
+ success = system(command)
660
+ return success
653
661
 
654
- command = option_string() + "clean "
655
- success = system(command)
656
- return success
662
+ end
657
663
 
658
- end
664
+ # check is a diagnostic tool; it updates the package cache and checks
665
+ # for broken dependencies.
666
+ def check
659
667
 
660
- # check is a diagnostic tool; it updates the package cache and checks
661
- # for broken dependencies.
662
- def check
663
-
664
- tmp = Tempfile.new('raptget_check')
665
- command = option_string() + "check " + " 2> " + tmp.path
666
- success = system(command)
667
- if success
668
- begin
669
- while (line = tmp.readline)
670
- line.chomp
671
- selected_string = line
668
+ tmp = Tempfile.new('raptget_check')
669
+ command = option_string() + "check " + " 2> " + tmp.path
670
+ success = system(command)
671
+ if success
672
+ begin
673
+ while (line = tmp.readline)
674
+ line.chomp
675
+ selected_string = line
676
+ end
677
+ rescue EOFError
678
+ tmp.close
672
679
  end
673
- rescue EOFError
674
- tmp.close
680
+ return selected_string
681
+ else
682
+ tmp.close!
683
+ return success
675
684
  end
676
- return selected_string
677
- else
678
- tmp.close!
679
- return success
680
- end
681
685
 
682
- end
686
+ end
683
687
 
684
- # Like clean, autoclean clears out the local repository of retrieved
685
- # package files. The difference is that it only removes package files
686
- # that can no longer be downloaded, and are largely useless. This
687
- # allows a cache to be maintained over a long period without it
688
- # growing out of control. The configuration option
689
- # APT::Clean-Installed will prevent installed packages from being
690
- # erased if it is set to off.
691
- def autoclean
692
-
693
- tmp = Tempfile.new('raptget_autoclean')
694
- command = option_string() + "autoclean " + " 2> " + tmp.path
695
- success = system(command)
696
- if success
697
- begin
698
- while (line = tmp.readline)
699
- line.chomp
700
- selected_string = line
688
+ # Like clean, autoclean clears out the local repository of retrieved
689
+ # package files. The difference is that it only removes package files
690
+ # that can no longer be downloaded, and are largely useless. This
691
+ # allows a cache to be maintained over a long period without it
692
+ # growing out of control. The configuration option
693
+ # APT::Clean-Installed will prevent installed packages from being
694
+ # erased if it is set to off.
695
+ def autoclean
696
+
697
+ tmp = Tempfile.new('raptget_autoclean')
698
+ command = option_string() + "autoclean " + " 2> " + tmp.path
699
+ success = system(command)
700
+ if success
701
+ begin
702
+ while (line = tmp.readline)
703
+ line.chomp
704
+ selected_string = line
705
+ end
706
+ rescue EOFError
707
+ tmp.close
701
708
  end
702
- rescue EOFError
703
- tmp.close
709
+ return selected_string
710
+ else
711
+ tmp.close!
712
+ return success
704
713
  end
705
- return selected_string
706
- else
707
- tmp.close!
708
- return success
714
+
709
715
  end
710
716
 
711
- end
717
+ # autoremove is used to remove packages that were automatically
718
+ # installed to satisfy dependencies for some package and that are no
719
+ # more needed.
720
+ def autoremove
712
721
 
713
- # autoremove is used to remove packages that were automatically
714
- # installed to satisfy dependencies for some package and that are no
715
- # more needed.
716
- def autoremove
717
-
718
- tmp = Tempfile.new('raptget_autoremove')
719
- command = option_string() + "autoremove " + " 2> " + tmp.path
720
- success = system(command)
721
- if success
722
- begin
723
- while (line = tmp.readline)
724
- line.chomp
725
- selected_string = line if line =~ /Removing/
722
+ tmp = Tempfile.new('raptget_autoremove')
723
+ command = option_string() + "autoremove " + " 2> " + tmp.path
724
+ success = system(command)
725
+ if success
726
+ begin
727
+ while (line = tmp.readline)
728
+ line.chomp
729
+ selected_string = line if line =~ /Removing/
730
+ end
731
+ rescue EOFError
732
+ tmp.close
726
733
  end
727
- rescue EOFError
728
- tmp.close
734
+ return selected_string
735
+ else
736
+ tmp.close!
737
+ return success
729
738
  end
730
- return selected_string
731
- else
732
- tmp.close!
733
- return success
734
- end
735
739
 
736
- end
740
+ end
737
741
 
738
- private
742
+ private
739
743
 
740
- def option_string()
741
- unless @disable_sudo
742
- ostring = "sudo apt-get "
743
- else
744
- ostring = "apt-get "
745
- end
744
+ def option_string()
745
+ unless @disable_sudo
746
+ ostring = "sudo apt-get "
747
+ else
748
+ ostring = "apt-get "
749
+ end
746
750
 
747
- if @option
748
- ostring += "--option " + @option
749
- end
751
+ if @option
752
+ ostring += "--option " + @option
753
+ end
750
754
 
751
- if @config_file
752
- ostring += "--config-file " + @config_file
753
- end
755
+ if @config_file
756
+ ostring += "--config-file " + @config_file
757
+ end
754
758
 
755
- if @arch_only
756
- ostring += "--arch-only "
757
- end
759
+ if @arch_only
760
+ ostring += "--arch-only "
761
+ end
758
762
 
759
- if @allow_unauthenticated
760
- ostring += "--allow-unauthenticated "
761
- end
763
+ if @allow_unauthenticated
764
+ ostring += "--allow-unauthenticated "
765
+ end
762
766
 
763
- if @diff_only
764
- ostring += "--diff-only "
765
- end
767
+ if @diff_only
768
+ ostring += "--diff-only "
769
+ end
766
770
 
767
- if @dsc_only
768
- ostring += "--dsc-only "
769
- end
771
+ if @dsc_only
772
+ ostring += "--dsc-only "
773
+ end
770
774
 
771
- if @tar_only
772
- ostring += "--tar-only "
773
- end
775
+ if @tar_only
776
+ ostring += "--tar-only "
777
+ end
774
778
 
775
- if @only_source
776
- ostring += "--only-source "
777
- end
779
+ if @only_source
780
+ ostring += "--only-source "
781
+ end
778
782
 
779
- if @auto_remove
780
- ostring += "--auto-remove "
781
- end
783
+ if @auto_remove
784
+ ostring += "--auto-remove "
785
+ end
782
786
 
783
- if @no_remove
784
- ostring += "--no-remove "
785
- end
787
+ if @no_remove
788
+ ostring += "--no-remove "
789
+ end
786
790
 
787
- if @trivial_only
788
- ostring += "--trivial-only "
789
- end
791
+ if @trivial_only
792
+ ostring += "--trivial-only "
793
+ end
790
794
 
791
- if @target_release
792
- ostring += "--target-release " + @target_release
793
- end
795
+ if @target_release
796
+ ostring += "--target-release " + @target_release
797
+ end
794
798
 
795
- if @default_release
796
- ostring += "--default-release " + @default_release
797
- end
799
+ if @default_release
800
+ ostring += "--default-release " + @default_release
801
+ end
798
802
 
799
- if @list_cleanup
800
- ostring += "--list-cleanup "
801
- end
803
+ if @list_cleanup
804
+ ostring += "--list-cleanup "
805
+ end
802
806
 
803
- if @reinstall
804
- ostring += "--reinstall "
805
- end
807
+ if @reinstall
808
+ ostring += "--reinstall "
809
+ end
806
810
 
807
- if @purge
808
- ostring += "--purge "
809
- end
811
+ if @purge
812
+ ostring += "--purge "
813
+ end
810
814
 
811
- if @print_uris
812
- ostring += "--print-uris "
813
- end
815
+ if @print_uris
816
+ ostring += "--print-uris "
817
+ end
814
818
 
815
- if @force_yes
816
- ostring += "--force-yes "
817
- end
819
+ if @force_yes
820
+ ostring += "--force-yes "
821
+ end
818
822
 
819
- if @only_upgrade
820
- ostring += "--only-upgrade "
821
- end
823
+ if @only_upgrade
824
+ ostring += "--only-upgrade "
825
+ end
822
826
 
823
- if @no_upgrade
824
- ostring += "--no-upgrade "
825
- end
827
+ if @no_upgrade
828
+ ostring += "--no-upgrade "
829
+ end
826
830
 
827
- if @ignore_hold
828
- ostring += "--ignore-hold "
829
- end
831
+ if @ignore_hold
832
+ ostring += "--ignore-hold "
833
+ end
830
834
 
831
- if @no_install_recommends
832
- ostring += "--no-install-recommends "
833
- end
835
+ if @no_install_recommends
836
+ ostring += "--no-install-recommends "
837
+ end
834
838
 
835
- if @install_recommends
836
- ostring += "--install-recommends "
837
- end
839
+ if @install_recommends
840
+ ostring += "--install-recommends "
841
+ end
838
842
 
839
- if @compile
840
- ostring += "--compile "
841
- end
843
+ if @compile
844
+ ostring += "--compile "
845
+ end
842
846
 
843
- if @build
844
- ostring += "--build "
845
- end
847
+ if @build
848
+ ostring += "--build "
849
+ end
846
850
 
847
- if @verbose_versions
848
- ostring += "--verbose-versions "
849
- end
851
+ if @verbose_versions
852
+ ostring += "--verbose-versions "
853
+ end
850
854
 
851
- if @show_upgraded
852
- ostring += "--show-upgraded "
853
- end
855
+ if @show_upgraded
856
+ ostring += "--show-upgraded "
857
+ end
854
858
 
855
- if @yes
856
- ostring += "--yes "
857
- end
859
+ if @yes
860
+ ostring += "--yes "
861
+ end
858
862
 
859
- if @assume_yes
860
- ostring += "--assume-yes "
861
- end
863
+ if @assume_yes
864
+ ostring += "--assume-yes "
865
+ end
862
866
 
863
- if @simulate
864
- ostring += "--simulate "
865
- end
867
+ if @simulate
868
+ ostring += "--simulate "
869
+ end
866
870
 
867
- if @just_print
868
- ostring += "--just-print "
869
- end
871
+ if @just_print
872
+ ostring += "--just-print "
873
+ end
870
874
 
871
- if @dry_run
872
- ostring += "--dry-run "
873
- end
875
+ if @dry_run
876
+ ostring += "--dry-run "
877
+ end
874
878
 
875
- if @recon
876
- ostring += "--recon "
877
- end
879
+ if @recon
880
+ ostring += "--recon "
881
+ end
878
882
 
879
- if @no_act
880
- ostring += "--no-act "
881
- end
883
+ if @no_act
884
+ ostring += "--no-act "
885
+ end
882
886
 
883
- if @quiet
884
- ostring += "--quiet " + @quiet
885
- end
887
+ if @quiet
888
+ ostring += "--quiet " + @quiet
889
+ end
886
890
 
887
- if @no_download
888
- ostring += "--no-download "
889
- end
891
+ if @no_download
892
+ ostring += "--no-download "
893
+ end
890
894
 
891
- if @ignore_missing
892
- ostring += "--ignore-missing "
893
- end
895
+ if @ignore_missing
896
+ ostring += "--ignore-missing "
897
+ end
894
898
 
895
- if @fix_missing
896
- ostring += "--fix-missing "
897
- end
899
+ if @fix_missing
900
+ ostring += "--fix-missing "
901
+ end
898
902
 
899
- if @fix_broken
900
- ostring += "--fix-broken "
901
- end
903
+ if @fix_broken
904
+ ostring += "--fix-broken "
905
+ end
902
906
 
903
- if @download_only
904
- ostring += "--download-only "
905
- end
907
+ if @download_only
908
+ ostring += "--download-only "
909
+ end
906
910
 
907
- return ostring
911
+ return ostring
908
912
 
913
+ end
909
914
  end
910
915
  end
911
-
912
-
913
- #Dir[File.join(File.dirname(__FILE__), 'raptget/**/*.rb')].sort.each { |lib| require lib }
914
-