]> TLD Linux GIT Repositories - tld-ftp-admin.git/blob - wwwbin/checkrepo.sh
- raw from PLD
[tld-ftp-admin.git] / wwwbin / checkrepo.sh
1 #!/bin/sh
2 # stat(1) each file in .info to see if they exist
3
4 REPODIR=${1:-/home/pld/admins/th/ftp/test}
5
6 # expand files from .info file
7 expand_info() {
8         awk -F ':' -vD="$REPODIR/" '
9                 /file:/ {
10                         if (/-debuginfo-/) {
11                                 print D $2 "/debuginfo/" $3
12                         } else {
13                                 print D $2 "/RPMS/" $3
14                         }
15                 }
16         ' "$@"
17 }
18
19 i=0
20 nn=
21 ls -1 $REPODIR/SRPMS/RPMS | sed -rne "s/^((.+)-[^-]+-[^-]+\.src\.rpm)$/\1.info/p" | \
22 while read pkg; do
23         for f in $(expand_info $REPODIR/SRPMS/.metadata/$pkg); do
24                 if ! stat $f >/dev/null; then
25                         echo "!!!: $pkg : $f" >&2
26                 fi
27         done
28 done