diff --git a/TODO b/TODO index ef6b32f..4c67124 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,5 @@ * Planned features (as of 2005-09-19): - - Download from CPAN automatically when executed as "cpanspec Foo::Bar". - + DONE! - + Add --download-only or something similar to replace cpanget. - * Add options to filter out Provides/Requires. - Done, but the documentation needs work. diff --git a/cpanget b/cpanget deleted file mode 100755 index 90b39f6..0000000 --- a/cpanget +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh - -set -e - -CPAN=${CPAN:-"http://www.cpan.org"} -packages=$HOME/.cpan/sources/modules/02packages.details.txt.gz - -quiet='' -only_url=0 - -help() { - cat <&2 -curl $quiet -R -z $packages -o $packages $CPAN/modules/$( basename $packages ) - -for module in "$@" ; do - tar=$( zgrep '^'$module' ' $packages | awk '{print $3}' ) - - if [ -z "$tar" ] ; then - echo "Can't find $module, skipping..." >&2 - continue - fi - - if [ $only_url -eq 0 ] ; then - [ -z "$quiet" ] && echo "Fetching $tar..." >&2 - curl $quiet -R \ - -z "$( basename $tar )" \ - -o "$( basename $tar )" \ - $CPAN/authors/id/$tar - else - echo "$module: $CPAN/authors/id/$tar" - fi -done - -# vi: set ai et: diff --git a/cpanspec b/cpanspec index 0cae552..45060eb 100755 --- a/cpanspec +++ b/cpanspec @@ -133,6 +133,10 @@ Disttag (a string to append to the release number), used to differentiate builds for various releases. Defaults to the semi-standard (for Fedora) string C<%{?dist}>. +=item B<-D>, B<--download-only> + +Only download the upstream tarball, do not generate a specfile + =item B<-s>, B<--srpm> Build a source rpm from the generated spec file. @@ -231,6 +235,7 @@ our $packager; our $release=1; our $epoch; our $disttag='%{?dist}'; +our $download_only=0; our $buildsrpm=0; our $buildrpm=0; our $verbose=0; @@ -549,6 +554,7 @@ GetOptions( 'release|r=i' => \$release, 'epoch|e=i' => \$epoch, 'disttag|d=s' => \$disttag, + 'download-only|D' => \$download_only, 'srpm|s' => \$buildsrpm, 'build|b' => \$buildrpm, 'cpan|c=s' => \$cpan, @@ -640,6 +646,7 @@ for my $file (@args) { $source=$cpan . "/authors/id/" . $d->prefix(); $file=basename($d->filename()); fetch($source, $file); + next if $download_only; $name=$d->dist(); $version=$d->version(); $version=~s/^v\.?//;