3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Check-PkgFormat
5 # Copyright (C) 2004 - 2024 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 version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 if [ "$1" = "-all" ]; then
16 $0 -repository `ls package/. | egrep -v '(CVS|\.svn)'`
20 if [ "$1" = "-repository" ]; then
22 for x
in package
/$y/[a-z0-9
]*; do
23 [ -f "$x/${x##*/}.desc" ] && $0 ${x##*/}
29 if [ "$1" != "${1#-}" -o $# -eq 0 ]; then
30 echo "Usage: $0 <package-names>"
31 echo "or $0 -repository <repository-names>"
38 for pdir
in package
/*/$package; do
39 [ -f $pdir/$package.desc
] ||
continue
40 [ "$lastpdir" ] && echo "$package: Found dup: $pdir $lastpdir"
43 if [ -z "$lastpdir" ]; then
49 if [ -f $pdir/$package.conf
]; then
50 if egrep -q '^[^#]*\bflistdel' $pdir/$package.conf
; then
51 echo "$package: Use of \$flistdel is deprecated!"
55 if [ -f $pdir/$package.desc
]; then
56 grep -a '[^ ]' $pdir/$package.desc |
57 egrep -av '^(\[[A-Z0-9-]+\]( |$)|#)' |
58 sed "s,^,$package: Syntax error in $package.desc: ,"
60 egrep -a '^\[[A-Z0-9-]+\]( |$)' $pdir/$package.desc |
61 tr '[]' '||' | cut
-f2 -d'|' |
63 grep -q "\\[$tag\\]" misc
/share
/PKG-DESC-FORMAT
&&
65 [ "${tag#X-}" != "$tag" ] && continue
66 echo "$package: Unknown tag in $package.desc: [$tag]"
69 for x
in `egrep -a '^\[(C|CATEGORY)\]' $pdir/$package.desc |
71 egrep -q "^$x( |$)" misc
/share
/PKG-CATEGORIES
&&
73 echo "$package: Unknown package category: $x"
76 for x
in `egrep -a '^\[(F|FLAG)\]' $pdir/$package.desc |
78 x
=${x%.*} # remove conditional suffixes
79 egrep -q "^$x " misc
/share
/PKG-FLAGS
&&
81 echo "$package: Unknown package flag: $x"
84 for x
in `egrep -a '^\[(S|STATUS)\]' $pdir/$package.desc |
87 Alpha|Beta|Gamma|Stable
) ;;
88 *) echo "$package: Unknown package" \
93 for x
in `egrep -a '^\[(L|LICENSE)\]' $pdir/$package.desc |
96 Unknown|GPL|LGPL|GPL3|LGPL3|AGPL|AGPL3|MPL|FDL|MIT|BSD|EUPL|ISC|APL|APSL|BSL|CDDL|QPL|OFL|ZLIB|UNL
) ;;
97 OpenSource|Free-to-use|Commercial
) ;;
98 IBM-Public-License|Restricted|Artistic
) ;;
100 *) echo "$package: Unknown package" \
105 grep '^\[.*(\*)' misc
/share
/PKG-DESC-FORMAT |
106 sed 's/][^]]*$//; s/. ./|/g; s/^\[//;' |
108 egrep -q "^\[($line)\]" $pdir/$package.desc ||
109 echo "$package: No [$line] tag found."
112 grep '^\[.*(1)' misc
/share
/PKG-DESC-FORMAT |
113 sed 's/][^]]*$//; s/. ./|/g; s/^\[//;' |
115 lines
=`egrep -a "^\[($line)\]" $pdir/$package.desc`
116 [ "$lines" != "${lines//
117 /}" ] && echo "$package: More than one [$line] tag found."
120 echo "$package: File not found: $pdir/$package.desc"
123 if [ -f $pdir/$package.conf
]; then
124 bash
-n $pdir/$package.conf
2>&1 |
sed "s,^,$package: ,"