Lines Matching full:package
4 generic, with implementations that deal with different package managers, such
18 # As more package methods are implemented, this list grows up
25 RPM package file
26 - type: Package management program that handles the file
27 - system_support: If the package management program is installed on the
29 - source: If it is a source (True) our binary (False) package
30 - version: The package version (or name), that is used to check against the
31 package manager if the package is installed
32 - arch: The architecture for which a binary package was built
33 - installed: Whether the package is installed (True) on the system or not
37 # package :)
43 # Build the command strings that will be used to get package info
44 # s_cmd - Command to determine if package is a source package
45 # a_cmd - Command to determine package architecture
46 # v_cmd - Command to determine package version
47 # i_cmd - Command to determiine if package is installed
54 # Checking whether this is a source or src package
62 # Checking if package is installed
77 # Figure if package is a source package
89 # Figure if package is a source package
111 dpkg package file
112 - type: Package management program that handles the file
113 - system_support: If the package management program is installed on the
115 - source: If it is a source (True) our binary (False) package
116 - version: The package version (or name), that is used to check against the
117 package manager if the package is installed
118 - arch: The architecture for which a binary package was built
119 - installed: Whether the package is installed (True) on the system or not
123 # package :)
127 # There's no single debian source package as is the case
132 # Build the command strings that will be used to get package info
133 # a_cmd - Command to determine package architecture
134 # v_cmd - Command to determine package version
135 # i_cmd - Command to determiine if package is installed
137 v_cmd = 'dpkg -f ' + dpkg_package + ' Package 2>/dev/null'
143 # Checking if package is installed
181 def info(package): argument
183 Returns a dictionary with package information about a given package file:
184 - type: Package management program that handles the file
185 - system_support: If the package management program is installed on the
187 - source: If it is a source (True) our binary (False) package
188 - version: The package version (or name), that is used to check against the
189 package manager if the package is installed
190 - arch: The architecture for which a binary package was built
191 - installed: Whether the package is installed (True) on the system or not
194 Implemented package types:
195 - 'dpkg' - dpkg (debian, ubuntu) package files
196 - 'rpm' - rpm (red hat, suse) package files
197 Raises an exception if the package type is not one of the implemented
198 package types.
200 if not os.path.isfile(package):
201 raise ValueError('invalid file %s to verify' % package)
202 # Use file and libmagic to determine the actual package file type.
203 file_result = utils.system_output('file ' + package)
213 return _rpm_info(package)
215 return _dpkg_info(package)
217 # If it's not one of the implemented package manager methods, there's
219 raise error.PackageError('Unknown package type %s' % file_result)
222 def install(package, nodeps = False): argument
224 Tries to install a package file. If the package is already installed,
226 true, it will ignore package dependencies.
228 my_package_info = info(package)
235 e_msg = ('Client does not have package manager %s to handle %s install'
236 % (type, package))
243 install_command = 'rpm %s -U %s' % (opt_args, package)
247 install_command = 'dpkg %s -i %s' % (opt_args, package)
252 return 'Package %s is already installed' % package
255 # unmet dependencies for the package. We won't cover this case, at
258 return 'Package %s was installed successfuly' % package
261 def convert(package, destination_format): argument
265 returns: filename of the package generated.
274 # convertions only for the implemented package types.
278 % package)
283 % package)
289 print('Package %s successfuly converted to %s' % \
290 (os.path.basename(package), os.path.basename(converted_package)))
296 Returns a dictionary with host os package support info: