r47900 - in /people/ansgar/source-v3/libcatalyst-modules-perl/debian: README.source check-upstream-versions patches/ rename-tarballs
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Nov 29 06:41:50 UTC 2009
Author: ansgar-guest
Date: Sun Nov 29 06:41:38 2009
New Revision: 47900
URL: http://svn.debian.org/wsvn/?sc=1&rev=47900
Log:
* add download option to check-upstream-versions
* add some documentation to debian/README.source
* renaming all the tarballs via debian/rename-tarballs
Added:
people/ansgar/source-v3/libcatalyst-modules-perl/debian/README.source
people/ansgar/source-v3/libcatalyst-modules-perl/debian/rename-tarballs
Removed:
people/ansgar/source-v3/libcatalyst-modules-perl/debian/patches/
Modified:
people/ansgar/source-v3/libcatalyst-modules-perl/debian/check-upstream-versions
Added: people/ansgar/source-v3/libcatalyst-modules-perl/debian/README.source
URL: http://svn.debian.org/wsvn/people/ansgar/source-v3/libcatalyst-modules-perl/debian/README.source?rev=47900&op=file
==============================================================================
--- people/ansgar/source-v3/libcatalyst-modules-perl/debian/README.source (added)
+++ people/ansgar/source-v3/libcatalyst-modules-perl/debian/README.source Sun Nov 29 06:41:38 2009
@@ -1,0 +1,35 @@
+Updating the version number
+---------------------------
+
+After changing the version number in debian/changelog, you have to rename the
+*.orig.tar.gz files. The command
+ sh debian/rename-tarballs <old-version> <new-version>
+will do this for you. If you omit the version numbers, the script will take
+the versions from the two most recent changelog entries.
+
+Updating a module
+-----------------
+
+Run
+ perl debian/check-upstream-versions
+to see a list of modules that need to be updated.
+
+In order to update a new module, first make sure that no patches are currently
+applied and then run the command
+ perl debian/check-upstream-versions download <module>
+This should download the newest upstream release for <module> and extract it.
+
+If the dependencies change, you might have to edit debian/module-list.
+
+Adding a new module
+-------------------
+
+Add the new module to debian/packages.cfg, then download the latest release by
+ perl debian/check-upstream-versions download <module>
+
+Then update debian/copyright and the package description in debian/control with
+ perl debian/check-upstream-versions control
+
+Finally add the new module to debian/module-list after all modules the new module
+depends on.
+
Modified: people/ansgar/source-v3/libcatalyst-modules-perl/debian/check-upstream-versions
URL: http://svn.debian.org/wsvn/people/ansgar/source-v3/libcatalyst-modules-perl/debian/check-upstream-versions?rev=47900&op=diff
==============================================================================
--- people/ansgar/source-v3/libcatalyst-modules-perl/debian/check-upstream-versions (original)
+++ people/ansgar/source-v3/libcatalyst-modules-perl/debian/check-upstream-versions Sun Nov 29 06:41:38 2009
@@ -11,6 +11,7 @@
use Text::SimpleTable;
use Text::Wrap;
use YAML::Any ();
+use Dpkg::Changelog::Parse qw/changelog_parse/;
$Text::Wrap::columns = 78;
$Text::Wrap::separator = "\n ";
@@ -192,6 +193,7 @@
{
my ($modules, $config) = @_;
my @urls = ();
+ my @updates = ();
my $table = Text::SimpleTable->new([50, 'Module'], [10, 'Debian'], [10, 'Upstream'], [30, 'Comment']);
@@ -206,6 +208,7 @@
if ($current_version < $upstream_version)
{
$comment = "new upstream version!";
+ push @updates, $module;
push @urls, qq{$upstream_link};
}
$table->row($module, $current_version, $upstream_version, $comment);
@@ -219,6 +222,32 @@
print $url."\n";
}
}
+ if (scalar @updates) {
+ print "perl debian/check-upstream-versions download $_\n" for @updates;
+ }
+}
+
+sub download($$)
+{
+ my ($module, $config) = @_;
+
+ my ($upstream_version, $upstream_link) = get_upstream_module_version($config, $module);
+ my $changelog = changelog_parse();
+ my $package_source = $changelog->{source};
+ my $package_version = $changelog->{version};
+ my $file = "../${package_source}_${package_version}.orig-$module.tar.gz";
+
+ print "Will download $module $upstream_version: $upstream_link -> $file\n";
+ getstore($upstream_link, $file);
+
+ print "Remove old $module...\n";
+ (system "rm", "-rf", $module) == 0
+ or die "removing old module failed.";
+
+ print "Extracting new $module...\n";
+ mkdir $module;
+ (system "tar", "--strip=1", "-C", $module, "-xzvf", $file) == 0
+ or die "extracting new module failed.";
}
if (defined($ARGV[0]))
@@ -229,6 +258,15 @@
my @f = sort(bsd_glob('[A-Z]*'));
control( \@f, \%cfg );
}
+ elsif ($ARGV[0] eq 'download')
+ {
+ my $module = $ARGV[1];
+ unless (defined $module) {
+ print STDERR "No module to download.\n";
+ exit 1;
+ }
+ download($module, \%cfg);
+ }
}
else
{
Added: people/ansgar/source-v3/libcatalyst-modules-perl/debian/rename-tarballs
URL: http://svn.debian.org/wsvn/people/ansgar/source-v3/libcatalyst-modules-perl/debian/rename-tarballs?rev=47900&op=file
==============================================================================
--- people/ansgar/source-v3/libcatalyst-modules-perl/debian/rename-tarballs (added)
+++ people/ansgar/source-v3/libcatalyst-modules-perl/debian/rename-tarballs Sun Nov 29 06:41:38 2009
@@ -1,0 +1,35 @@
+#! /bin/sh
+set -e
+
+package=libcatalyst-modules-perl
+
+usage() {
+ echo >&2 "usage: sh debian/rename-tarballs <old-version> <new-version>"
+ echo >&2 "will rename the tarballs from *_<old-version>.orig* to *_<new-version>.orig*"
+
+ exit ${1+0}
+}
+
+if [ $# = 2 ] ; then
+ old="$1"
+ new="$2"
+elif [ $# = 0 ] ; then
+ old=$( dpkg-parsechangelog -o1 -n1 | awk '/^Version: / { print $2 }' )
+ new=$( dpkg-parsechangelog -n1 | awk '/^Version: / { print $2 }' )
+
+ if [ ! -f ../${package}_$old.orig.tar.gz ] ; then
+ echo >&2 "../${package}_$old.orig.tar.gz not found."
+ exit 1
+ fi
+elif [ x"$1" = x-h -o x"$1" = x--help -o x"$1" = xhelp ] ; then
+ usage 0
+else
+ usage 1
+fi
+
+for f in ../${package}_$old.orig* ; do
+ newf=$( echo "$f" | sed "s,^../${package}_$old,../${package}_$new," )
+ echo mv --no-clobber $f $newf
+ mv --no-clobber $f $newf
+done
+
More information about the Pkg-perl-cvs-commits
mailing list