From e10b2cf931a5c935c3adf677ca5b2e10661a3ead Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 12 Nov 2007 21:40:36 -0800 Subject: [PATCH] * Document how to create the estraier database in add_bug_to_estraier * Start using Safe::Hole to tunnel the bits we need to the safe module --- Debbugs/Text.pm | 15 +++++++++++++-- Makefile | 7 +++++++ bin/add_bug_to_estraier | 6 ++++++ debian/control | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Debbugs/Text.pm b/Debbugs/Text.pm index 9a06510..bc1363b 100644 --- a/Debbugs/Text.pm +++ b/Debbugs/Text.pm @@ -74,6 +74,7 @@ fills the template in. our %tt_templates; our %filled_templates; our $safe; +our $hole; our $language; sub fill_in_template{ my %param = validate_with(params => \@_, @@ -90,9 +91,12 @@ sub fill_in_template{ safe => {type => OBJECT, optional => 1, }, + hole_var => {type => HASHREF, + optional => 1, + }, }, ); - return _fill_in_template(@param{qw(template variables language safe output)}); + return _fill_in_template(@param{qw(template variables language safe output hole_var)}); } @@ -109,6 +113,7 @@ sub include { $language, $safe, undef, + {}, 1 ); }; @@ -123,7 +128,7 @@ sub include { sub _fill_in_template{ my %param; - @param{qw(template variables language safe output nosafe)} = @_; + @param{qw(template variables language safe output hole_var no_safe)} = @_; print STDERR "_fill template $param{template} language $param{language} safe $param{safe}\n" if $DEBUG; @@ -149,6 +154,9 @@ sub _fill_in_template{ if (defined $param{safe}) { $safe = $param{safe}; + if (not defined $hole) { + $hole = Safe::Hole->new(); + } } else { print STDERR "Created new safe\n" if $DEBUG; @@ -193,6 +201,9 @@ sub _fill_in_template{ ${"${root}::$key"} = $param{variables}{$key}; } } + for my $key (keys %{$param{hole_var}||{}}) { + $hole->wrap($param{hole_var}{$key},$safe,$key); + } } #$safe->deny_only(); # perldoc Opcode; for details diff --git a/Makefile b/Makefile index 4dad840..0fdfa0c 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ var_dir := $(DESTDIR)/var/lib/debbugs scripts_dir := $(DESTDIR)/usr/lib/debbugs perl_dir := $(DESTDIR)/usr/share/perl5/Debbugs doc_dir := $(DESTDIR)/usr/share/doc/debbugs +templates_dir := $(DESTDIR)/usr/share/debbugs/templates man_dir := $(DESTDIR)/usr/share/man man8_dir := $(man_dir)/man8 examples_dir := $(doc_dir)/examples @@ -45,6 +46,7 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ for dir in $(shell seq -w 00 99); \ do test -d $$dir || $(install_exec) -d $$dir; done + # install the scripts $(foreach script,$(scripts_in), $(install_exec) $(script) $(scripts_dir)/$(patsubst scripts/%.in,%,$(script));) $(install_data) scripts/errorlib.in $(scripts_dir)/errorlib @@ -83,4 +85,9 @@ $(var_dir)/spool/db-h $(scripts_dir) $(perl_dir) $(examples_dir) $(man8_dir); \ # install the updateseqs file $(install_data) misc/updateseqs $(var_dir)/spool + # install the templates + $(foreach dir $(wildcard templates/*/*) $(install_exec) $(template_dir)/$(patsubst templates/%,%,$(dir))) + $(foreach tmpl $(wildcard templates/*/*/*.tmpl) $(install_data) $(template_dir)/$(patsubst templates/%,%,$(tmpl))) + + .PHONY: test \ No newline at end of file diff --git a/bin/add_bug_to_estraier b/bin/add_bug_to_estraier index f6d0cd5..0acfbab 100755 --- a/bin/add_bug_to_estraier +++ b/bin/add_bug_to_estraier @@ -81,6 +81,12 @@ Display this manual. test_bts --bug 7 --host donbugs.donarmstrong.com +=head1 DATABASE CREATION + +estcmd create -si -xh3 -attr status str -attr subject str \ + -attr date num -attr submitter str -attr package str \ + -attr severity str -attr tags str bts + =cut diff --git a/debian/control b/debian/control index 71f04c9..5b15eb5 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: extra Maintainer: Debbugs developers Uploaders: Josip Rodin , Colin Watson , Don Armstrong Standards-Version: 3.2.1 -Build-Depends-Indep: debhelper, libparams-validate-perl, libmailtools-perl, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libhttp-server-simple-perl, libtest-www-mechanize-perl, libmail-rfc822-address-perl +Build-Depends-Indep: debhelper, libparams-validate-perl, libmailtools-perl, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libhttp-server-simple-perl, libtest-www-mechanize-perl, libmail-rfc822-address-perl, libsafe-hole-perl Package: debbugs Architecture: all @@ -24,7 +24,7 @@ Description: The bug tracking system based on the active Debian BTS Package: libdebbugs-perl Architecture: all -Depends: ${perl:Depends}, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libparams-validate-perl, libtext-template-perl +Depends: ${perl:Depends}, libmailtools-perl, ed, libmime-perl, libio-stringy-perl, libmldbm-perl, liburi-perl, libsoap-lite-perl, libcgi-simple-perl, libparams-validate-perl, libtext-template-perl, libsafe-hole-perl Description: modules used by the active Debian BTS Debian has a bug tracking system which files details of bugs reported by users and developers. Each bug is given a number, and is kept on file until -- 2.39.2