From 11c868cf69cec041b836dce791bdf11114d1465e Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 24 Aug 2023 12:24:38 +0200 Subject: [PATCH 1/2] install.sh: Fix bee registery of /etc/files The function install_etc_files contains a bug which causes the files in etc not to be probably registered in the crafted bee index of the "mxtools-0.0-0" package. The reason is, that the functions install_exe and install_data are called from the last command of a pipeline. By default, this is executed in a subshell, so the implicit modification of the global variable INSTALLED_FILES is not seen by main process, which later uses it to generate the index. Make the loop run in the main shell process. --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index eb53244..fca5387 100755 --- a/install.sh +++ b/install.sh @@ -103,13 +103,13 @@ function install_symlink() function install_etc_files() { - (cd etc ; find * -type f) | while read -r path; do + while read -r path; do if [[ -x etc/$path ]]; then install_exec etc/$path "$DESTDIR$sysconfdir/$path" else install_data etc/$path "$DESTDIR$sysconfdir/$path" fi - done + done < <(cd etc ; find * -type f) } function postinstall() From af9dd1c5c1358a4ef90e6d184f24a438462998d7 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 24 Aug 2023 12:26:45 +0200 Subject: [PATCH 2/2] install.sh: Avoid `find *` Although the local `etc` directory should contain only sane files, stick to good habit and avoid `find *`, which misinterpretes filenames starting with `-`. Also add quotes to avoid missinterpretation of filenames with whitespace. --- install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index fca5387..96cba83 100755 --- a/install.sh +++ b/install.sh @@ -104,12 +104,13 @@ function install_symlink() function install_etc_files() { while read -r path; do + path="${path#./}" if [[ -x etc/$path ]]; then - install_exec etc/$path "$DESTDIR$sysconfdir/$path" + install_exec "etc/$path" "$DESTDIR$sysconfdir/$path" else - install_data etc/$path "$DESTDIR$sysconfdir/$path" + install_data "etc/$path" "$DESTDIR$sysconfdir/$path" fi - done < <(cd etc ; find * -type f) + done < <(cd etc ; find ./* -type f) } function postinstall()