Package: yada
Version: 0.54
Severity: normal
Tags: patch

Hi,


/usr/share/doc/yada-doc/yada.txt.gz claims that
           [ %if ] should be followed by text. If the condition text is not
           equal 0 or is not an empty string then the condition is true. 

However non-numeric non-empty strings don't work, e.g:
        %define test "Test"
        %if %{test}
                condition is false, this line is ignored by yada
        %endif

One needs to do some tricks like %if 0%{?test:1} to have it evaluated
correctly.

The attached patch fixes this issue.

Regards,
Robert


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/pdksh

Versions of packages yada depends on:
ii  dpkg-dev                      1.14.22    Debian package development tools
ii  file                          4.26-1     Determines file type using "magic"
ii  patch                         2.5.9-5    Apply a diff file to an original
ii  perl                          5.10.0-17  Larry Wall's Practical Extraction 

Versions of packages yada recommends:
ii  yada-doc                      0.54       Yet Another Debianisation Aid - do

Versions of packages yada suggests:
ii  bzip2                         1.0.5-1    high-quality block-sorting file co

-- no debconf information
--- /usr/bin/yada	2007-10-29 11:26:25.000000000 +0100
+++ yada	2008-11-14 23:46:27.000000000 +0100
@@ -881,8 +881,7 @@
         my ($key, $val) = ($1, $2);
         $macros{$key} = $val;
     } elsif (m/^%if\s+(.*)$/) {
-        # no `Argument "perl" isn't numeric in numeric eq (==)' warning
-        { no warnings; $ignore++; $ignore{$ignore} = ($ignore{$ignore-1} | ($1 == 0 ? 1 : 0)); }
+        { $ignore++; $ignore{$ignore} = ($ignore{$ignore-1} | (!$1 ? 1 : 0)); }
     } elsif (m/^%else$/) {
         if (not defined $ignore{$ignore}) {
             die "%else without %if".&parainfofile();

Reply via email to