Youri::Package::RPM::Updater - Update RPM packages
my $updater = Youri::Package::RPM::Updater->new(); $updater->update_from_source('foo-1.0-1.src.rpm', '2.0'); $updater->update_from_spec('foo.spec', '2.0'); $updater->update_from_repository('foo', '2.0');
This module updates rpm packages. When given an explicit new version, it updates the spec file, and downloads new sources automatically. When not given a new version, it just updates the spec file.
Warning, not every spec file syntax is supported. If you use specific syntax, you'll have to ressort to additional processing with explicit perl expression to evaluate for each line of the spec file.
Here is version update algorithm (only used when building a new version):
find the first definition of version
replace it with new value
Here is release update algorithm:
find the first definition of release
if explicit newrelease parameter given:
replace value
otherwise:
extract any macro occuring in the leftmost part (such as %mkrel)
extract any occurence of release_suffix option in the rightmost part
if a new version is given:
replace with 1
increment by 1
In both cases, both direct definition:
Version: X
or indirect definition:
%define version X Version: %{version}
are supported. Any more complex one is not.
The following YAML-format configuration files are used:
Allowed directives are the same as new method options.
Julien Danjou <danjou@mandriva.com>
Michael Scherer <misc@mandriva.org>
Guillaume Rousse <guillomovitch@mandriva.org>
Copyright (c) 2003-2007 Mandriva.
Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.
Creates and returns a new MDV::RPM::Updater object.
Available options:
verbosity level (default: 0).
check new version is really new before updating spec file (default: true).
rpm top-level directory (default: rpm %_topdir macro).
rpm source directory (default: rpm %_sourcedir macro).
suffix appended to numerical value in release tag. (default: none).
list of directories containing source packages (default: empty).
timeout for file downloads (default: 10)
user agent for file downloads (default: youri-package-updater/$VERSION)
alternate extensions to try when downloading source fails (default: tar.gz, tgz, zip)
mirrors to try when downloading files hosted on sourceforge (default: ovh, mesh, switch)
list of rewrite rules to apply on source tag value for computing source URL when the source is a local file, as hashes of two regexeps
hash of lists of accepted content types when downloading archive files, indexed by archive extension
changelog message for new version (default: New version %%VERSION)
changelog message for new release (default: Rebuild)
Update package with name $name to version $version.
Force package release, instead of computing it.
download new sources (default: true).
update spec file revision (release/history) (default: true).
update spec file changelog (default: true).
callback to execute as filter for each spec file line (default: none).
perl expression (or list of expressions) to evaluate for each spec file line (default: none). Takes precedence over previous option.
list of changelog entries (default: empty).
Update package with source file $source to version $version.
See update_from_repository() for available options.
Update package with spec file $spec to version $version.
To install Youri::Package::RPM::Updater, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Youri::Package::RPM::Updater
CPAN shell
perl -MCPAN -e shell install Youri::Package::RPM::Updater
For more information on module installation, please visit the detailed CPAN module installation guide.