r37056 - in /trunk/libsyntax-highlight-engine-simple-languages-perl/debian: packages.cfg refresh.pl watch.in
bremner-guest at users.alioth.debian.org
bremner-guest at users.alioth.debian.org
Mon Jun 1 00:53:31 UTC 2009
Author: bremner-guest
Date: Mon Jun 1 00:53:27 2009
New Revision: 37056
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=37056
Log:
update refresh.pl to be more configurable with respect to
substitution. Support debian/watch.
Added:
trunk/libsyntax-highlight-engine-simple-languages-perl/debian/watch.in
Modified:
trunk/libsyntax-highlight-engine-simple-languages-perl/debian/packages.cfg
trunk/libsyntax-highlight-engine-simple-languages-perl/debian/refresh.pl
Modified: trunk/libsyntax-highlight-engine-simple-languages-perl/debian/packages.cfg
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsyntax-highlight-engine-simple-languages-perl/debian/packages.cfg?rev=37056&op=diff
==============================================================================
--- trunk/libsyntax-highlight-engine-simple-languages-perl/debian/packages.cfg (original)
+++ trunk/libsyntax-highlight-engine-simple-languages-perl/debian/packages.cfg Mon Jun 1 00:53:27 2009
@@ -1,8 +1,9 @@
-# -*- Debian-control-mode -*-
+# -*- Debian-control -*-
Module: Syntax-Highlight-Engine-Simple-Perl
Author: Sugama Keita <sugama at jamadam.com>
Description: syntax highlighting for Perl
+Upstream-Version: 0.2
Watch: http://search.cpan.org/CPAN/authors/id/J/JA/JAMADAM/Syntax-Highlight-Engine-Simple-Perl-([\d.]+).tar.gz
Copyright: © 2008, Sugama Keita <sugama at jamadam.com>.
License: Perl
@@ -12,7 +13,8 @@
Module: Syntax-Highlight-Engine-Simple-HTML
Author: Sugama Keita <sugama at jamadam.com>
Description: syntax highlighting for HTML
-Watch: http://search.cpan.org/CPAN/authors/id/J/JA/JAMADAM/Syntax-Highlight-Engine-Simple-Perl-([\d.]+).tar.gz
+Upstream-Version: 0.2
+Watch: http://search.cpan.org/CPAN/authors/id/J/JA/JAMADAM/Syntax-Highlight-Engine-Simple-HTML-([\d.]+).tar.gz
Copyright: © 2008, Sugama Keita <sugama at jamadam.com>.
License: Perl
This program is free software, you can redistribute it and/or modify it under
Modified: trunk/libsyntax-highlight-engine-simple-languages-perl/debian/refresh.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsyntax-highlight-engine-simple-languages-perl/debian/refresh.pl?rev=37056&op=diff
==============================================================================
--- trunk/libsyntax-highlight-engine-simple-languages-perl/debian/refresh.pl (original)
+++ trunk/libsyntax-highlight-engine-simple-languages-perl/debian/refresh.pl Mon Jun 1 00:53:27 2009
@@ -5,24 +5,30 @@
use Parse::DebControl;
use File::Slurp;
-my @infiles=qw(debian/copyright.in debian/control.in);
+my $header="# Generated by refresh.pl from debian/packages.cfg. Edits may be lost.\n";
+my %xform=(
+ 'debian/copyright.in'=>{'#COPYRIGHT_STANZAS#'=>\©right_stanzas},
+ 'debian/control.in'=> {'#MODULE_DESC_LIST#'=>\&module_desc_list},
+ 'debian/watch.in'=> {'#WATCH_LIST#'=>\&watch_list}
+);
my $parser=new Parse::DebControl;
my $pkgconf=$parser->parse_file("debian/packages.cfg",
{useTieIxHash=>1,stripComments=>1}) || die "parser failed: $!";
-my $module_desc_list=make_module_desc_list($pkgconf);
-my $copyright_stanzas=make_copyright_stanzas($pkgconf);
+for my $file (keys %xform) {
-for my $file (@infiles) {
- my $content=read_file($file);
- my $outfile= $file;
- $outfile =~ s/\.in$//;
-
- $content=~ s/#MODULE_DESC_LIST#/$module_desc_list/;
- $content=~ s/#COPYRIGHT_STANZAS#/$copyright_stanzas/;
+ my %subst=%{$xform{$file}};
+ my $content=$header . read_file($file);
+ for my $token (keys %subst){
+ my $val=&{$subst{$token}};
+ $content=~s/$token/$val/;
+ }
- write_file($outfile,$content);
+ my $outfile= $file;
+
+ $outfile =~ s/\.in$//;
+ write_file($outfile,$content);
}
sub short_desc($){
@@ -31,15 +37,18 @@
$desc=~s/\n.*//;
return $desc;
}
-sub make_copyright_stanzas($){
- my @modules=@{shift()};
- my @list=map { $parser->write_mem($_); } @modules;
+sub copyright_stanzas{
+ my @list=map { $parser->write_mem($_); } @{$pkgconf};
return join("\n\n", at list);
}
-sub make_module_desc_list($){
- my @modules=@{shift()};
- my @list=map {" * ". $_->{Module} . " (". short_desc($_) .")" } @modules;
+sub watch_list{
+ my @list=map {$_->{Watch} . " ". $_->{'Upstream-Version'} } @{$pkgconf};
+ return join("\n", at list);
+}
+
+sub module_desc_list{
+ my @list=map {" * ". $_->{Module} . " (". short_desc($_) .")" } @{$pkgconf};
return join("\n", at list);
}
Added: trunk/libsyntax-highlight-engine-simple-languages-perl/debian/watch.in
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsyntax-highlight-engine-simple-languages-perl/debian/watch.in?rev=37056&op=file
==============================================================================
--- trunk/libsyntax-highlight-engine-simple-languages-perl/debian/watch.in (added)
+++ trunk/libsyntax-highlight-engine-simple-languages-perl/debian/watch.in Mon Jun 1 00:53:27 2009
@@ -1,0 +1,4 @@
+# format version number, currently 3; this line is compulsory!
+version=3
+#WATCH_LIST#
+
More information about the Pkg-perl-cvs-commits
mailing list