Bug#770645: Broken use of Get_conffiles() function
Package: live-build
Version: 4.0.3-1
The Read_conffiles() and Print_conffiles() functions in conffile.sh
under /usr/share/live/build/functions both contain the following line of
code:
for CONFFILE in Get_conffiles "${@}"
Echoing ${CONFFILE} on each loop, the string 'Get_conffiles' is being
interpreted as the name of a file. I believe the author actually
intended for the Get_conffiles() function to be called here, passing it
the parameter list, which after processing, it returns for use in these
loops.
A patch is attached which fixes/implements this assumed intended behaviour.
However, feedback is needed from the author/maintainer in relation to
further possible fixes needed for Get_conffiles() in order to complete a
comprehensive fix for the issues here. Specifically in relation to the
following:
With an "echo ${CONFFILE}" debugging line added into Read_conffiles(), I
observed two problems with the list returned by Get_conffiles() (after
the above bug was fixed):
1. Get_conffiles() is adding entries that should end in
".${DISTRIBUTION}", however this variable is empty. I suspect that the
wrong variable name is being used.
2. The list of entries returned contain several duplicates and other
entries that look a little wrong to me, as shown below.
config/all
config/all.amd64
config/all.
config/lb
config
config/lb
config.
config/lb
config.
config/common
config/common.amd64
config/common.
config/lb
config
config/lb
config.
config/lb
config.
config/bootstrap
config/bootstrap.amd64
config/bootstrap.
config/lb
config
config/lb
config.
config/lb
config.
config/chroot
config/chroot.amd64
config/chroot.
config/lb
config
config/lb
config.
config/lb
config.
config/binary
config/binary.amd64
config/binary.
config/lb
config
config/lb
config.
config/lb
config.
config/source
config/source.amd64
config/source.
config/lb
config
config/lb
config.
config/lb
config.
Before submitting this bug report, these issues were first discussed on the mailing list here: https://lists.debian.org/debian-live/2014/11/msg00056.html
From 33c0cdaf869ccd3cc003a6e83e102c3ddfcce6f8 Mon Sep 17 00:00:00 2001
From: jnqnfe <jnqnfe@gmail.com>
Date: Sat, 22 Nov 2014 21:20:29 +0000
Subject: [PATCH] Fix broken calls to Get_conffiles() from Read_conffiles() and
Print_conffiles().
---
functions/conffile.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/functions/conffile.sh b/functions/conffile.sh
index 055c913..a9dd9ab 100755
--- a/functions/conffile.sh
+++ b/functions/conffile.sh
@@ -28,7 +28,7 @@ Get_conffiles ()
Read_conffiles ()
{
- for CONFFILE in Get_conffiles "${@}"
+ for CONFFILE in $(Get_conffiles "${@}")
do
if [ -f "${CONFFILE}" ]
then
@@ -45,7 +45,7 @@ Read_conffiles ()
Print_conffiles ()
{
- for CONFFILE in Get_conffiles "${@}"
+ for CONFFILE in $(Get_conffiles "${@}")
do
if [ -f "${CONFFILE}" ]
then
--
1.9.4.msysgit.0
Reply to: