-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hooks: bee-install: remove defect pre-install hook hooks: grep more specific hooks: update-mime-database be less verbose hooks: change way of checking for binaries hooks: use pkg-config in gdk-pixbuf-query-loaders hook-tools: gdk-pixbuf-query-loaders.sh - tool to update pixbuf loaders cache hook-tools: update-desktop-database.sh - tool to update mimeinfo cache hook-tools: ldconfig.sh - new tool to update library database hook-tools: gtk-update-icon-cache.sh - tool to update icon cache hook-tools: mkfontdir-mkfontscale.sh - tool to update fonts hook-tools: glib-compile-schemas.sh - tool to update schemas hook-tools: update-mime-database.sh - added updating of mime databases Makefile/bee-install/bee-remove: added auto execution of hooks
- Loading branch information
Showing
10 changed files
with
254 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
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) | ||
|
||
if grep -q "file=${gdk_pixbuf_moduledir}" ${BEE_METADIR}/${pkg}/FILES ; then | ||
case "${action}" in | ||
"post-install") | ||
rm -f ${gdk_pixbuf_cache_file} | ||
gdk-pixbuf-query-loaders --update-cache | ||
;; | ||
"pre-remove") | ||
rm -f ${gdk_pixbuf_cache_file} | ||
;; | ||
"post-remove") | ||
gdk-pixbuf-query-loaders --update-cache | ||
;; | ||
esac | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
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 | ||
if grep -q "file=${schema_dir}" ${BEE_METADIR}/${pkg}/FILES ; then | ||
case "${action}" in | ||
"post-install") | ||
rm -f ${schema_dir}/gschemas.compiled | ||
glib-compile-schemas ${schema_dir} | ||
;; | ||
"pre-remove") | ||
rm -f ${schema_dir}/gschemas.compiled | ||
;; | ||
"post-remove") | ||
glib-compile-schemas ${schema_dir} | ||
;; | ||
esac | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
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 | ||
for line in $(grep -h "file=${icon_base_dir}/.*/index.theme" ${BEE_METADIR}/${pkg}/FILES) ; do | ||
eval $(beesep ${line}) | ||
icon_dir=${file%%/index.theme} | ||
case "${action}" in | ||
"post-install") | ||
rm -f ${icon_dir}/icon-theme.cache | ||
gtk-update-icon-cache -f ${icon_dir} | ||
;; | ||
"pre-remove") | ||
rm -f ${icon_dir}/icon-theme.cache | ||
;; | ||
esac | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
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 | ||
"post-install") | ||
ldconfig | ||
;; | ||
"post-remove") | ||
ldconfig | ||
;; | ||
esac | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
if ! which mkfontscale mkfontdir >/dev/null 2>&1 ; then | ||
exit 0 | ||
fi | ||
|
||
function clean_font_dirs() { | ||
local font_base_dir=${1} | ||
|
||
font_dirs=$(find ${font_base_dir} -mindepth 1 -type d) | ||
for d in ${font_dirs} ; do | ||
rm -f ${d}/fonts.{scale,dir} | ||
done | ||
} | ||
|
||
function update_fonts() { | ||
local font_base_dir=${1} | ||
|
||
font_dirs=$(find ${font_base_dir} -mindepth 1 -type d) | ||
for d in ${font_dirs} ; do | ||
mkfontscale ${d} | ||
mkfontdir ${d} | ||
done | ||
} | ||
|
||
for dir in ${XDG_DATA_DIRS//:/ } ; do | ||
font_base_dir=${dir}/fonts | ||
if grep -q "file=${font_base_dir}" ${BEE_METADIR}/${pkg}/FILES ; then | ||
case "${action}" in | ||
"post-install") | ||
clean_font_dirs ${font_base_dir} | ||
update_fonts ${font_base_dir} | ||
;; | ||
"pre-remove") | ||
clean_font_dirs ${font_base_dir} | ||
;; | ||
"post-remove") | ||
update_fonts ${font_base_dir} | ||
;; | ||
esac | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
if ! which update-desktop-database >/dev/null 2>&1 ; then | ||
exit 0 | ||
fi | ||
|
||
for dir in ${XDG_DATA_DIRS//:/ } ; do | ||
desktop_dir=${dir}/applications | ||
if grep -q "file=${desktop_dir}/.*\.desktop" ${BEE_METADIR}/${pkg}/FILES ; then | ||
case "${action}" in | ||
"post-install") | ||
rm -f ${desktop_dir}/mimeinfo.cache | ||
update-desktop-database ${desktop_dir} | ||
;; | ||
"pre-remove") | ||
rm -f ${desktop_dir}/mimeinfo.cache | ||
;; | ||
"post-remove") | ||
update-desktop-database ${desktop_dir} | ||
;; | ||
esac | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
action=${1} | ||
pkg=${2} | ||
|
||
if [ -z ${BEE_VERSION} ] ; then | ||
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." | ||
exit 1 | ||
fi | ||
|
||
if ! which update-mime-database >/dev/null 2>&1 ; then | ||
exit 0 | ||
fi | ||
|
||
for dir in ${XDG_DATA_DIRS//:/ } ; do | ||
mime_dir=${dir}/mime | ||
if grep -q "file=${mime_dir}/packages" ${BEE_METADIR}/${pkg}/FILES ; then | ||
case "${action}" in | ||
"post-install") | ||
update-mime-database ${mime_dir} | ||
;; | ||
"post-remove") | ||
update-mime-database ${mime_dir} | ||
;; | ||
esac | ||
fi | ||
done |