3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Check-PkgFormat
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 if [ "$1" = "-all" ]; then
18 $0 -repository `ls package/. | egrep -v '(CVS|\.svn)'`
22 if [ "$1" = "-repository" ]; then
24 for x
in package
/$y/[a-z0-9
]*; do
25 [ -f "$x/${x##*/}.desc" ] && $0 ${x##*/}
31 if [ "$1" != "${1#-}" -o $# -eq 0 ]; then
32 echo "Usage: $0 <package-names>"
33 echo "or $0 -repository <repository-names>"
40 for pdir
in package
/*/$package; do
41 [ -f $pdir/$package.desc
] ||
continue
42 [ "$lastpdir" ] && echo "$package: Found dup: $pdir $lastpdir"
45 if [ -z "$lastpdir" ]; then
51 if [ -f $pdir/$package.conf
]; then
52 if egrep -q '^[^#]*\bflistdel' $pdir/$package.conf
; then
53 echo "$package: Use of \$flistdel is evil!"
57 if [ -f $pdir/$package.desc
]; then
58 grep -a '[^ ]' $pdir/$package.desc |
59 egrep -av '^(\[[A-Z0-9-]+\]( |$)|#)' |
60 sed "s,^,$package: Syntax error in $package.desc: ,"
62 egrep -a '^\[[A-Z0-9-]+\]( |$)' $pdir/$package.desc |
63 tr '[]' '||' | cut
-f2 -d'|' |
65 grep -q "\\[$tag\\]" misc
/share
/PKG-DESC-FORMAT
&&
67 [ "${tag#X-}" != "$tag" ] && continue
68 echo "$package: Unknown tag in $package.desc: [$tag]"
71 for x
in `egrep -a '^\[(C|CATEGORY)\]' $pdir/$package.desc |
73 egrep -q "^$x( |$)" misc
/share
/PKG-CATEGORIES
&&
75 echo "$package: Unknown package category: $x"
78 for x
in `egrep -a '^\[(F|FLAG)\]' $pdir/$package.desc |
80 egrep -q "^$x " misc
/share
/PKG-FLAGS
&&
82 echo "$package: Unknown package flag: $x"
85 for x
in `egrep -a '^\[(S|STATUS)\]' $pdir/$package.desc |
88 Alpha|Beta|Gamma|Stable
) ;;
89 *) echo "$package: Unknown package" \
94 for x
in `egrep -a '^\[(L|LICENSE)\]' $pdir/$package.desc |
97 Unknown|GPL|LGPL|GPL3|LGPL3|AGPL|AGPL3|MPL|FDL|MIT|BSD|ISC|APL|APSL|CDDL|QPL
) ;;
98 OpenSource|Free-to-use|Commercial
) ;;
99 IBM-Public-License|Restricted|Artistic
) ;;
101 *) echo "$package: Unknown package" \
106 grep '^\[.*(\*)' misc
/share
/PKG-DESC-FORMAT |
107 sed 's/][^]]*$//; s/. ./|/g; s/^\[//;' |
109 egrep -q "^\[($line)\]" $pdir/$package.desc ||
110 echo "$package: No [$line] tag found."
113 grep '^\[.*(1)' misc
/share
/PKG-DESC-FORMAT |
114 sed 's/][^]]*$//; s/. ./|/g; s/^\[//;' |
116 lines
=`egrep -a "^\[($line)\]" $pdir/$package.desc`
117 [ "$lines" != "${lines//
118 /}" ] && echo "$package: More than one [$line] tag found."
121 echo "$package: File not found: $pdir/$package.desc"
124 if [ -f $pdir/$package.conf
]; then
125 bash
-n $pdir/$package.conf
2>&1 |
sed "s,^,$package: ,"