Skip to content

Commit

Permalink
Merge pull request #209 from buczek/fixes-for-marius
Browse files Browse the repository at this point in the history
Fixes for marius
  • Loading branch information
mariux authored and GitHub committed Aug 24, 2016
2 parents a533cfd + bc116c0 commit c5502af
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ HELPER_HOOKS_SHELL+=mandb
HELPER_HOOKS_SHELL+=systemd-tmpfiles
HELPER_HOOKS_SHELL+=gconf-install-schemas
HELPER_HOOKS_SHELL+=info-dir
HELPER_HOOKS_SHELL+=kernel-modules

MANPAGES+=bee.1
MANPAGES+=bee-check.1
Expand Down
36 changes: 36 additions & 0 deletions hooks/kernel-modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
action=${1}
pkg=${2}
content=${3}
: ${content:=${BEE_METADIR}/${pkg}/CONTENT}

if [ -z ${BEE_VERSION} ] ; then
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .."
exit 1
fi

: ${DEPMOD:=depmod}

if [ ! type -p ${DEPMOD} >/dev/null 2>&1 ; then
exit 0
fi

if [ ! -r "${BEE_METADIR}/${pkg}/META" ] ; then
exit 0
fi

. ${BEE_METADIR}/${pkg}/META

if [ ! "${BEEMETAFORMAT:=0}" -ge 2 ] ; then
exit 0
fi

case "${action}" in
"post-install"|"post-remove")
for ver in $(grep -Po ':file=/lib/modules/\K([^/]+)(?=/)' ${content}|sort -u) ; do
echo "$DEPMOD $ver"
test -e /lib/modules/$ver/modules.builtin && $DEPMOD $ver
done
;;
esac
12 changes: 8 additions & 4 deletions src/bee-cache.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ VERSION=${BEE_VERSION}
: ${BEECACHE_CACHEDIR=${BEE_CACHEDIR}/bee-cache}
: ${BEECACHE_INVENTORY=${BEECACHE_CACHEDIR}/INVENTORY}

function ere_quote() {
sed 's/[]\.|$(){}?+*^]/\\&/g' <<< "$*"
}

function cache_verify() {
if ${BEEFLOCK} --shared "${BEECACHE_INVENTORY}" \
sort -c -u -r -k8 -k1 "${BEECACHE_INVENTORY}" 2>/dev/null ; then
Expand Down Expand Up @@ -92,7 +96,7 @@ function print_conflicts() {

grep --file=<(print_conflicting_files "${pkg}" | cut -d ' ' -f8- | sed -e 's,.*, &$,') \
<( tmp_merge_install_inventory_files "${TMPINSTALL[@]}" ) \
| grep -v -E "^${pkgfullname}-[^-]+-[^-]+ "
| grep -v -E "^$(ere_quote "${pkgfullname}")-[^-]+-[^-]+ "
}

function cache_conflicts() {
Expand All @@ -118,7 +122,7 @@ function print_conflicting_files_for_pkg() {
local inventory=$2

cache_conflicts ${inventory} \
| grep -E "^${pkg} "
| grep -E "^$(ere_quote "${pkg}")"
}

function cache_uniq() {
Expand All @@ -144,7 +148,7 @@ function print_uniq_files_for_pkg() {
local inventory=$2

cache_uniq ${inventory} \
| grep -E "^${pkg} "
| grep -E "^$(ere_quote "${pkg}")"
}

function print_missing_files() {
Expand All @@ -161,7 +165,7 @@ function print_missing_files() {
echo "${line}"
fi
done < <( tmp_merge_install_inventory_files "${TMPINSTALL[@]}" ) \
| grep -E "^${pkg} "
| grep -E "^$(ere_quote "${pkg}")"
}

function tmp_merge_install_inventory_files() {
Expand Down
5 changes: 5 additions & 0 deletions src/bee-init.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ function initialize() {
surl="${surl} ${pname}.tar.gz"
fi

if [[ $surl =~ ^https://github\.molgen\.mpg\.de/([^/]+)/([^/]+)/archive/(.+)\.tar\.gz$ ]] ; then
pname="${BASH_REMATCH[2]}-${BASH_REMATCH[3]#v}"
fi

if [[ "${OPT_BUILDTYPE}" = "r-package" || "${surl}" = http://cran.r-project.org/src/contrib/* ]] ; then
local cran_pname
local cran_version
Expand Down Expand Up @@ -301,6 +305,7 @@ function initialize() {

sed -e "s,@DEFAULT_CONFIGURE_OPTIONS@,${DEFAULT_CONFIGURE_OPTIONS}," \
-e "s,@DEFAULT_CONFIGURE_OPTIONS_NOTSET@,${DEFAULT_CONFIGURE_OPTIONS_NOTSET}," \
-e 's/\s$//' \
-i ${beefile}

for i in prefix eprefix bindir sbindir libexecdir sysconfdir \
Expand Down
3 changes: 2 additions & 1 deletion src/bee-install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ function do_install_file() {
--transform="s,^META$,${BEE_METADIR}/${pkg}/META," \
--transform="s,^PATCHES,${BEE_METADIR}/${pkg}/PATCHES," \
--transform="s,^DEPENDENCIES$,${BEE_METADIR}/${pkg}/DEPENDENCIES.deprecated," \
--show-transformed-names
--show-transformed-names \
|| exit 1

if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT.INSTALL" ] ; then
# create CONTENT.INSTALL from CONTENT.FILES
Expand Down
16 changes: 13 additions & 3 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ VERSION=${BEE_VERSION}
# load libs
. ${BEE_LIBEXECDIR}/bee/beelib.config.sh

umask 022

function bee-cache() {
${BEE_LIBEXECDIR}/bee/bee.d/bee-cache "${@}"
}
Expand Down Expand Up @@ -729,7 +731,11 @@ function verify_new_package_variables() {
exit 1
fi
PKGNAME=${PKGFULLNAME//_*}
PKGEXTRANAME=${PKGFULLNAME#*_}
if [ "$PKGNAME" = "$PKGFULLNAME" ] ; then
PKGEXTRANAME=""
else
PKGEXTRANAME=${PKGFULLNAME#*_}
fi
fi
PKGFULLNAME="${PKGNAME}${PKGEXTRANAME:+_${PKGEXTRANAME}}"

Expand All @@ -740,7 +746,11 @@ function verify_new_package_variables() {
exit 1
fi
PKGVERSION=${PKGFULLVERSION//_*}
PKGEXTRAVERSION=${PKGFULLVERSION#*_}
if [ "$PKGVERSION" = "$PKGFULLVERSION" ] ; then
PKGEXTRAVERSION=""
else
PKGEXTRAVERSION=${PKGFULLVERSION#*_}
fi
fi
PKGFULLVERSION="${PKGVERSION}${PKGEXTRAVERSION:+_${PKGEXTRAVERSION}}"
}
Expand Down Expand Up @@ -780,7 +790,7 @@ function extract_new_package_variables() {
PKGFULLPKG=${PKGFULLNAME}-${PKGFULLVERSION}-${PKGREVISION}

# since PKGARCH is now known reconstruct PKGALLPKG
: ${PKGALLPKG:=${PKGFULLPKG}.${PKGARCH}}
PKGALLPKG="${PKGFULLPKG}.${PKGARCH}"

eval $("${BEE_BINDIR}/beeversion" "${PKGALLPKG}")
}
Expand Down

0 comments on commit c5502af

Please sign in to comment.