This commit is contained in:
emmett1
2017-08-14 07:23:36 +08:00
parent eceaa829ef
commit 13a96b1196
2 changed files with 28 additions and 21 deletions

View File

@@ -90,7 +90,7 @@ nocolor() {
updatesystemdb() {
# update desktop database
msg2 "Updating desktop database..."
#msg2 "Updating desktop database..."
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q /usr/share/applications >/dev/null 2>&1
fi
@@ -102,7 +102,7 @@ updatesystemdb() {
#fi
# update icon cache
msg2 "Updating icon cache..."
#msg2 "Updating icon cache..."
if [ -f /usr/bin/gtk-update-icon-cache ]; then
find /usr/share/icons -mindepth 1 -maxdepth 1 -type d | while read -r THEME; do
if [ -f "$THEME/index.theme" ]; then
@@ -112,7 +112,7 @@ updatesystemdb() {
fi
# update glib schema
msg2 "Updating glib schemas..."
#msg2 "Updating glib schemas..."
if [ -e /usr/share/glib-2.0/schemas ]; then
if [ -x /usr/bin/glib-compile-schemas ]; then
/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1
@@ -120,7 +120,7 @@ updatesystemdb() {
fi
# run ldconfig
msg2 "Running ldconfig..."
#msg2 "Running ldconfig..."
if [ -f /sbin/ldconfig ]; then
/sbin/ldconfig
fi

41
scratch
View File

@@ -22,8 +22,11 @@ pushtoport() {
listinstalled() {
for installed in $(ls $INDEX_DIR); do
getinstalledname $installed
msg3 $installedname
installedpkg+=($installed)
#msg3 $installedname
installedpkg+=($installedname)
done
for ip in ${installedpkg[@]}; do
echo $ip
done
msg "Total installed package: ${#installedpkg[@]}"
}
@@ -58,17 +61,21 @@ listorphan() {
break
fi
done
if [ $ORPHAN = yes ]; then
msg $installedname
if [ "$ORPHAN" = yes ]; then
ORPHAN_PKG+=($installedname)
#msg $installedname
fi
done
for i in ${ORPHAN_PKG[@]}; do
echo $i
done
msg "Total orphan package: ${#ORPHAN_PKG[@]}"
}
searchpkg() {
for port in ${PORT_REPO[@]}; do
OUTPUT=()
if [ -d $port ]; then
for list in $(ls $port); do
if [ -f $port/$list/$BUILD_SCRIPT ]; then
@@ -197,7 +204,7 @@ showdepends() {
for dep in ${depends[@]}; do
if [ -d $INDEX_DIR/$dep ]; then
msg "${color_green}$dep${color_reset}"
msg2 "${color_green}$dep${color_reset}"
else
PORT_EXIST=no
for port in ${PORT_REPO[@]}; do
@@ -207,15 +214,15 @@ showdepends() {
fi
done
case $PORT_EXIST in
yes) msg "${color_yellow}$dep${color_reset}" ;;
no) msg "${color_red}$dep${color_reset}" ;;
yes) msg2 "${color_yellow}$dep${color_reset}" ;;
no) msg2 "${color_red}$dep${color_reset}" ;;
esac
fi
done
for mdep in ${makedepends[@]}; do
if [ -d $INDEX_DIR/$mdep ]; then
msg "${color_green}$mdep${color_reset} (make)"
msg2 "${color_green}$mdep${color_reset} (make)"
else
PORT_EXIST=no
for port in ${PORT_REPO[@]}; do
@@ -225,8 +232,8 @@ showdepends() {
fi
done
case $PORT_EXIST in
yes) msg "${color_yellow}$mdep${color_reset} (make)" ;;
no) msg "${color_red}$mdep${color_reset} (make)" ;;
yes) msg2 "${color_yellow}$mdep${color_reset} (make)" ;;
no) msg2 "${color_red}$mdep${color_reset} (make)" ;;
esac
fi
done
@@ -261,13 +268,13 @@ showdependent() {
depend=$(cat $INDEX_DIR/$all_installed/.pkginfo | grep ^depends | cut -d " " -f3-)
for dep in ${depend[@]}; do
if [ $dep = $PACKAGE_DEPENDENT ]; then
msg "$all_installed"
msg2 "$all_installed"
fi
done
makedepend=$(cat $INDEX_DIR/$all_installed/.pkginfo | grep ^makedepends | cut -d " " -f3-)
for mdep in ${makedepend[@]}; do
if [ $mdep = $PACKAGE_DEPENDENT ]; then
msg "$all_installed (make)"
msg2 "$all_installed (make)"
fi
done
done
@@ -289,9 +296,9 @@ showglobaldependent() {
for dep in ${depend[@]}; do
if [ $dep = $GLOBAL_PACKAGE_DEPENDENT ]; then
if [ -d $INDEX_DIR/$all ]; then
msg "${color_green}$all${color_reset}"
msg2 "${color_green}$all${color_reset}"
else
msg "${color_yellow}$all${color_reset}"
msg2 "${color_yellow}$all${color_reset}"
fi
fi
done
@@ -299,9 +306,9 @@ showglobaldependent() {
for mdep in ${makedepend[@]}; do
if [ $mdep = $GLOBAL_PACKAGE_DEPENDENT ]; then
if [ -d $INDEX_DIR/$all ]; then
msg "${color_green}$all${color_reset} (make)"
msg2 "${color_green}$all${color_reset} (make)"
else
msg "${color_yellow}$all${color_reset} (make)"
msg2 "${color_yellow}$all${color_reset} (make)"
fi
fi
done