New template __INCLUDEFILE directive. patch sent upstream

This commit is contained in:
Cherry G. Mathew 2007-12-25 23:16:41 +00:00 committed by Thomas Klausner
parent e6f41f01d3
commit 89f9e6f1be
3 changed files with 28 additions and 3 deletions

View file

@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.3 2007/09/20 22:30:08 thomasklausner Exp $
# $NetBSD: Makefile,v 1.4 2007/12/25 23:16:41 cherrymathew Exp $
#
DISTNAME= uffizi.txt
PKGNAME= uffizi-0.5
CATEGORIES= www graphics perl5
MASTER_SITES= http://jmason.org/software/uffizi/
EXTRACT_SUFX= #
EXTRACT_SUFX= #
MAINTAINER= cherrymathew@users.sourceforge.net
HOMEPAGE= http://jmason.org/software/uffizi/

View file

@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.1 2007/07/27 18:33:11 cherrymathew Exp $
$NetBSD: distinfo,v 1.2 2007/12/25 23:16:41 cherrymathew Exp $
SHA1 (uffizi.txt) = 205a893b3c6483954afd62febe93728b23418169
RMD160 (uffizi.txt) = 0569899bdc3d2bbe30a717c95e7427f8a3303b69
Size (uffizi.txt) = 37302 bytes
SHA1 (patch-aa) = bb0df8809bf31294f70a4831d1e4257b9c37647c

24
uffizi/patches/patch-aa Normal file
View file

@ -0,0 +1,24 @@
$NetBSD: patch-aa,v 1.1 2007/12/25 23:16:41 cherrymathew Exp $
--- uffizi.txt.orig 2007-12-25 22:13:52.000000000 +0000
+++ uffizi.txt
@@ -1014,12 +1014,19 @@ sub myimgsize {
}
}
+sub include_file {
+ my ($filename) = @_;
+ open (IN, "<$filename") || die "Template error: could not find file included with __INCLUDEFILE:$filename";
+ my $contents = join ('', <IN>); close IN;
+ return $contents;
+}
sub fill_tmpl {
my ($tmpl, $opts) = @_;
my $out = $tmpl;
1 while $out =~ s!__TEMPLATE:([_a-zA-Z0-9]+)__! $template{$1} !xgs;
+ 1 while $out =~ s!__INCLUDEFILE:[\"\']([_a-zA-Z0-9\./]+)[\"\']! include_file ($1); !xgse;
# conditionals
if ($out =~ /<__COND_IF_/) {