tazpkg rev 929

modules/install and modules/remove: auto-update /ets/filesystems for the FS Kernel modules
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Jan 01 23:01:52 2017 +0200 (2017-01-01)
parents 4fa1ea055f78
children ecbca6dbf6fb
files modules/install modules/remove
line diff
     1.1 --- a/modules/install	Sun Nov 20 00:12:08 2016 +0200
     1.2 +++ b/modules/install	Sun Jan 01 23:01:52 2017 +0200
     1.3 @@ -527,14 +527,19 @@
     1.4  	# Updating DBs is important process, so not to hide such errors (localized):
     1.5  	# chroot: can't execute '/usr/bin/***': No such file or directory
     1.6  
     1.7 -	local fl="$INSTALLED/$PACKAGE/files.list" upd=0 udesk umime uicon uschm ukrnl
     1.8 +	local fl="$INSTALLED/$PACKAGE/files.list" upd=0 udesk umime uicon uschm ukrnl ukrnlfs
     1.9  
    1.10 -	fgrep    /usr/share/applications/ "$fl" | fgrep -q .desktop && udesk='yes'
    1.11 -	fgrep -q /usr/share/mime "$fl" && umime='yes'
    1.12 -	fgrep -q /usr/share/icon/hicolor "$fl" && uicon='yes'
    1.13 -	fgrep -q /usr/share/glib-2.0/schemas "$fl" && uschm='yes'
    1.14 -	fgrep    /usr/lib/gdk-pixbuf "$fl" | fgrep -q .so && upixb='yes'
    1.15 -	fgrep -q /lib/modules "$fl" && ukrnl='yes'
    1.16 +	fgrep    /usr/share/applications/    "$fl" | fgrep -q .desktop && udesk='yes'
    1.17 +	fgrep -q /usr/share/mime             "$fl" && umime='yes'
    1.18 +	fgrep -q /usr/share/icon/hicolor     "$fl" && uicon='yes'
    1.19 +	fgrep    /usr/share/glib-2.0/schemas "$fl" | fgrep -q .xml && uschm='yes'
    1.20 +	fgrep    /usr/lib/gdk-pixbuf         "$fl" | fgrep -q .so && upixb='yes'
    1.21 +	if fgrep -q /lib/modules             "$fl"; then
    1.22 +		ukrnl='yes'
    1.23 +		if fgrep -q /kernel/fs/ "$fl"; then
    1.24 +			ukrnlfs='yes'
    1.25 +		fi
    1.26 +	fi
    1.27  
    1.28  	if [ -n "$udesk$umime$uicon$uschm$upixb$ukrnl" ]; then
    1.29  		action 'Update system databases...'
    1.30 @@ -553,6 +558,13 @@
    1.31  	[ -n "$uschm" ] && chroot "$root/" /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas 2>&1 | fgrep -v '/apps/'
    1.32  	# package 'gdk-pixbuf'
    1.33  	[ -n "$upixb" ] && chroot "$root/" /usr/bin/gdk-pixbuf-query-loaders --update-cache
    1.34 +
    1.35 +	if [ -n "$ukrnlfs" ]; then
    1.36 +		for i in $(awk -F/ '{if($6=="fs" && $8~$7)print $7}' "$fl" | sort -u); do
    1.37 +			touch "$root/etc/filesystems"
    1.38 +			grep "^$i\$" "$root/etc/filesystems" || echo "$i" >> "$root/etc/filesystems"
    1.39 +		done
    1.40 +	fi
    1.41  	# packages 'busybox', 'kmod', 'depmod'
    1.42  	[ -n "$ukrnl" ] && grep '/lib/modules' "$fl" | cut -d'/' -f4 | uniq | xargs chroot "$root/" /sbin/depmod -a
    1.43  
     2.1 --- a/modules/remove	Sun Nov 20 00:12:08 2016 +0200
     2.2 +++ b/modules/remove	Sun Jan 01 23:01:52 2017 +0200
     2.3 @@ -213,12 +213,17 @@
     2.4  # [4/5] Update system databases
     2.5  fl="$INSTALLED/$PACKAGE/files.list"; upd=0
     2.6  
     2.7 -fgrep    /usr/share/applications/ "$fl" | fgrep -q .desktop && udesk='yes'
     2.8 -fgrep -q /usr/share/mime "$fl" && umime='yes'
     2.9 -fgrep -q /usr/share/icon/hicolor "$fl" && uicon='yes'
    2.10 -fgrep -q /usr/share/glib-2.0/schemas "$fl" && uschm='yes'
    2.11 -fgrep    /usr/lib/gdk-pixbuf "$fl" | fgrep -q .so && upixb='yes'
    2.12 -fgrep -q /lib/modules "$fl" && ukrnl='yes'
    2.13 +fgrep    /usr/share/applications/    "$fl" | fgrep -q .desktop && udesk='yes'
    2.14 +fgrep -q /usr/share/mime             "$fl" && umime='yes'
    2.15 +fgrep -q /usr/share/icon/hicolor     "$fl" && uicon='yes'
    2.16 +fgrep    /usr/share/glib-2.0/schemas "$fl" | fgrep -q .xml && uschm='yes'
    2.17 +fgrep    /usr/lib/gdk-pixbuf         "$fl" | fgrep -q .so && upixb='yes'
    2.18 +if fgrep -q /lib/modules             "$fl"; then
    2.19 +	ukrnl='yes'
    2.20 +	if fgrep -q /kernel/fs/ "$fl"; then
    2.21 +		ukrnlfs='yes'
    2.22 +	fi
    2.23 +fi
    2.24  
    2.25  if [ -n "$udesk$umime$uicon$uschm$upixb$ukrnl" ]; then
    2.26  	action 'Update system databases...'
    2.27 @@ -237,6 +242,12 @@
    2.28  [ -n "$uschm" ] && chroot "$root/" /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas 2>&1 | fgrep -v '/apps/'
    2.29  # package 'gdk-pixbuf'
    2.30  [ -n "$upixb" ] && chroot "$root/" /usr/bin/gdk-pixbuf-query-loaders --update-cache
    2.31 +
    2.32 +if [ -n "$ukrnlfs" ]; then
    2.33 +	for i in $(awk -F/ '{if($6=="fs" && $8~$7)print $7}' "$fl" | sort -u); do
    2.34 +		grep -i "/^$i\$/d" "$root/etc/filesystems"
    2.35 +	done
    2.36 +fi
    2.37  # packages 'busybox', 'kmod', 'depmod'
    2.38  [ -n "$ukrnl" ] && grep '/lib/modules' "$fl" | cut -d'/' -f4 | uniq | xargs chroot "$root/" /sbin/depmod -a
    2.39