cookutils diff modules/qa @ rev 1075

Add default package icon
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jun 11 15:26:30 2018 +0300 (2018-06-11)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/qa	Mon Jun 11 15:26:30 2018 +0300
     1.3 @@ -0,0 +1,71 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# qa - module of the SliTaz Cook
     1.7 +# Copyright (C) SliTaz GNU/Linux - GNU GPL v3
     1.8 +#
     1.9 +
    1.10 +. /usr/lib/slitaz/libcook.sh
    1.11 +
    1.12 +
    1.13 +result() {
    1.14 +	# using external $rule, $check
    1.15 +	[ -n "$check" ] || return
    1.16 +	echo "$rule:"
    1.17 +	echo "$check" | awk '{printf("  %s\n", $0)}'
    1.18 +	echo
    1.19 +}
    1.20 +
    1.21 +# FHS: http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html
    1.22 +
    1.23 +# FHS 3.16.2
    1.24 +rule='Subdirectories in /sbin'
    1.25 +check="$(find $root/sbin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")"
    1.26 +result
    1.27 +
    1.28 +# FHS 4.2, 4.3
    1.29 +rule='Non-standard directories in /usr'
    1.30 +check="$(ls $root/usr 2>/dev/null | sed '/^bin$/d; /^lib$/d; /^local$/d; /^sbin$/d; /^share$/d; /^games$/d; /^include$/d; /^libexec$/d; /^lib[0-9][0-9]*$/d; /^src$/d' | sed 's|^|/usr/|')"
    1.31 +result
    1.32 +
    1.33 +# FHS 4.4.2
    1.34 +rule='Subdirectories in /usr/bin'
    1.35 +check="$(find $root/usr/bin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")"
    1.36 +result
    1.37 +
    1.38 +# FHS 4.9.1
    1.39 +rule='Using /usr/local for system packages'
    1.40 +check="$(ls -d $root/usr/local 2>/dev/null | sed "s|^$root||")"
    1.41 +result
    1.42 +
    1.43 +# FHS 4.10.2
    1.44 +rule='Subdirectories in /usr/sbin'
    1.45 +check="$(find $root/usr/sbin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")"
    1.46 +result
    1.47 +
    1.48 +
    1.49 +
    1.50 +exit 0
    1.51 +
    1.52 +echo 'Check extra folders'
    1.53 +
    1.54 +for i in /bin /sbin /usr/bin /usr/sbin; do
    1.55 +	find $i -mindepth 1 -type d
    1.56 +done
    1.57 +
    1.58 +
    1.59 +echo 'Check bad folders'
    1.60 +
    1.61 +for i in /usr/etc /usr/man; do
    1.62 +	find $i -type d -maxdepth 0
    1.63 +done
    1.64 +
    1.65 +
    1.66 +echo ''
    1.67 +
    1.68 +
    1.69 +case dir in
    1.70 +	bin)		user='root'; maskf='+022'; maskd='+777';;
    1.71 +	etc/init.d)	user='root'; maskf='!755'
    1.72 +	etc)		user='root'; maskf='+133'; permd='';;
    1.73 +	/usr/share/applications) find /usr/share/applications -maxdepth 1 \( -type d -o ! -user root -o ! -perm 644 \) -exec ls -land {} \;
    1.74 +esac