diff --git a/hooks/gconf-install-schemas.sh b/hooks/gconf-install-schemas.sh index ca4ad6f..b542b9d 100644 --- a/hooks/gconf-install-schemas.sh +++ b/hooks/gconf-install-schemas.sh @@ -38,7 +38,7 @@ fi case "${action}" in "post-install") - for s in $(grep -o "/.*gconf.*\.schemas" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for s in $(grep -o "/.*gconf.*\.schemas" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "installing schema '${s##*/}'" ${GCONFTOOL} --install-schema-file ${s} >/dev/null done diff --git a/hooks/gdk-pixbuf-query-loaders.sh b/hooks/gdk-pixbuf-query-loaders.sh index 3ab84c7..3a658cc 100644 --- a/hooks/gdk-pixbuf-query-loaders.sh +++ b/hooks/gdk-pixbuf-query-loaders.sh @@ -41,7 +41,7 @@ if [ -z "${gdk_pixbuf_moduledir}" -o -z "${gdk_pixbuf_cache_file}" ]; then exit 0 fi -if grep -q "file=${gdk_pixbuf_moduledir}" ${BEE_METADIR}/${pkg}/FILES ; then +if grep -q "file=${gdk_pixbuf_moduledir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${gdk_pixbuf_cache_file} diff --git a/hooks/glib-compile-schemas.sh b/hooks/glib-compile-schemas.sh index 61bfb3d..45371fc 100644 --- a/hooks/glib-compile-schemas.sh +++ b/hooks/glib-compile-schemas.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do schema_dir=${dir}/glib-2.0/schemas - if grep -q "file=${schema_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${schema_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${schema_dir}/gschemas.compiled diff --git a/hooks/gtk-update-icon-cache.sh b/hooks/gtk-update-icon-cache.sh index 90df83a..d67b358 100644 --- a/hooks/gtk-update-icon-cache.sh +++ b/hooks/gtk-update-icon-cache.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do icon_base_dir=${dir}/icons - for line in $(grep -h "file=${icon_base_dir}/.*/index.theme" ${BEE_METADIR}/${pkg}/FILES) ; do + for line in $(grep -h "file=${icon_base_dir}/.*/index.theme" ${BEE_METADIR}/${pkg}/CONTENT) ; do eval $(beesep ${line}) icon_dir=${file%%/index.theme} case "${action}" in diff --git a/hooks/info-dir.sh b/hooks/info-dir.sh index 2475b32..170d797 100644 --- a/hooks/info-dir.sh +++ b/hooks/info-dir.sh @@ -50,13 +50,13 @@ fi case "${action}" in "post-install") - for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "adding ${i##*/} to ${DIRFILE}" ${INSTALLINFO} ${i} ${DIRFILE} >/dev/null done ;; "pre-remove") - for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/FILES 2>/dev/null) ; do + for i in $(grep -o "${PKG_INFODIR}.*\.info.*" ${BEE_METADIR}/${pkg}/CONTENT 2>/dev/null) ; do echo "removing ${i##*/} from ${DIRFILE}" ${INSTALLINFO} --delete ${i} ${DIRFILE} >/dev/null done diff --git a/hooks/ldconfig.sh b/hooks/ldconfig.sh index 0233e8a..5f94bc7 100644 --- a/hooks/ldconfig.sh +++ b/hooks/ldconfig.sh @@ -38,7 +38,7 @@ if ! which ldconfig >/dev/null 2>&1 ; then exit 0 fi -if grep -q "/lib/" ${BEE_METADIR}/${pkg}/FILES ; then +if grep -q "/lib/" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") ldconfig diff --git a/hooks/mandb.sh b/hooks/mandb.sh index 6cfe35a..62ef6dc 100644 --- a/hooks/mandb.sh +++ b/hooks/mandb.sh @@ -44,7 +44,7 @@ fi for man_dir in $(beeuniq ${man_dirs//:/ }) ; do case "${action}" in "post-install") - for line in $(grep "file=${man_dir}" ${BEE_METADIR}/${pkg}/FILES) ; do + for line in $(grep "file=${man_dir}" ${BEE_METADIR}/${pkg}/CONTENT) ; do eval $(beesep ${line}) if [ -f "${file}" -o -L "${file}" ] ; then if [ -f "/var/cache/man/index.db" ] ; then @@ -58,7 +58,7 @@ for man_dir in $(beeuniq ${man_dirs//:/ }) ; do done ;; "post-remove") - if grep -q "file=${man_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${man_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then echo "updating manual index cache for ${man_dir} .." mandb -q ${man_dir} fi diff --git a/hooks/mkfontdir-mkfontscale.sh b/hooks/mkfontdir-mkfontscale.sh index 35f47c6..c499abe 100644 --- a/hooks/mkfontdir-mkfontscale.sh +++ b/hooks/mkfontdir-mkfontscale.sh @@ -55,7 +55,7 @@ function update_fonts() { for dir in ${XDG_DATA_DIRS//:/ } ; do font_base_dir=${dir}/fonts - if grep -q "file=${font_base_dir}" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${font_base_dir}" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") clean_font_dirs ${font_base_dir} diff --git a/hooks/systemd-tmpfiles.sh b/hooks/systemd-tmpfiles.sh index 6e90a12..173b27f 100644 --- a/hooks/systemd-tmpfiles.sh +++ b/hooks/systemd-tmpfiles.sh @@ -40,7 +40,7 @@ fi case "${action}" in "post-install") - if egrep --max-count=1 "file=(/etc|/lib|/usr/lib)/tmpfiles.d" ${BEE_METADIR}/${pkg}/FILES >/dev/null 2>&1 ; then + if egrep --max-count=1 "file=(/etc|/lib|/usr/lib)/tmpfiles.d" ${BEE_METADIR}/${pkg}/CONTENT >/dev/null 2>&1 ; then systemd-tmpfiles --create fi ;; diff --git a/hooks/update-desktop-database.sh b/hooks/update-desktop-database.sh index b9cb433..48d8f48 100644 --- a/hooks/update-desktop-database.sh +++ b/hooks/update-desktop-database.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do desktop_dir=${dir}/applications - if grep -q "file=${desktop_dir}/.*\.desktop" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${desktop_dir}/.*\.desktop" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") rm -f ${desktop_dir}/mimeinfo.cache diff --git a/hooks/update-mime-database.sh b/hooks/update-mime-database.sh index 77fc472..451aa70 100644 --- a/hooks/update-mime-database.sh +++ b/hooks/update-mime-database.sh @@ -36,7 +36,7 @@ fi for dir in ${XDG_DATA_DIRS//:/ } ; do mime_dir=${dir}/mime - if grep -q "file=${mime_dir}/packages" ${BEE_METADIR}/${pkg}/FILES ; then + if grep -q "file=${mime_dir}/packages" ${BEE_METADIR}/${pkg}/CONTENT ; then case "${action}" in "post-install") update-mime-database ${mime_dir} diff --git a/src/bee-remove.sh.in b/src/bee-remove.sh.in index 6d57239..a32a888 100644 --- a/src/bee-remove.sh.in +++ b/src/bee-remove.sh.in @@ -41,15 +41,9 @@ pkg_remove_all() { pkg_remove() { search=$1 - # pattern is absolute path to pkg - if [ -d "${search}" ] ; then - do_remove "${search}" - return - fi - # pattern is a pkg in BEE_METADIR if [ -d "${BEE_METADIR}/${search}" ] ; then - do_remove ${BEE_METADIR}/${search} + do_remove ${search} return fi @@ -62,15 +56,21 @@ pkg_remove() { do_remove() { pkg=${1} - FILES=$(${BEE_LIBEXECDIR}/bee/bee.d/bee-dep remove --print ${pkg##*/}) + if [ ! -e "${BEE_METADIR}/${pkg}/CONTENT" ] ; then + ${BEE_LIBEXECDIR}/bee/compat-filesfile2contentfile \ + ${BEE_METADIR}/${pkg}/FILES \ + >${BEE_METADIR}/${pkg}/CONTENT + fi + + FILES=$(${BEE_LIBEXECDIR}/bee/bee.d/bee-dep remove --print ${pkg}) if [ $? -ne 0 ] ; then - echo "removal of ${pkg##*/} failed" + echo "removal of ${pkg} failed" exit 1 fi [ "${NOOP}" != "yes" ] && run_hooks pre-remove ${pkg} - echo "removing package '${pkg##*/}'" + echo "removing package '${pkg}'" # removing files for f in $FILES ; do @@ -83,8 +83,8 @@ do_remove() { [ "${NOOP}" != "yes" ] && run_hooks post-remove ${pkg} - if [ -r "${pkg}/META" ] ; then - . ${pkg}/META + if [ -r "${BEE_METADIR}/${pkg}/META" ] ; then + . "${BEE_METADIR}/${pkg}/META" fi # removing empty basedirs @@ -97,15 +97,13 @@ do_remove() { done fi - #cleaning up meta directory - if [ -d "${pkg}" ] ; then - ${NOOP:+echo} rm -fr ${OPT_VERBOSE:+-v} ${pkg} - fi + #cleanup meta directory + ${NOOP:+echo} rm -fr ${OPT_VERBOSE:+-v} ${BEE_METADIR}/${pkg} } function run_hooks() { local action=${1} - local pkg=${2##*/} + local pkg=${2} for t in ${BEE_LIBEXECDIR}/bee/hooks.d/* ; do ${t} ${action} ${pkg} @@ -133,6 +131,7 @@ options=$(${BEE_BINDIR}/beegetopt --name bee-remove \ --option verbose/v \ --option help/h \ -- "$@") + if [ $? != 0 ] ; then usage exit 1