]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Document how to create the estraier database in add_bug_to_estraier
authorDon Armstrong <don@donarmstrong.com>
Tue, 13 Nov 2007 05:40:36 +0000 (21:40 -0800)
committerDon Armstrong <don@donarmstrong.com>
Tue, 13 Nov 2007 05:40:36 +0000 (21:40 -0800)
 * Start using Safe::Hole to tunnel the bits we need to the safe module

Debbugs/Text.pm
Makefile
bin/add_bug_to_estraier
debian/control

index 9a06510dc491843189575cfd032febfc76c048af..bc1363b648b0a6bf3f8f59e3867f5e41e670d9eb 100644 (file)
@@ -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
index 4dad84022d0ac0b5829d19fcad034a8093d784cc..0fdfa0c06755b617617f8c90c02981a400cc87d5 100644 (file)
--- 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
index f6d0cd51a5fe16a7be82ff4a49a899e6dc565d1e..0acfbab705018b1f29587f9159790e4b2926ff8e 100755 (executable)
@@ -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
 
index 71f04c9a2179b36851a99d2e37fd3384f1801daa..5b15eb5218761408220ec75fe4304d88e6608a3b 100644 (file)
@@ -4,7 +4,7 @@ Priority: extra
 Maintainer: Debbugs developers <debian-debbugs@lists.debian.org>
 Uploaders: Josip Rodin <joy-packages@debian.org>, Colin Watson <cjwatson@debian.org>, Don Armstrong <don@debian.org>
 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