Hi,

2010/12/11 Neil Williams <[email protected]>:
> On Thu, 9 Dec 2010 16:19:21 +0900
> Nobuhiro Iwamatsu <[email protected]> wrote:
>
>> When mirror and suite are set in /etc/xapt.d/debian.conf,
>> the setting from a command-line is ignored.
>> Setting of /etc/xapt.d/debian.conf is always effective.
>>
>> I made a patch to give priority to command-line over to solve this
>> problem.
>>
>> Could you check this patch?
>
> if ($mirror eq '') is the wrong check because the variable is undefined
> if the command line option is not given, same for $suite.
>
> Correct fix is:
> $mirror     = $config->val(lc($vendor_name), 'mirror')
>        if (not defined $mirror);
> $suite      = $config->val(lc($vendor_name), 'suite')
>        if (not defined $suite);
>
Oh, Thanks.

I attached new patch.

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
diff --git a/xapt/xapt b/xapt/xapt
index eefae91..547eead 100755
--- a/xapt/xapt
+++ b/xapt/xapt
@@ -98,8 +98,10 @@ $vendor_name = lc($vendor_name);
 $configfile = "/etc/xapt.d/$vendor_name.conf"
 	if (-r "/etc/xapt.d/$vendor_name.conf");
 $config     = new Config::IniFiles( -file => $configfile );
-$mirror     = $config->val(lc($vendor_name), 'mirror');
-$suite      = $config->val(lc($vendor_name), 'suite');
+$mirror     = $config->val(lc($vendor_name), 'mirror')
+	if (not defined $mirror);
+$suite      = $config->val(lc($vendor_name), 'suite')
+	if (not defined $suite);
 $components = $config->val(lc($vendor_name), 'components');
 $noauth     = " -o Apt::Get::AllowUnauthenticated=true "
 	if ($config->val(lc($vendor_name), 'noauth') eq 'true');

Reply via email to