From 2ccb07fad36f22485c4750c96e5177e35cf81aed Mon Sep 17 00:00:00 2001 From: stevenpritchard Date: Mon, 15 May 2006 23:32:46 +0000 Subject: [PATCH] Add --epoch option. --- Changes | 1 + cpanspec | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 685d165..decad5a 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ * Fix $summary modification. * Strip leading [Vv]\.? from spec Version. +* Add --epoch option. 1.65 2006-04-26 diff --git a/cpanspec b/cpanspec index a6455c5..4f20bfe 100755 --- a/cpanspec +++ b/cpanspec @@ -10,7 +10,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: cpanspec,v 1.24 2006/05/05 22:01:04 stevenpritchard Exp $ +# $Id: cpanspec,v 1.25 2006/05/15 23:32:46 stevenpritchard Exp $ our $NAME="cpanspec"; our $VERSION='1.66'; @@ -31,6 +31,7 @@ cpanspec [options] [file [...]] --force -f Force overwriting existing spec --packager -p Name and email address of packager (for changelog) --release -r Release of package (defaults to 1) + --epoch -e Epoch of package --disttag -d Disttag (defaults to %{?dist}) --srpm -s Build a source rpm --build -b Build source and binary rpms @@ -109,6 +110,11 @@ macro in C<~/.rpmmacros>. The release number of the package. Defaults to 1. +=item B<-e>, B<--epoch> + +The epoch number of the package. By default, this is undefined, so +no epoch will be used in the generated spec. + =item B<-d>, B<--disttag> Disttag (a string to append to the release number), used to @@ -200,6 +206,7 @@ our $noprefix=0; our $force=0; our $packager; our $release=1; +our $epoch; our $disttag='%{?dist}'; our $buildsrpm=0; our $buildrpm=0; @@ -443,6 +450,7 @@ GetOptions( 'force|f' => \$force, 'packager|p=s' => \$packager, 'release|r=i' => \$release, + 'epoch|e=i' => \$epoch, 'disttag|d=s' => \$disttag, 'srpm|s' => \$buildsrpm, 'build|b' => \$buildrpm, @@ -788,6 +796,11 @@ for my $file (@ARGV) { Name: $prefix$name Version: $packageversion Release: $release$disttag +END + + print $spec "Epoch: $epoch\n" if (defined($epoch)); + + print $spec <