Ola Lundqvist wrote:
> I have now tried to reproduce your problem, but failed.
>
> The current code that cause the warning looks like this:
>
> if (-e $etcconfigfile) {
>     my $t = do $etcconfigfile;
>     unless ($t) {
>       pdebug(3, "Loading config file $etcconfigfile:\n\t$!\n\t$@");
>     }
> }
>
> So I created the following test code:
>
> my $t = do "test.conf";
> unless ($t) {
>     print "[EMAIL PROTECTED]";
> }
>
> And then copied your config file to test.conf.
>
> I did not get any output.

Oh, now I get what the problem is!

I had sent you only my input.conf file from my (currently single) 
debarchive's incoming/ directory, but not my /etc/debarchiver.conf file, 
because I had all configuration directives commented out in the latter!  
(I don't want to set any options globally.)

Now it occurs to me that debarchiver reads /etc/debarchiver.conf and since 
it contains only empty and comment lines, the result of do() is 0, but $! 
and $@ are empty since no error actually occurs.  (Still no idea where 
the '^I's come from, though.)

So I think debarchiver should check $! and $@ rather than the result of 
do() ("unless ($t)"), which really says nothing about whether the file 
could be read and compiled successfully, UNLESS you require every 
configuration file to end with a true-valued statement (which the 
debarchiver man-page says nothing about).  And I would not make such a 
requirement.  Checking $! and $@ should do just fine.

If, however, you absolutely do not want to do this, then consider this bug 
report a request for documentation of the "config files must end with 1;" 
requirement.

Thanks,
Julian.
# This is a sample configuration file.
# 
# The configuration file consist of perl variables that can be set to
# different values. The suggested value in this sample configuration file
# is the default value set by debarchiver.

# $destdir = "/var/lib/debarchiver/dists";
# $inputdir = "/var/lib/debarchiver/incoming";
# $copycmd = "cp -af";
# $movecmd = "mv";
# $rmcmd = "rm -f";
# $vrfycmd = "dscverify";
# $cinstall = "installed";
# $distinputcriteria = "^linux.*\\.deb\$";

# Choose to enable or disable signature verification for packages uploaded
# into $inputdir (not %distinputdirs).
# $verifysignatures = 0;

# Choose to enable or disable signature verification for packages uploaded
# into %distinputdirs. This works indepentently from $verifysignatures.
# $verifysignaturesdistinput = 0;

# Generate bzip2 files or not (1 will generate and 0 will not do so).
# $bzip = 0;

# This one is used for debarchives that matches distinput criteria.
# %distinputdirs =
#       (
#       stable => 'stable',
#       testing => 'testing',
#       unstable => 'unstable'
#       );

# What distributions that should exist.
# @distributions = ('stable', 'testing', 'unstable');

# Default major section to install to, if not defined in the uploaded files.
# $majordefault = "main";

# Mapping of aliases.
# OBS! If you create a mapping that will only be created if you have
#  added the key to @distributions above. If you want the symlink to be created
#  in a proper way you MUST add them at the same time. Else you will have
#  two directories that are independent (and not mapped).
# %distmapping =
#       (
#       stable => 'etch',
#       testing => 'lenny',
#       unstable => 'sid'
#       );

# What architectures that should exist (automatically created).
# All and source will exist anyway.
# @architectures = ('i386');

# What sections that should exist.
# @sections = ('main', 'contrib', 'non-free');

# What changes file fields that should be used for determine where to send
# mail. If there is an '@' character is found here it will be used directly
# without consulting the .changes-file. Default is to mail no one. If there
# is an '@' character in the beginning, the user owning the file will be
# prepended.
# @mailtos = ('Maintainer',          The Maintainer field in control file
#             'Uploaders',           The Uploaders field in control file
#             '@bar.com',            User id @bar.com that own the changes file
#             '[EMAIL PROTECTED]',   An explicit email address
#             'Changed-By');         The email in the changelog file

# If you want additional information in the generated Release files you have
# to set this hash-value.  Supported keys are origin, label, and description.

# %release = (  'origin' => "",
#               'label' => "",
#               'description' => "");

# Where to put the apt-ftparchive cache files if --index is used.  Default
# is /var/cache/debarchiver.  Must be a directory.
# $cachedir = '/var/cache/debarchiver';

# GnuPG key to use to sign the archive.
# $gpgkey = "";

# File to provide password to GnuPG.
# If you use a key with an empty passphrase, set this variable to 0 or "".
# If the file does not exist, debarchiver will also fall back to "".
# $gpgpassfile = "$ENV{HOME}/.gnupg/passphrase";

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to