Skip to content

Commit

Permalink
hooks: change way of checking for binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jul 20, 2011
1 parent d759b65 commit b12bca1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 42 deletions.
9 changes: 3 additions & 6 deletions src/hooks.d/gdk-pixbuf-query-loaders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="gdk-pixbuf-query-loaders"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which gdk-pixbuf-query-loaders >/dev/null 2>&1 ; then
exit 0
fi

gdk_pixbuf_moduledir=$(pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0)
gdk_pixbuf_cache_file=$(pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0)
Expand Down
9 changes: 3 additions & 6 deletions src/hooks.d/glib-compile-schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="glib-compile-schemas"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which glib-compile-schemas >/dev/null 2>&1 ; then
exit 0
fi

for dir in ${XDG_DATA_DIRS//:/ } ; do
schema_dir=${dir}/glib-2.0/schemas
Expand Down
9 changes: 3 additions & 6 deletions src/hooks.d/gtk-update-icon-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="gtk-update-icon-cache"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which gtk-update-icon-cache >/dev/null 2>&1 ; then
exit 0
fi

for dir in ${XDG_DATA_DIRS//:/ } ; do
icon_base_dir=${dir}/icons
Expand Down
13 changes: 7 additions & 6 deletions src/hooks.d/ldconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="ldconfig"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if [ ${UID} -ne 0 ] ; then
exit 0
fi

if ! which ldconfig >/dev/null 2>&1 ; then
exit 0
fi

if grep -q "/lib/" ${BEE_METADIR}/${pkg}/FILES ; then
case "${action}" in
Expand Down
9 changes: 3 additions & 6 deletions src/hooks.d/mkfontdir-mkfontscale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="mkfontscale mkfontdir"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which mkfontscale mkfontdir >/dev/null 2>&1 ; then
exit 0
fi

function clean_font_dirs() {
local font_base_dir=${1}
Expand Down
9 changes: 3 additions & 6 deletions src/hooks.d/update-desktop-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="update-desktop-database"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which update-desktop-database >/dev/null 2>&1 ; then
exit 0
fi

for dir in ${XDG_DATA_DIRS//:/ } ; do
desktop_dir=${dir}/applications
Expand Down
9 changes: 3 additions & 6 deletions src/hooks.d/update-mime-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ -z ${BEE_VERSION} ] ; then
exit 1
fi

binaries="update-mime-database"
for bin in ${binaries} ; do
if [ -z "$(which ${bin} 2>/dev/null)" ] ; then
exit 0
fi
done
if ! which update-mime-database >/dev/null 2>&1 ; then
exit 0
fi

for dir in ${XDG_DATA_DIRS//:/ } ; do
mime_dir=${dir}/mime
Expand Down

0 comments on commit b12bca1

Please sign in to comment.