From 7f9d19f5535bd3df534887ce5797482b06c0b7ea Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Tue, 28 May 2013 10:49:16 +0200 Subject: [PATCH 1/8] bee-check: fix reading the CONTENT file using 'read' to get the lines of the CONTENT file is the better choice here --- src/bee-check.sh.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bee-check.sh.in b/src/bee-check.sh.in index 87d84f9..806aee3 100644 --- a/src/bee-check.sh.in +++ b/src/bee-check.sh.in @@ -192,12 +192,12 @@ function do_check_deps() { echo " provides = ${PKGNAME}" echo " provides = ${PKGFULLPKG}" - for line in $(cat ${filesfile}) ; do + while read line; do eval $(${BEESEP} ${line}) echo " provides = ${file%%//*}" - done + done < "${filesfile}" - for line in $(cat ${filesfile}) ; do + while read line; do eval $(${BEESEP} ${line}) # save and strip possible symbolic link destination.. @@ -220,8 +220,7 @@ function do_check_deps() { fi do_check_deps_of_file "${file}" - - done + done < "${filesfile}" } ############################################################################### From 94175fd05812fdb75992cbb2eee3b08ea07978d0 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Tue, 28 May 2013 10:54:20 +0200 Subject: [PATCH 2/8] Fix beesep calls filenames containing spaces led beesep to fail beesep only takes one argument otherwise it will fail using quotes around the argument fixes this issue --- src/bee-check.sh.in | 4 ++-- src/compat-filesfile2contentfile.sh.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bee-check.sh.in b/src/bee-check.sh.in index 806aee3..ea1be6b 100644 --- a/src/bee-check.sh.in +++ b/src/bee-check.sh.in @@ -193,12 +193,12 @@ function do_check_deps() { echo " provides = ${PKGFULLPKG}" while read line; do - eval $(${BEESEP} ${line}) + eval $(${BEESEP} "${line}") echo " provides = ${file%%//*}" done < "${filesfile}" while read line; do - eval $(${BEESEP} ${line}) + eval $(${BEESEP} "${line}") # save and strip possible symbolic link destination.. symlink=${file#*//} diff --git a/src/compat-filesfile2contentfile.sh.in b/src/compat-filesfile2contentfile.sh.in index 1a0493b..4c64e78 100644 --- a/src/compat-filesfile2contentfile.sh.in +++ b/src/compat-filesfile2contentfile.sh.in @@ -29,7 +29,7 @@ declare -A hardlink while read line ; do md5="" - data=$(${BEESEP} ${line} 2>/dev/null) + data=$(${BEESEP} "${line}" 2>/dev/null) if [ $? -ne '0' ] ; then echo >&2 "**ERROR** INVALID CONTENT: ${line}" From 195c6271b1cf525858d39c2c7aeb7e1afa557c82 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Wed, 24 Jul 2013 10:08:20 +0200 Subject: [PATCH 3/8] bee-query: fix get_files "" in the for loop results in searching in /${pkg} we should never expect packages being in the root fs --- src/bee-query.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bee-query.sh.in b/src/bee-query.sh.in index 02edcf3..a6e2755 100644 --- a/src/bee-query.sh.in +++ b/src/bee-query.sh.in @@ -70,7 +70,7 @@ function query() { function get_files() { pkg=${1} - for s in "" "${BEE_METADIR}" ; do + for s in "${BEE_METADIR}" ; do ff="${s}/${pkg}/CONTENT" if [ -e "${ff}" ] ; then while read line ; do From 7924a2fcce5d20fc30bec91883ebb5e661ccefa6 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Mon, 29 Jul 2013 10:10:36 +0200 Subject: [PATCH 4/8] templates: minor fix --- conf/templates/fallback | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/templates/fallback b/conf/templates/fallback index e1e1f4f..d15023c 100644 --- a/conf/templates/fallback +++ b/conf/templates/fallback @@ -75,7 +75,7 @@ ## The name of this bee-file should follow the following naming convention: ## pkgname-pkgversion-pkgrevision.bee ## -## You may remove all comments as long as SRCURL[0]="" is set. +## You may remove all comments as long as SRCURL[0] is set. ## ## Everything in this file will be executed in a bash environment. ## From 4e42f4a2e0d13eb2fe01b5c1aa984d2cde87a0c7 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Mon, 29 Jul 2013 10:18:52 +0200 Subject: [PATCH 5/8] hooks: do not update manual index cache if directory does not exist anymore otherwise we get this error: ls: cannot access /tmp/example-1.0/share/man/: No such file or directory updating manual index cache for /tmp/example-1.0/share/man .. --- hooks/mandb.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/mandb.sh b/hooks/mandb.sh index ab09af8..5da562c 100644 --- a/hooks/mandb.sh +++ b/hooks/mandb.sh @@ -47,6 +47,10 @@ for man_dir in $(beeuniq ${man_dirs//:/ }) ; do case "${action}" in "post-remove"|"post-install") if grep -q "file=${man_dir}" ${content} ; then + if [ ! -d ${man_dir} ]; then + continue + fi + nfiles=$(ls ${man_dir}/ | head -2 | grep -c -v index.db) if [ "${nfiles}" -gt 0 ] ; then rm -f ${man_dir}/index.db From 869187115cea54d9e305b2485c6c3a1a80585fe7 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Fri, 2 Aug 2013 09:35:05 +0200 Subject: [PATCH 6/8] beesh: fix typo --- src/beesh.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index ade8eca..ed5c99a 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -142,7 +142,7 @@ function check_rebuild() { print_warning "please increase revision number" beefile_dir=${beefile%/*} - eval $(${BEEVERSION} ${beefile}}) + eval $(${BEEVERSION} ${beefile}) beefile_pattern="${PKGFULLNAME}-${PKGFULLVERSION}" beefile_max=$(for bf in $(ls ${beefile%/*}/${beefile_pattern}*.bee ${BEE_BEEDIR}/${beefile_pattern}*.bee 2>/dev/null |\ From df6bacdb69765ad04c44972907690c92bfe6a798 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Fri, 2 Aug 2013 09:49:13 +0200 Subject: [PATCH 7/8] beesh: fix check_rebuild packages containing '+' did not work properly: [BEE] package already exists: /home/ruester/.local/src/bee/packages/gtk+-3.0.5-0.x86_64.bee.tar.bz2 [BEE] bee-file already exists: /home/ruester/.local/src/bee/bee-files/gtk+-3.0.5-0.bee [BEE] please increase revision number usage: beeversion [BEE] cp /home/ruester/git/bee.git/./gtk+-3.0.5-0.bee /home/ruester/git/bee.git/gtk+-3.0.5-1.bee so now we prepare ${beefile_pattern} to be a regular expression by escaping the characters + and . to \+ and \. --- src/beesh.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index ed5c99a..770eb34 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -145,13 +145,16 @@ function check_rebuild() { eval $(${BEEVERSION} ${beefile}) beefile_pattern="${PKGFULLNAME}-${PKGFULLVERSION}" + beefile_pattern=${beefile_pattern//+/\\+} # replace all + with \+ + beefile_pattern=${beefile_pattern//./\\.} # replace all . with \. + beefile_max=$(for bf in $(ls ${beefile%/*}/${beefile_pattern}*.bee ${BEE_BEEDIR}/${beefile_pattern}*.bee 2>/dev/null |\ grep -E "/${beefile_pattern}-[0-9]+.bee") ; do echo "${bf}" done | ${BEESORT} | tail -1) eval $(${BEEVERSION} ${beefile_max}) - print_warning "cp ${beefile} ${PWD}/${beefile_pattern}-$((PKGREVISION + 1)).bee" + print_warning "cp ${beefile} ${PWD}/${PKGFULLNAME}-${PKGFULLVERSION}-$((PKGREVISION + 1)).bee" exit 1 } From 757a7da86942b130c0c631fed2fa1df956b7d7e3 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Thu, 19 Sep 2013 14:39:51 +0200 Subject: [PATCH 8/8] beesh: only append BEE_SOURCESUBDIR if set otherwise it will result in ${S} being .../source/ (trailing '/') which then results in calling .../source//configure --prefix=... --- src/beesh.sh.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 770eb34..fcc8876 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -1008,11 +1008,13 @@ if [ ! -d "${S}/${BEE_SOURCESUBDIR}" ] ; then exit 1 fi -if [ "${B}" = "${S}" ] ; then - B="${S}/${BEE_SOURCESUBDIR}" +if [ "${B}" = "${S}" -a -n "${BEE_SOURCESUBDIR}" ] ; then + B="${S}/${BEE_SOURCESUBDIR}" fi -S="${S}/${BEE_SOURCESUBDIR}" +if [ -n "${BEE_SOURCESUBDIR}" ]; then + S="${S}/${BEE_SOURCESUBDIR}" +fi print_info "changing to source directory: ${S}" cd ${S}