Давненько я не писал гневных отзывов :3
и так, поехали:
equery умеет проверять mtime, md5sum и вообще наличие файлов пакета.
отлично, запускаем
time equery k -o media-sound/*
* Checking media-sound/alsa-utils-1.0.26 ...
!!! /usr/share/locale/ja/LC_MESSAGES/alsaconf.mo does not exist
!!! /usr/share/man/fr/man8/alsaconf.8.bz2 does not exist
!!! /etc/modprobe.d/alsa.conf has incorrect MD5sum
98 out of 101 files passed
real 0m39.001s
user 0m12.596s
sys 0m15.984s
time sh scripts/portage/TEST media-sound/*
media-sound/alsa-utils-1.0.26: /etc/modprobe.d/alsa.conf has incorrect MD5sum
5462042462f06a0c15b2e9c9a5a81210 VS ccc2347c7466759e6155c3cdba15ec49
media-sound/alsa-utils-1.0.26: /etc/modprobe.d/alsa.conf has wrong mtime
1266641774 VS 1347201798
media-sound/alsa-utils-1.0.26: /usr/bin/aseqnet has incorrect MD5sum
6e7585b0da8f4dce1468333d5f866697 VS 2fd0f9ab382d49236a8de292952fbfd2
media-sound/alsa-utils-1.0.26: /usr/bin/aseqdump has incorrect MD5sum
6d3f033ff57e906a63aa0c777ae26b0d VS 8e1836c09aa19325001c89fd18e80b6e
media-sound/alsa-utils-1.0.26: /usr/bin/arecordmidi has incorrect MD5sum
46eaeba8c136f0e6d94b68ec2dd10fb5 VS dc403643d049dc3c332c661f05a22193
media-sound/alsa-utils-1.0.26: /usr/bin/aplaymidi has incorrect MD5sum
9dbe13f518aa7805832f778433fe3703 VS 169b5c456c445b9826f3537cbafdc51d
media-sound/alsa-utils-1.0.26: /usr/bin/aconnect has incorrect MD5sum
4c1229b9796e4e94b87e57763ab78c5b VS b413545a98030d53395b10ab7a343955
media-sound/alsa-utils-1.0.26: /usr/bin/alsaloop has incorrect MD5sum
09d6e1c5c68ee2f94c094abc5c6d8e76 VS a14e58bb8b1f89396f4d154f4f49fc96
media-sound/alsa-utils-1.0.26: /usr/bin/speaker-test has incorrect MD5sum
a93764cd4150b7fef14341c060886377 VS 0221c4e3796105e15a8a5cab6cd46e47
media-sound/alsa-utils-1.0.26: /usr/bin/iecset has incorrect MD5sum
6af1967e400160563be811670606b1fc VS fd481036578fbe0bb110e60e79bd2810
media-sound/alsa-utils-1.0.26: /usr/bin/aplay has incorrect MD5sum
edb9cfb8bd6743da5c54235bef9529c6 VS f2cd03a46d3f605d79820477eb5052e9
media-sound/alsa-utils-1.0.26: /usr/bin/amidi has incorrect MD5sum
7f91333592620b3e17131bf9fcc2fd42 VS d724d116dbd14ba6a3e71e03166bb55e
media-sound/alsa-utils-1.0.26: /usr/bin/amixer has incorrect MD5sum
12b49fdfd0578a1d76a5c1def6f92eea VS 065fea890aad3db9d038c9785f0ed0c0
media-sound/alsa-utils-1.0.26: /usr/bin/alsamixer has incorrect MD5sum
5966c39232ef2fd7d0609d596170fe83 VS 8eb3047d82464325aef85986d8505ab4
media-sound/alsa-utils-1.0.26: /usr/bin/alsaucm has incorrect MD5sum
e0f338a448f8ee7761fae31f072cb8aa VS b1f8ef5dee593e48a4f9aa0fa80e04ef
media-sound/alsa-utils-1.0.26: /usr/sbin/alsactl has incorrect MD5sum
34644aa083fac782fef497c7c364385c VS ee283adf83fec91e079a55f1884172b7
media-sound/alsa-utils-1.0.26: OBJ /usr/share/locale/ja/LC_MESSAGES/alsaconf.mo doesn't exist
media-sound/alsa-utils-1.0.26: OBJ /usr/share/man/fr/man8/alsaconf.8.bz2 doesn't exist
media-sound/cdparanoia-3.10.2-r4: /usr/lib/libcdda_paranoia.so.0.10.2 has incorrect MD5sum
d6d0067a20876b678aee46fe6736f35b VS b6aa617bdf90c5a8a224ca59045c2ba5
media-sound/cdparanoia-3.10.2-r4: /usr/lib/libcdda_interface.so.0.10.2 has incorrect MD5sum
02530220bf9ec37d4b7a3e846c3fc5ec VS 485f93b485dcb5727144a445d708b820
media-sound/cdparanoia-3.10.2-r4: /usr/bin/cdparanoia has incorrect MD5sum
3fc21e13cf5c1895275d5eff048c2828 VS fd33354e93810cf31190f11f468cf0a3
media-sound/deadbeef-9999: /usr/bin/deadbeef has incorrect MD5sum
b04d9afa1df6c0f981fec0d0be8cbf67 VS 4e521d9f2e2904056fd6325b52833ddf
media-sound/lame-3.99.5: /usr/bin/lame has incorrect MD5sum
586e358aadfb0b5d91d8bfe6647b8170 VS b3ec9d5107826c3bfa1bb34e40392bd9
media-sound/lame-3.99.5: /usr/lib/libmp3lame.so.0.0.0 has incorrect MD5sum
57a088da8b5518c85d7e6f466ef216c1 VS 668b2cb4598e850eae8b94ef8dcd7d9e
media-sound/mpg123-1.14.4: /usr/bin/mpg123 has incorrect MD5sum
37e0e00e2c591378499ac2c5fd624517 VS e86ca6bd9a9c95472ef4d2a68816f71a
media-sound/mpg123-1.14.4: /usr/lib/libmpg123.so.0.36.6 has incorrect MD5sum
686e622490a771bb902a1066e4c7c0e3 VS 5baf67ed743449fd64e9d1668f301564
media-sound/musepack-tools-465: /usr/bin/mpcgain has incorrect MD5sum
732fa9b4704421e63968d7f9a238fdd7 VS b08ed092c2bbf3ed40e9c908cd645b36
media-sound/musepack-tools-465: /usr/bin/mpcdec has incorrect MD5sum
97e9b2eb273184380f44da5f6cbd5625 VS 0669182d04ea1bc211fdff879b3c6175
media-sound/musepack-tools-465: /usr/bin/mpcenc has incorrect MD5sum
bee67878a0b52845dab04079ae53cddb VS ec600671d008f1c6d2946ba247333bd7
media-sound/musepack-tools-465: /usr/bin/mpc2sv8 has incorrect MD5sum
295f763d097499430583d405a326d461 VS f9f204507e3dfa14ff642c34c2d29a66
media-sound/musepack-tools-465: /usr/bin/mpccut has incorrect MD5sum
bb05150a5b80384c9c58bcc91922ae0a VS f02a319e893a5f24cd9226a5629ffd66
media-sound/musepack-tools-465: /usr/bin/mpcchap has incorrect MD5sum
69404023295888367142aeb223775991 VS 18669a9e207184545005526b1dac8a30
media-sound/musepack-tools-465: /usr/bin/wavcmp has incorrect MD5sum
3f281e21b5fc3f32813987cb4abc4f6b VS 9444631c99ca615ebc0b15deef21e3a9
media-sound/musepack-tools-465: /usr/lib/libmpcdec.so.7.0.1 has incorrect MD5sum
4c260731519c5f0e68cb5aaf602d6937 VS 51ceb8ccba5b39850a9bbd254a677785
media-sound/soundkonverter-1.6.3: /usr/bin/soundkonverter has incorrect MD5sum
18c712d156d64e648af9d90d536c034a VS 782e507357c51ecdd57fcde7421e6324
media-sound/soundkonverter-1.6.3: /usr/lib/libsoundkonvertercore.so has incorrect MD5sum
bce0ae0e85860e5dfa8b0c540e0dd3e5 VS d985f24134c005ef3cfdc7d9620f3b47
media-sound/twolame-0.3.13: /usr/bin/twolame has incorrect MD5sum
e0fd5312e39244142b9025c127fe219a VS 48fc02c71d7ccab9bafab88b5faf000e
media-sound/twolame-0.3.13: /usr/lib/libtwolame.so.0.0.0 has incorrect MD5sum
0b4c6db0c716bb71006ec89ab7925753 VS 48c95722af2bfb77b8a9753804770761
media-sound/vkplayer-0.08.16.4: /usr/bin/vkplayer has incorrect MD5sum
3850b447ca43ded496c64a30c7d92042 VS 47e6c1f473f18972e81e5757b06cf45f
media-sound/wavpack-4.60.1: /usr/bin/wavpack has incorrect MD5sum
f5b76a27b9a50ec6d9ec58f3663b38eb VS 686305b8531a00fc30ee4bafe8154087
media-sound/wavpack-4.60.1: /usr/bin/wvunpack has incorrect MD5sum
6451e812665f2001dc9f02a2bcbb69ff VS 68ce1843d2b1852797d2bc6aa41ec923
media-sound/wavpack-4.60.1: /usr/bin/wvgain has incorrect MD5sum
2661925b646968cd8ab61c0e8ea689be VS d53183f8191a765780961e74808786d4
media-sound/wavpack-4.60.1: /usr/lib/libwavpack.so.1.1.4 has incorrect MD5sum
fbdc4665c8627d19c69acd4157a3d87b VS 3358082ed7b14499db2658e22c772ccf
real 0m0.996s
user 0m0.224s
sys 0m0.018s
в 40! раз быстрей
собственно скрипт, который выполнил задачу equery k быстрей и корректно
#!/bin/bash
PKGDB="/var/db/pkg"
green="\033[01;32m"
red="\033[01;31m"
restore="\033[00m"
contrast="\033[1m"
underline="\033[4m"
[ -n "${@}" ] && packages="${@}"
check(){
while read type name sum time;do
[[ "${type}" == "obj" && ! -f "${name}" ]] && echo -e "${green}${1}${restore}: OBJ ${red}${name}${restore} doesn't exist" && fail="1"
[[ "${type}" == "dir" && ! -d "${name}" ]] && echo -e "${green}${1}${restore}: DIR ${red}${name}${restore} doesn't exist" && return
[[ "${type}" == "sym" && ! -h "${name}" ]] && echo -e "${green}${1}${restore}: SYM ${red}${name}${restore} doesn't exist" && return
if [[ -z "${fail}" && "${type}" == "obj" ]];then
my_sum="$(md5sum ${name} | awk '{print $1}')"
if [[ "${my_sum}" != "${sum}" ]];then
echo -e "${green}${1}${restore}: ${red}${name}${restore} has incorrect MD5sum"
echo -e "${my_sum} ${contrast}VS${restore} ${sum}"
fi
my_time="$(stat -c %Y ${name})"
if [[ "${my_time}" != "${time}" ]];then
echo -e "${green}${1}${restore}: ${red}${name}${restore} has wrong mtime"
echo -e "${my_time} ${contrast}VS${restore} ${time}"
fi
fi
unset fail
done < ${PKGDB}/${1}/CONTENTS
} 2>/dev/null
if [ -n "${packages}" ];then
for package in ${packages};do
pre_package="$(ls -d1 ${PKGDB}/{*/,}${package}{*,/*} 2>/dev/null)"
pre_package="$(sort -u <<< "${pre_package//'//'//}")"
package="${pre_package//${PKGDB}\//}"
for pack in ${package};do
check "${pack}"
done
done
else
for package in `find "${PKGDB}" -mindepth 2 -maxdepth 2 -type d | cut -d\/ -f5,6`;do
check "${package}"
done
fi
- equery НЕ умеет сравнивать цифры
- тормозное говно
Уххх...даже легче стало :3
<вброс>Привет, питонисты :3</вброс>