[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#801379: live-build: The package lists #nif conditional test is not functional



Package: live-build
Version: 3.0.5-1
Severity: normal
Tags: upstream patch

Dear Maintainer,

the #nif conditional in a package list configuration file does not work as
expected.

If the live build configuration variable "ABC" contains "X Y Z",
you expect the "#nif ABC X" conditional to be false,
but this is not the case.

This is caused by an invalid logic used to test the conditional. The logic
as implemented starts of assuming the condition is false. It then compares
each condition argument with each item in the content of the condition
config variable and turns the condition on whenever a condition argument
is different from an item in the condition config variable.

To prevent false positives the logic should be turned around: the logic
should assume the condition to be *true* and turn the condition *off*
whenever a condition argument *is equal to* an item in the condition
config variable.



-- Package-specific info:

-- System Information:
Debian Release: 7.8
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages live-build depends on:
ii  debootstrap  1.0.48+deb7u2

Versions of packages live-build recommends:
ii  cpio                            2.11+dfsg-0.1+deb7u1
pn  gnu-fdisk                       <none>
pn  live-boot-doc                   <none>
pn  live-config-doc                 <none>
pn  live-manual-html | live-manual  <none>

Versions of packages live-build suggests:
pn  debian-keyring              <none>
ii  dosfstools                  3.0.13-1
ii  fakeroot                    1.18.4-2
ii  git                         1:1.7.10.4-1+wheezy1
ii  gpgv                        1.4.12-7+deb7u7
pn  loadlin                     <none>
ii  memtest86+                  4.20-1.1
ii  mtools                      4.0.17-1
pn  parted                      <none>
pn  squashfs-tools | mtd-tools  <none>
ii  sudo                        1.8.5p2-1+nmu3
ii  syslinux                    2:4.05+dfsg-6+deb7u1
pn  uuid-runtime                <none>
pn  win32-loader                <none>
ii  xorriso                     1.2.2-2

-- no debconf information
diff -r -U3 live-build-3.0.5.ORI/functions/packagelists.sh live-build-3.0.5/functions/packagelists.sh
--- live-build-3.0.5.ORI/functions/packagelists.sh      2013-04-30 08:28:19.000000000 +0200
+++ live-build-3.0.5/functions/packagelists.sh  2015-10-08 12:14:40.257908259 +0200
@@ -89,14 +89,14 @@
                                        _LB_NEEDLE="$(echo "${_LB_LINE}" | cut -d' ' -f3-)"
                                        _LB_HAYSTACK="$(eval "echo \$LB_$(echo "${_LB_LINE}" | cut -d' ' -f2)")"
 
-                                       _LB_ENABLED=0
+                                       _LB_ENABLED=1
                                        for _LB_NEEDLE_PART in ${_LB_NEEDLE}
                                        do
                                                for _LB_HAYSTACK_PART in ${_LB_HAYSTACK}
                                                do
-                                                       if [ "${_LB_NEEDLE_PART}" != "${_LB_HAYSTACK_PART}" ]
+                                                       if [ "${_LB_NEEDLE_PART}" = "${_LB_HAYSTACK_PART}" ]
                                                        then
-                                                               _LB_ENABLED=1
+                                                               _LB_ENABLED=0
                                                        fi
                                                done
                                        done

Reply to: