]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/Config.pm
* Add a default_architectures configuration variable which sets the
[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
387 =item default_architectures
388
389 List of default architectures to use when architecture(s) are not
390 specified
391
392 Default: i386 amd64 arm ppc sparc alpha
393
394 =cut
395
396 set_default(\%config,'default_architectures',
397             [qw(i386 amd64 arm ppc sparc alpha)]
398            );
399
400 =item removal_distribution_tags
401
402 Tags which specifiy distributions to check
403
404 Default: @{$config{distributions}}
405
406 =cut
407
408 set_default(\%config,'removal_distribution_tags',
409             [@{$config{distributions}}]);
410
411 =item removal_default_distribution_tags
412
413 For removal/archival purposes, all bugs are assumed to have these tags
414 set.
415
416 Default: qw(unstable testing);
417
418 =cut
419
420 set_default(\%config,'removal_default_distribution_tags',
421             [qw(unstable testing)]
422            );
423
424 =item removal_strong_severity_default_distribution_tags
425
426 For removal/archival purposes, all bugs with strong severity are
427 assumed to have these tags set.
428
429 Default: qw(unstable testing stable);
430
431 =cut
432
433 set_default(\%config,'removal_strong_severity_default_distribution_tags',
434             [qw(unstable testing stable)]
435            );
436
437
438 =item removal_architectures
439
440 For removal/archival purposes, these architectures are consulted if
441 there is more than one architecture applicable. If the bug is in a
442 package not in any of these architectures, the architecture actually
443 checked is undefined.
444
445 Default: value of default_architectures
446
447 =cut
448
449 set_default(\%config,'removal_architectures',
450             $config{default_architectures},
451            );
452
453
454 =item package_name_re
455
456 The regex which will match a package name
457
458 Default: '[a-z0-9][a-z0-9\.+-]+'
459
460 =cut
461
462 set_default(\%config,'package_name_re',
463             '[a-z0-9][a-z0-9\.+-]+');
464
465 =item package_version_re
466
467 The regex which will match a package version
468
469 Default: '[A-Za-z0-9:+\.-]+'
470
471 =cut
472
473 set_default(\%config,'package_version_re',
474             '[A-Za-z0-9:+\.~-]+');
475
476
477 =item control_internal_requester
478
479 This address is used by Debbugs::Control as the request address which
480 sent a control request for faked log messages.
481
482 Default:"Debbugs Internal Request <$config{maintainer_email}>"
483
484 =cut
485
486 set_default(\%config,'control_internal_requester',
487             "Debbugs Internal Request <$config{maintainer_email}>",
488            );
489
490 =item control_internal_request_addr
491
492 This address is used by Debbugs::Control as the address to which a
493 faked log message request was sent.
494
495 Default: "internal_control\@$config{email_domain}";
496
497 =cut
498
499 set_default(\%config,'control_internal_request_addr',
500             'internal_control@'.$config{email_domain},
501            );
502
503
504 =item exclude_from_control
505
506 Addresses which are not allowed to send messages to control
507
508 =cut
509
510 set_default(\%config,'exclude_from_control',[]);
511
512
513
514
515 set_default(\%config,'default_severity','normal');
516 set_default(\%config,'show_severities','critical, grave, normal, minor, wishlist');
517 set_default(\%config,'strong_severities',[qw(critical grave)]);
518 set_default(\%config,'severity_list',[qw(critical grave normal wishlist)]);
519 set_default(\%config,'severity_display',{critical => "Critical $config{bugs}",
520                                          grave    => "Grave $config{bugs}",
521                                          normal   => "Normal $config{bugs}",
522                                          wishlist => "Wishlist $config{bugs}",
523                                         });
524
525 set_default(\%config,'tags',[qw(patch wontfix moreinfo unreproducible fixed),
526                              @{$config{distributions}}
527                             ]);
528
529 set_default(\%config,'bounce_froms','^mailer|^da?emon|^post.*mast|^root|^wpuser|^mmdf|^smt.*|'.
530             '^mrgate|^vmmail|^mail.*system|^uucp|-maiser-|^mal\@|'.
531             '^mail.*agent|^tcpmail|^bitmail|^mailman');
532
533 set_default(\%config,'config_dir',dirname(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config'));
534 set_default(\%config,'spool_dir','/var/lib/debbugs/spool');
535 set_default(\%config,'incoming_dir','incoming');
536 set_default(\%config,'web_dir','/var/lib/debbugs/www');
537 set_default(\%config,'doc_dir','/var/lib/debbugs/www/txt');
538 set_default(\%config,'lib_path','/usr/lib/debbugs');
539
540
541 =item template_dir
542
543 directory of templates; defaults to /usr/share/debbugs/templates.
544
545 =cut
546
547 set_default(\%config,'template_dir','/usr/share/debbugs/templates');
548
549
550 set_default(\%config,'maintainer_file',$config{config_dir}.'/Maintainers');
551 set_default(\%config,'maintainer_file_override',$config{config_dir}.'/Maintainers.override');
552 set_default(\%config,'pseudo_maint_file',$config{config_dir}.'/pseudo-packages.maint');
553 set_default(\%config,'pseudo_desc_file',$config{config_dir}.'/pseudo-packages.description');
554 set_default(\%config,'package_source',$config{config_dir}.'/indices/sources');
555
556
557 =item version_packages_dir
558
559 Location where the version package information is kept; defaults to
560 spool_dir/../versions/pkg
561
562 =cut
563
564 set_default(\%config,'version_packages_dir',$config{spool_dir}.'/../versions/pkg');
565
566 =item version_time_index
567
568 Location of the version/time index file. Defaults to
569 spool_dir/../versions/idx/versions_time.idx if spool_dir/../versions
570 exists; otherwise defaults to undef.
571
572 =cut
573
574
575 set_default(\%config,'version_time_index', -d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/versions_time.idx' : undef);
576
577 =item version_index
578
579 Location of the version index file. Defaults to
580 spool_dir/../versions/indices/versions.idx if spool_dir/../versions
581 exists; otherwise defaults to undef.
582
583 =cut
584
585 set_default(\%config,'version_index',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/versions.idx' : undef);
586
587 =item binary_source_map
588
589 Location of the binary -> source map. Defaults to
590 spool_dir/../versions/indices/bin2src.idx if spool_dir/../versions
591 exists; otherwise defaults to undef.
592
593 =cut
594
595 set_default(\%config,'binary_source_map',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/binsrc.idx' : undef);
596
597 =item source_binary_map
598
599 Location of the source -> binary map. Defaults to
600 spool_dir/../versions/indices/src2bin.idx if spool_dir/../versions
601 exists; otherwise defaults to undef.
602
603 =cut
604
605 set_default(\%config,'source_binary_map',-d $config{spool_dir}.'/../versions' ? $config{spool_dir}.'/../versions/indices/srcbin.idx' : undef);
606
607
608
609 set_default(\%config,'post_processall',[]);
610
611 =item sendmail
612
613 Sets the sendmail binary to execute; defaults to /usr/lib/sendmail
614
615 =cut
616
617 set_default(\%config,'sendmail','/usr/lib/sendmail');
618
619 =item spam_scan
620
621 Whether or not spamscan is being used; defaults to 0 (not being used
622
623 =cut
624
625 set_default(\%config,'spam_scan',0);
626
627
628 =back
629
630
631 =head2 Text Fields
632
633 The following are the only text fields in general use in the scripts;
634 a few additional text fields are defined in text.in, but are only used
635 in db2html and a few other specialty scripts.
636
637 Earlier versions of debbugs defined these values in /etc/debbugs/text,
638 but now they are required to be in the configuration file. [Eventually
639 the longer ones will move out into a fully fledged template system.]
640
641 =cut
642
643 =over
644
645 =item bad_email_prefix
646
647 This prefixes the text of all lines in a bad e-mail message ack.
648
649 =cut
650
651 set_default(\%config,'bad_email_prefix','');
652
653
654 =item text_instructions
655
656 This gives more information about bad e-mails to receive.in
657
658 =cut
659
660 set_default(\%config,'text_instructions',$config{bad_email_prefix});
661
662 =item html_tail
663
664 This shows up at the end of (most) html pages
665
666 =cut
667
668 set_default(\%config,'html_tail',<<END);
669  <ADDRESS>$config{maintainer} &lt;<A HREF=\"mailto:$config{maintainer_email}\">$config{maintainer_email}</A>&gt;.
670  Last modified:
671  <!--timestamp-->
672  SUBSTITUTE_DTIME
673  <!--timestamp-->
674  <P>
675  <A HREF=\"http://$config{web_domain}/\">Debian $config{bug} tracking system</A><BR>
676  Copyright (C) 1999 Darren O. Benham,
677  1997,2003 nCipher Corporation Ltd,
678  1994-97 Ian Jackson.
679  </ADDRESS>
680 END
681
682
683 =item html_expire_note
684
685 This message explains what happens to archive/remove-able bugs
686
687 =cut
688
689 set_default(\%config,'html_expire_note',
690             "(Closed $config{bugs} are archived $config{remove_age} days after the last related message is received.)");
691
692 =back
693
694 =cut
695
696
697 sub read_config{
698      my ($conf_file) = @_;
699      # first, figure out what type of file we're reading in.
700      my $fh = new IO::File $conf_file,'r'
701           or die "Unable to open configuration file $conf_file for reading: $!";
702      # A new version configuration file must have a comment as its first line
703      my $first_line = <$fh>;
704      my ($version) = defined $first_line?$first_line =~ /VERSION:\s*(\d+)/i:undef;
705      if (defined $version) {
706           if ($version == 1) {
707                # Do something here;
708                die "Version 1 configuration files not implemented yet";
709           }
710           else {
711                die "Version $version configuration files are not supported";
712           }
713      }
714      else {
715           # Ugh. Old configuration file
716           # What we do here is we create a new Safe compartment
717           # so fucked up crap in the config file doesn't sink us.
718           my $cpt = new Safe or die "Unable to create safe compartment";
719           # perldoc Opcode; for details
720           $cpt->permit('require',':filesys_read','entereval','caller','pack','unpack','dofile');
721           $cpt->reval(qq(require '$conf_file';));
722           die "Error in configuration file: $@" if $@;
723           # Now what we do is check out the contents of %EXPORT_TAGS to see exactly which variables
724           # we want to glob in from the configuration file
725           for my $variable (@{$EXPORT_TAGS{globals}}) {
726                my ($hash_name,$glob_name,$glob_type) = __convert_name($variable);
727                my $var_glob = $cpt->varglob($glob_name);
728                my $value; #= $cpt->reval("return $variable");
729                # print STDERR "$variable $value",qq(\n);
730                if (defined $var_glob) {{
731                     no strict 'refs';
732                     if ($glob_type eq '%') {
733                          $value = {%{*{$var_glob}}} if defined *{$var_glob}{HASH};
734                     }
735                     elsif ($glob_type eq '@') {
736                          $value = [@{*{$var_glob}}] if defined *{$var_glob}{ARRAY};
737                     }
738                     else {
739                          $value = ${*{$var_glob}};
740                     }
741                     # We punt here, because we can't tell if the value was
742                     # defined intentionally, or if it was just left alone;
743                     # this tries to set sane defaults.
744                     set_default(\%config,$hash_name,$value) if defined $value;
745                }}
746           }
747      }
748 }
749
750 sub __convert_name{
751      my ($variable) = @_;
752      my $hash_name = $variable;
753      $hash_name =~ s/^([\$\%\@])g//;
754      my $glob_type = $1;
755      my $glob_name = 'g'.$hash_name;
756      $hash_name =~ s/(HTML|CGI)/ucfirst(lc($1))/ge;
757      $hash_name =~ s/^([A-Z]+)/lc($1)/e;
758      $hash_name =~ s/([A-Z]+)/'_'.lc($1)/ge;
759      return $hash_name unless wantarray;
760      return ($hash_name,$glob_name,$glob_type);
761 }
762
763 # set_default
764
765 # sets the configuration hash to the default value if it's not set,
766 # otherwise doesn't do anything
767 # If $USING_GLOBALS, then sets an appropriate global.
768
769 sub set_default{
770      my ($config,$option,$value) = @_;
771      my $varname;
772      if ($USING_GLOBALS) {
773           # fix up the variable name
774           $varname = 'g'.join('',map {ucfirst $_} split /_/, $option);
775           # Fix stupid HTML names
776           $varname =~ s/(Html|Cgi)/uc($1)/ge;
777      }
778      # update the configuration value
779      if (not $USING_GLOBALS and not exists $config->{$option}) {
780           $config->{$option} = $value;
781      }
782      elsif ($USING_GLOBALS) {{
783           no strict 'refs';
784           # Need to check if a value has already been set in a global
785           if (defined *{"Debbugs::Config::${varname}"}) {
786                $config->{$option} = *{"Debbugs::Config::${varname}"};
787           }
788           else {
789                $config->{$option} = $value;
790           }
791      }}
792      if ($USING_GLOBALS) {{
793           no strict 'refs';
794           *{"Debbugs::Config::${varname}"} = $config->{$option};
795      }}
796 }
797
798
799 ### import magick
800
801 # All we care about here is whether we've been called with the globals or text option;
802 # if so, then we need to export some symbols back up.
803 # In any event, we call exporter.
804
805 sub import {
806      if (grep /^:(?:text|globals)$/, @_) {
807           $USING_GLOBALS=1;
808           for my $variable (map {@$_} @EXPORT_TAGS{map{(/^:(text|globals)$/?($1):())} @_}) {
809                my $tmp = $variable;
810                no strict 'refs';
811                # Yes, I don't care if these are only used once
812                no warnings 'once';
813                # No, it doesn't bother me that I'm assigning an undefined value to a typeglob
814                no warnings 'misc';
815                my ($hash_name,$glob_name,$glob_type) = __convert_name($variable);
816                $tmp =~ s/^[\%\$\@]//;
817                *{"Debbugs::Config::${tmp}"} = ref($config{$hash_name})?$config{$hash_name}:\$config{$hash_name};
818           }
819      }
820      Debbugs::Config->export_to_level(1,@_);
821 }
822
823
824 1;