]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/Config.pm
add description of maintainer email to Debbugs::Config
[debbugs.git] / Debbugs / Config.pm
1 # This module is part of debbugs, and is released
2 # under the terms of the GPL version 2, or any later
3 # version at your option.
4 # See the file README and COPYING for more information.
5 #
6 # Copyright 2007 by Don Armstrong <don@donarmstrong.com>.
7
8 package Debbugs::Config;
9
10 =head1 NAME
11
12 Debbugs::Config -- Configuration information for debbugs
13
14 =head1 SYNOPSIS
15
16  use Debbugs::Config;
17
18 # to get the compatiblity interface
19
20  use Debbugs::Config qw(:globals);
21
22 =head1 DESCRIPTION
23
24 This module provides configuration variables for all of debbugs.
25
26 =head1 CONFIGURATION FILES
27
28 The default configuration file location is /etc/debbugs/config; this
29 configuration file location can be set by modifying the
30 DEBBUGS_CONFIG_FILE env variable to point at a different location.
31
32 =cut
33
34 use warnings;
35 use strict;
36 use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT $USING_GLOBALS %config);
37 use base qw(Exporter);
38
39 BEGIN {
40      # set the version for version checking
41      $VERSION     = 1.00;
42      $DEBUG = 0 unless defined $DEBUG;
43      $USING_GLOBALS = 0;
44
45      @EXPORT = ();
46      %EXPORT_TAGS = (globals => [qw($gEmailDomain $gListDomain $gWebHost $gWebHostBugDir),
47                                  qw($gWebDomain $gHTMLSuffix $gCGIDomain $gMirrors),
48                                  qw($gPackagePages $gSubscriptionDomain $gProject $gProjectTitle),
49                                  qw($gMaintainer $gMaintainerWebpage $gMaintainerEmail $gUnknownMaintainerEmail),
50                                  qw($gSubmitList $gMaintList $gQuietList $gForwardList),
51                                  qw($gDoneList $gRequestList $gSubmitterList $gControlList),
52                                  qw($gStrongList),
53                                  qw($gPackageVersionRe),
54                                  qw($gSummaryList $gMirrorList $gMailer $gBug),
55                                  qw($gBugs $gRemoveAge $gSaveOldBugs $gDefaultSeverity),
56                                  qw($gShowSeverities $gBounceFroms $gConfigDir $gSpoolDir),
57                                  qw($gIncomingDir $gWebDir $gDocDir $gMaintainerFile),
58                                  qw($gMaintainerFileOverride $gPseudoMaintFile $gPseudoDescFile $gPackageSource),
59                                  qw($gVersionPackagesDir $gVersionIndex $gBinarySourceMap $gSourceBinaryMap),
60                                  qw($gVersionTimeIndex),
61                                  qw($gSendmail $gLibPath $gSpamScan @gExcludeFromControl),
62                                  qw(%gSeverityDisplay @gTags @gSeverityList @gStrongSeverities),
63                                  qw(%gSearchEstraier),
64                                  qw(%gDistributionAliases),
65                                  qw(@gPostProcessall @gRemovalDefaultDistributionTags @gRemovalDistributionTags @gRemovalArchitectures),
66                                  qw(@gRemovalStrongSeverityDefaultDistributionTags),
67                                  qw($gTemplateDir),
68                                 ],
69                      text     => [qw($gBadEmailPrefix $gHTMLTail $gHTMLExpireNote),
70                                  ],
71                      config   => [qw(%config)],
72                     );
73      @EXPORT_OK = ();
74      Exporter::export_ok_tags(qw(globals text config));
75      $EXPORT_TAGS{all} = [@EXPORT_OK];
76 }
77
78 use File::Basename qw(dirname);
79 use IO::File;
80 use Safe;
81
82 =head1 CONFIGURATION VARIABLES
83
84 =head2 General Configuration
85
86 =over
87
88 =cut
89
90 # read in the files;
91 %config = ();
92 # untaint $ENV{DEBBUGS_CONFIG_FILE} if it's owned by us
93 # This enables us to test things that are -T.
94 if (exists $ENV{DEBBUGS_CONFIG_FILE}) {
95      if (${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] = $<) {
96           $ENV{DEBBUGS_CONFIG_FILE} =~ /(.+)/;
97           $ENV{DEBBUGS_CONFIG_FILE} = $1;
98      }
99      else {
100           die "Environmental variable DEBBUGS_CONFIG_FILE set, and $ENV{DEBBUGS_CONFIG_FILE} is not owned by the user running this script.";
101      }
102 }
103 read_config(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config');
104
105 =item email_domain $gEmailDomain
106
107 The email domain of the bts
108
109 =cut
110
111 set_default(\%config,'email_domain','bugs.something');
112
113 =item list_domain $gListDomain
114
115 The list domain of the bts, defaults to the email domain
116
117 =cut
118
119 set_default(\%config,'list_domain',$config{email_domain});
120
121 =item web_host $gWebHost
122
123 The web host of the bts; defaults to the email domain
124
125 =cut
126
127 set_default(\%config,'web_host',$config{email_domain});
128
129 =item web_host_bug_dir $gWebHostDir
130
131 The directory of the web host on which bugs are kept, defaults to C<''>
132
133 =cut
134
135 set_default(\%config,'web_host_bug_dir','');
136
137 =item web_domain $gWebDomain
138
139 Full path of the web domain where bugs are kept, defaults to the
140 concatenation of L</web_host> and L</web_host_bug_dir>
141
142 =cut
143
144 set_default(\%config,'web_domain',$config{web_host}.'/'.$config{web_host_bug_dir});
145
146 =item html_suffix $gHTMLSuffix
147
148 Suffix of html pages, defaults to .html
149
150 =cut
151
152 set_default(\%config,'html_suffix','.html');
153
154 =item cgi_domain $gCGIDomain
155
156 Full path of the web domain where cgi scripts are kept. Defaults to
157 the concatentation of L</web_host> and cgi.
158
159 =cut
160
161 set_default(\%config,'cgi_domain',$config{web_domain}.($config{web_domain}=~m{/$}?'':'/').'cgi');
162
163 =item mirrors @gMirrors
164
165 List of mirrors [What these mirrors are used for, no one knows.]
166
167 =cut
168
169
170 set_default(\%config,'mirrors',[]);
171
172 =item package_pages  $gPackagePages
173
174 Domain where the package pages are kept; links should work in a
175 package_pages/foopackage manner. Defaults to undef, which means that
176 package links will not be made.
177
178 =cut
179
180
181 set_default(\%config,'package_pages',undef);
182
183 =item package_pages  $gUsertagPackageDomain
184
185 Domain where where usertags of packages belong; defaults to $gPackagePages
186
187 =cut
188
189 set_default(\%config,'usertag_package_domain',$config{package_pages});
190
191
192 =item subscription_domain $gSubscriptionDomain
193
194 Domain where subscriptions to package lists happen
195
196 =cut
197
198
199 set_default(\%config,'subscription_domain',undef);
200
201 =back
202
203 =cut
204
205
206 =head2 Project Identification
207
208 =over
209
210 =item project $gProject
211
212 Name of the project
213
214 Default: 'Something'
215
216 =cut
217
218 set_default(\%config,'project','Something');
219
220 =item project_title $gProjectTitle
221
222 Name of this install of Debbugs, defaults to "L</project> Debbugs Install"
223
224 Default: "$config{project} Debbugs Install"
225
226 =cut
227
228 set_default(\%config,'project_title',"$config{project} Debbugs Install");
229
230 =item maintainer $gMaintainer
231
232 Name of the maintainer of this debbugs install
233
234 Default: 'Local DebBugs Owner's
235
236 =cut
237
238 set_default(\%config,'maintainer','Local DebBugs Owner');
239
240 =item maintainer_webpage $gMaintainerWebpage
241
242 Webpage of the maintainer of this install of debbugs
243
244 Default: "$config{web_domain}/~owner"
245
246 =cut
247
248 set_default(\%config,'maintainer_webpage',"$config{web_domain}/~owner");
249
250 =item maintainer_email $gMaintainerEmail
251
252 Email address of the maintainer of this Debbugs install
253
254 Default: 'root@'.$config{email_domain}
255
256 =cut
257
258 set_default(\%config,'maintainer_email','root@'.$config{email_domain});
259
260 =item unknown_maintainer_email
261
262 Email address where packages with an unknown maintainer will be sent
263
264 Default: $config{maintainer_email}
265
266 =back
267
268 =cut
269
270 set_default(\%config,'unknown_maintainer_email',$config{maintainer_email});
271
272 =head2 BTS Mailing Lists
273
274
275 =over
276
277 =item submit_list
278
279 =item maint_list
280
281 =item forward_list
282
283 =item done_list
284
285 =item request_list
286
287 =item submitter_list
288
289 =item control_list
290
291 =item summary_list
292
293 =item mirror_list
294
295 =back
296
297 =cut
298
299 set_default(\%config,   'submit_list',   'bug-submit-list');
300 set_default(\%config,    'maint_list',    'bug-maint-list');
301 set_default(\%config,    'quiet_list',    'bug-quiet-list');
302 set_default(\%config,  'forward_list',  'bug-forward-list');
303 set_default(\%config,     'done_list',     'bug-done-list');
304 set_default(\%config,  'request_list',  'bug-request-list');
305 set_default(\%config,'submitter_list','bug-submitter-list');
306 set_default(\%config,  'control_list',  'bug-control-list');
307 set_default(\%config,  'summary_list',  'bug-summary-list');
308 set_default(\%config,   'mirror_list',   'bug-mirror-list');
309 set_default(\%config,   'strong_list',   'bug-strong-list');
310
311 =head2 Misc Options
312
313 =over
314
315 =cut
316
317 set_default(\%config,'mailer','exim');
318 set_default(\%config,'bug','bug');
319 set_default(\%config,'bugs','bugs');
320
321 =item remove_age
322
323 Age at which bugs are archived/removed
324
325 Default: 28
326
327 =cut
328
329 set_default(\%config,'remove_age',28);
330
331 =item save_old_bugs
332
333 Whether old bugs are saved or deleted
334
335 Default: 1
336
337 =cut
338
339 set_default(\%config,'save_old_bugs',1);
340
341 =item distribution_aliases
342
343 Map of distribution aliases to the distribution name
344
345 Default:
346          {experimental => 'experimental',
347           unstable     => 'unstable',
348           testing      => 'testing',
349           stable       => 'stable',
350           oldstable    => 'oldstable',
351           sid          => 'unstable',
352           lenny        => 'testing',
353           etch         => 'stable',
354           sarge        => 'oldstable',
355          }
356
357 =cut
358
359 set_default(\%config,'distribution_aliases',
360             {experimental => 'experimental',
361              unstable     => 'unstable',
362              testing      => 'testing',
363              stable       => 'stable',
364              oldstable    => 'oldstable',
365              sid          => 'unstable',
366              lenny        => 'testing',
367              etch         => 'stable',
368              sarge        => 'oldstable',
369             },
370            );
371
372
373
374 =item distributions
375
376 List of valid distributions
377
378 Default: The values of the distribution aliases map.
379
380 =cut
381
382 my %_distributions_default;
383 @_distributions_default{values %{$config{distribution_aliases}}} = values %{$config{distribution_aliases}};
384 set_default(\%config,'distributions',[keys %_distributions_default]);
385
386 =item removal_distribution_tags
387
388 Tags which specifiy distributions to check
389
390 Default: @{$config{distributions}}
391
392 =cut
393
394 set_default(\%config,'removal_distribution_tags',
395             [@{$config{distributions}}]);
396
397 =item removal_default_distribution_tags
398
399 For removal/archival purposes, all bugs are assumed to have these tags
400 set.
401
402 Default: qw(unstable testing);
403
404 =cut
405
406 set_default(\%config,'removal_default_distribution_tags',
407             [qw(unstable testing)]
408            );
409
410 =item removal_strong_severity_default_distribution_tags
411
412 For removal/archival purposes, all bugs with strong severity are
413 assumed to have these tags set.
414
415 Default: qw(unstable testing stable);
416
417 =cut
418
419 set_default(\%config,'removal_strong_severity_default_distribution_tags',
420             [qw(unstable testing stable)]
421            );
422
423
424 =item removal_architectures
425
426 For removal/archival purposes, these architectures are consulted if
427 there is more than one architecture applicable. If the bug is in a
428 package not in any of these architectures, the architecture actually
429 checked is undefined.
430
431 Default: qw(i386 amd64 arm ppc sparc alpha);
432
433 =cut
434
435 set_default(\%config,'removal_architectures',
436             [qw(i386 amd64 arm ppc sparc alpha)]
437            );
438
439
440 =item package_name_re
441
442 The regex which will match a package name
443
444 Default: '[a-z0-9][a-z0-9\.+-]+'
445
446 =cut
447
448 set_default(\%config,'package_name_re',
449             '[a-z0-9][a-z0-9\.+-]+');
450
451 =item package_version_re
452
453 The regex which will match a package version
454
455 Default: '[A-Za-z0-9:+\.-]+'
456
457 =cut
458
459 set_default(\%config,'package_version_re',
460             '[A-Za-z0-9:+\.~-]+');
461
462
463 =item control_internal_requester
464
465 This address is used by Debbugs::Control as the request address which
466 sent a control request for faked log messages.
467
468 Default:"Debbugs Internal Request <$config{maintainer_email}>"
469
470 =cut
471
472 set_default(\%config,'control_internal_requester',
473             "Debbugs Internal Request <$config{maintainer_email}>",
474            );
475
476 =item control_internal_request_addr
477
478 This address is used by Debbugs::Control as the address to which a
479 faked log message request was sent.
480
481 Default: "internal_control\@$config{email_domain}";
482
483 =cut
484
485 set_default(\%config,'control_internal_request_addr',
486             'internal_control@'.$config{email_domain},
487            );
488
489
490 =item exclude_from_control
491
492 Addresses which are not allowed to send messages to control
493
494 =cut
495
496 set_default(\%config,'exclude_from_control',[]);
497
498
499
500
501 set_default(\%config,'default_severity','normal');
502 set_default(\%config,'show_severities','critical, grave, normal, minor, wishlist');
503 set_default(\%config,'strong_severities',[qw(critical grave)]);
504 set_default(\%config,'severity_list',[qw(critical grave normal wishlist)]);
505 set_default(\%config,'severity_display',{critical => "Critical $config{bugs}",
506                                          grave    => "Grave $config{bugs}",
507                                          normal   => "Normal $config{bugs}",
508                                          wishlist => "Wishlist $config{bugs}",
509                                         });
510
511 set_default(\%config,'tags',[qw(patch wontfix moreinfo unreproducible fixed),
512                              @{$config{distributions}}
513                             ]);
514
515 set_default(\%config,'bounce_froms','^mailer|^da?emon|^post.*mast|^root|^wpuser|^mmdf|^smt.*|'.
516             '^mrgate|^vmmail|^mail.*system|^uucp|-maiser-|^mal\@|'.
517             '^mail.*agent|^tcpmail|^bitmail|^mailman');
518
519 set_default(\%config,'config_dir',dirname(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config'));
520 set_default(\%config,'spool_dir','/var/lib/debbugs/spool');
521 set_default(\%config,'incoming_dir','incoming');
522 set_default(\%config,'web_dir','/var/lib/debbugs/www');
523 set_default(\%config,'doc_dir','/var/lib/debbugs/www/txt');
524 set_default(\%config,'lib_path','/usr/lib/debbugs');
525
526
527 =item template_dir
528
529 directory of templates; defaults to /usr/share/debbugs/templates.
530
531 =cut
532
533 set_default(\%config,'template_dir','/usr/share/debbugs/templates');
534
535
536 set_default(\%config,'maintainer_file',$config{config_dir}.'/Maintainers');
537 set_default(\%config,'maintainer_file_override',$config{config_dir}.'/Maintainers.override');
538 set_default(\%config,'pseudo_maint_file',$config{config_dir}.'/pseudo-packages.maint');
539 set_default(\%config,'pseudo_desc_file',$config{config_dir}.'/pseudo-packages.description');
540 set_default(\%config,'package_source',$config{config_dir}.'/indices/sources');
541
542
543 =item version_packages_dir
544
545 Location where the version package information is kept; defaults to
546 spool_dir/../versions/pkg
547
548 =cut
549
550 set_default(\%config,'version_packages_dir',$config{spool_dir}.'/../versions/pkg');
551
552 =item version_time_index
553
554 Location of the version/time index file. Defaults to
555 spool_dir/../versions/idx/versions_time.idx if spool_dir/../versions
556 exists; otherwise defaults to undef.
557
558 =cut
559
560
561 set_default(\%config,'version_time_index', -d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/versions_time.idx' : undef);
562
563 =item version_index
564
565 Location of the version index file. Defaults to
566 spool_dir/../versions/indices/versions.idx if spool_dir/../versions
567 exists; otherwise defaults to undef.
568
569 =cut
570
571 set_default(\%config,'version_index',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/versions.idx' : undef);
572
573 =item binary_source_map
574
575 Location of the binary -> source map. Defaults to
576 spool_dir/../versions/indices/bin2src.idx if spool_dir/../versions
577 exists; otherwise defaults to undef.
578
579 =cut
580
581 set_default(\%config,'binary_source_map',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/binsrc.idx' : undef);
582
583 =item source_binary_map
584
585 Location of the source -> binary map. Defaults to
586 spool_dir/../versions/indices/src2bin.idx if spool_dir/../versions
587 exists; otherwise defaults to undef.
588
589 =cut
590
591 set_default(\%config,'source_binary_map',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/srcbin.idx' : undef);
592
593
594
595 set_default(\%config,'post_processall',[]);
596
597 =item sendmail
598
599 Sets the sendmail binary to execute; defaults to /usr/lib/sendmail
600
601 =cut
602
603 set_default(\%config,'sendmail','/usr/lib/sendmail');
604
605 =item spam_scan
606
607 Whether or not spamscan is being used; defaults to 0 (not being used
608
609 =cut
610
611 set_default(\%config,'spam_scan',0);
612
613
614 =back
615
616
617 =head2 Text Fields
618
619 The following are the only text fields in general use in the scripts;
620 a few additional text fields are defined in text.in, but are only used
621 in db2html and a few other specialty scripts.
622
623 Earlier versions of debbugs defined these values in /etc/debbugs/text,
624 but now they are required to be in the configuration file. [Eventually
625 the longer ones will move out into a fully fledged template system.]
626
627 =cut
628
629 =over
630
631 =item bad_email_prefix
632
633 This prefixes the text of all lines in a bad e-mail message ack.
634
635 =cut
636
637 set_default(\%config,'bad_email_prefix','');
638
639
640 =item text_instructions
641
642 This gives more information about bad e-mails to receive.in
643
644 =cut
645
646 set_default(\%config,'text_instructions',$config{bad_email_prefix});
647
648 =item html_tail
649
650 This shows up at the end of (most) html pages
651
652 =cut
653
654 set_default(\%config,'html_tail',<<END);
655  <ADDRESS>$config{maintainer} &lt;<A HREF=\"mailto:$config{maintainer_email}\">$config{maintainer_email}</A>&gt;.
656  Last modified:
657  <!--timestamp-->
658  SUBSTITUTE_DTIME
659  <!--timestamp-->
660  <P>
661  <A HREF=\"http://$config{web_domain}/\">Debian $config{bug} tracking system</A><BR>
662  Copyright (C) 1999 Darren O. Benham,
663  1997,2003 nCipher Corporation Ltd,
664  1994-97 Ian Jackson.
665  </ADDRESS>
666 END
667
668
669 =item html_expire_note
670
671 This message explains what happens to archive/remove-able bugs
672
673 =cut
674
675 set_default(\%config,'html_expire_note',
676             "(Closed $config{bugs} are archived $config{remove_age} days after the last related message is received.)");
677
678 =back
679
680 =cut
681
682
683 sub read_config{
684      my ($conf_file) = @_;
685      # first, figure out what type of file we're reading in.
686      my $fh = new IO::File $conf_file,'r'
687           or die "Unable to open configuration file $conf_file for reading: $!";
688      # A new version configuration file must have a comment as its first line
689      my $first_line = <$fh>;
690      my ($version) = defined $first_line?$first_line =~ /VERSION:\s*(\d+)/i:undef;
691      if (defined $version) {
692           if ($version == 1) {
693                # Do something here;
694                die "Version 1 configuration files not implemented yet";
695           }
696           else {
697                die "Version $version configuration files are not supported";
698           }
699      }
700      else {
701           # Ugh. Old configuration file
702           # What we do here is we create a new Safe compartment
703           # so fucked up crap in the config file doesn't sink us.
704           my $cpt = new Safe or die "Unable to create safe compartment";
705           # perldoc Opcode; for details
706           $cpt->permit('require',':filesys_read','entereval','caller','pack','unpack','dofile');
707           $cpt->reval(qq(require '$conf_file';));
708           die "Error in configuration file: $@" if $@;
709           # Now what we do is check out the contents of %EXPORT_TAGS to see exactly which variables
710           # we want to glob in from the configuration file
711           for my $variable (@{$EXPORT_TAGS{globals}}) {
712                my ($hash_name,$glob_name,$glob_type) = __convert_name($variable);
713                my $var_glob = $cpt->varglob($glob_name);
714                my $value; #= $cpt->reval("return $variable");
715                # print STDERR "$variable $value",qq(\n);
716                if (defined $var_glob) {{
717                     no strict 'refs';
718                     if ($glob_type eq '%') {
719                          $value = {%{*{$var_glob}}} if defined *{$var_glob}{HASH};
720                     }
721                     elsif ($glob_type eq '@') {
722                          $value = [@{*{$var_glob}}] if defined *{$var_glob}{ARRAY};
723                     }
724                     else {
725                          $value = ${*{$var_glob}};
726                     }
727                     # We punt here, because we can't tell if the value was
728                     # defined intentionally, or if it was just left alone;
729                     # this tries to set sane defaults.
730                     set_default(\%config,$hash_name,$value) if defined $value;
731                }}
732           }
733      }
734 }
735
736 sub __convert_name{
737      my ($variable) = @_;
738      my $hash_name = $variable;
739      $hash_name =~ s/^([\$\%\@])g//;
740      my $glob_type = $1;
741      my $glob_name = 'g'.$hash_name;
742      $hash_name =~ s/(HTML|CGI)/ucfirst(lc($1))/ge;
743      $hash_name =~ s/^([A-Z]+)/lc($1)/e;
744      $hash_name =~ s/([A-Z]+)/'_'.lc($1)/ge;
745      return $hash_name unless wantarray;
746      return ($hash_name,$glob_name,$glob_type);
747 }
748
749 # set_default
750
751 # sets the configuration hash to the default value if it's not set,
752 # otherwise doesn't do anything
753 # If $USING_GLOBALS, then sets an appropriate global.
754
755 sub set_default{
756      my ($config,$option,$value) = @_;
757      my $varname;
758      if ($USING_GLOBALS) {
759           # fix up the variable name
760           $varname = 'g'.join('',map {ucfirst $_} split /_/, $option);
761           # Fix stupid HTML names
762           $varname =~ s/(Html|Cgi)/uc($1)/ge;
763      }
764      # update the configuration value
765      if (not $USING_GLOBALS and not exists $config->{$option}) {
766           $config->{$option} = $value;
767      }
768      elsif ($USING_GLOBALS) {{
769           no strict 'refs';
770           # Need to check if a value has already been set in a global
771           if (defined *{"Debbugs::Config::${varname}"}) {
772                $config->{$option} = *{"Debbugs::Config::${varname}"};
773           }
774           else {
775                $config->{$option} = $value;
776           }
777      }}
778      if ($USING_GLOBALS) {{
779           no strict 'refs';
780           *{"Debbugs::Config::${varname}"} = $config->{$option};
781      }}
782 }
783
784
785 ### import magick
786
787 # All we care about here is whether we've been called with the globals or text option;
788 # if so, then we need to export some symbols back up.
789 # In any event, we call exporter.
790
791 sub import {
792      if (grep /^:(?:text|globals)$/, @_) {
793           $USING_GLOBALS=1;
794           for my $variable (map {@$_} @EXPORT_TAGS{map{(/^:(text|globals)$/?($1):())} @_}) {
795                my $tmp = $variable;
796                no strict 'refs';
797                # Yes, I don't care if these are only used once
798                no warnings 'once';
799                # No, it doesn't bother me that I'm assigning an undefined value to a typeglob
800                no warnings 'misc';
801                my ($hash_name,$glob_name,$glob_type) = __convert_name($variable);
802                $tmp =~ s/^[\%\$\@]//;
803                *{"Debbugs::Config::${tmp}"} = ref($config{$hash_name})?$config{$hash_name}:\$config{$hash_name};
804           }
805      }
806      Debbugs::Config->export_to_level(1,@_);
807 }
808
809
810 1;