cookutils annotate modules/qa @ rev 1056
Ability to change $VERSION in the receipt.
| author | Aleksej Bobylev <al.bobylev@gmail.com> |
|---|---|
| date | Thu May 17 23:42:39 2018 +0300 (2018-05-17) |
| parents | |
| children |
| rev | line source |
|---|---|
| al@890 | 1 #!/bin/sh |
| al@890 | 2 # |
| al@890 | 3 # qa - module of the SliTaz Cook |
| al@890 | 4 # Copyright (C) SliTaz GNU/Linux - GNU GPL v3 |
| al@890 | 5 # |
| al@890 | 6 |
| al@890 | 7 . /usr/lib/slitaz/libcook.sh |
| al@890 | 8 |
| al@890 | 9 |
| al@890 | 10 result() { |
| al@890 | 11 # using external $rule, $check |
| al@890 | 12 [ -n "$check" ] || return |
| al@890 | 13 echo "$rule:" |
| al@890 | 14 echo "$check" | awk '{printf(" %s\n", $0)}' |
| al@890 | 15 echo |
| al@890 | 16 } |
| al@890 | 17 |
| al@890 | 18 # FHS: http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html |
| al@890 | 19 |
| al@890 | 20 # FHS 3.16.2 |
| al@890 | 21 rule='Subdirectories in /sbin' |
| al@890 | 22 check="$(find $root/sbin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")" |
| al@890 | 23 result |
| al@890 | 24 |
| al@890 | 25 # FHS 4.2, 4.3 |
| al@890 | 26 rule='Non-standard directories in /usr' |
| al@890 | 27 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/|')" |
| al@890 | 28 result |
| al@890 | 29 |
| al@890 | 30 # FHS 4.4.2 |
| al@890 | 31 rule='Subdirectories in /usr/bin' |
| al@890 | 32 check="$(find $root/usr/bin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")" |
| al@890 | 33 result |
| al@890 | 34 |
| al@890 | 35 # FHS 4.9.1 |
| al@890 | 36 rule='Using /usr/local for system packages' |
| al@890 | 37 check="$(ls -d $root/usr/local 2>/dev/null | sed "s|^$root||")" |
| al@890 | 38 result |
| al@890 | 39 |
| al@890 | 40 # FHS 4.10.2 |
| al@890 | 41 rule='Subdirectories in /usr/sbin' |
| al@890 | 42 check="$(find $root/usr/sbin -mindepth 1 -type d 2>/dev/null | sed "s|^$root||")" |
| al@890 | 43 result |
| al@890 | 44 |
| al@890 | 45 |
| al@890 | 46 |
| al@890 | 47 exit 0 |
| al@890 | 48 |
| al@890 | 49 echo 'Check extra folders' |
| al@890 | 50 |
| al@890 | 51 for i in /bin /sbin /usr/bin /usr/sbin; do |
| al@890 | 52 find $i -mindepth 1 -type d |
| al@890 | 53 done |
| al@890 | 54 |
| al@890 | 55 |
| al@890 | 56 echo 'Check bad folders' |
| al@890 | 57 |
| al@890 | 58 for i in /usr/etc /usr/man; do |
| al@890 | 59 find $i -type d -maxdepth 0 |
| al@890 | 60 done |
| al@890 | 61 |
| al@890 | 62 |
| al@890 | 63 echo '' |
| al@890 | 64 |
| al@890 | 65 |
| al@890 | 66 case dir in |
| al@890 | 67 bin) user='root'; maskf='+022'; maskd='+777';; |
| al@890 | 68 etc/init.d) user='root'; maskf='!755' |
| al@890 | 69 etc) user='root'; maskf='+133'; permd='';; |
| al@890 | 70 /usr/share/applications) find /usr/share/applications -maxdepth 1 \( -type d -o ! -user root -o ! -perm 644 \) -exec ls -land {} \; |
| al@890 | 71 esac |