2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: scripts/Create-PkgList
4 # Copyright (C) 2004 - 2023 The T2 SDE Project
5 # Copyright (C) 1998 - 2003 ROCK Linux Project
7 # This Copyright note is generated by scripts/Create-CopyPatch,
8 # more information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License version 2.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 if [ $# -lt 1 -o ! -d "architecture/$1" ]; then
15 echo "Usage: $0 [ <arch-name> ] [ <kernel> ]"
16 [ $# -eq 0 ] ||
echo " '$1' is not a valid architecture"
20 if [ $# -lt 2 -o ! -d "kernel/$2" ]; then
21 echo "Usage: $0 [ <arch-name> ] [ <kernel> ]"
22 [ $# -eq 0 ] ||
echo " '$2' is not a valid kernel"
31 function print_package() {
32 print defset, stages, pri, pkgtree,
33 package, ver, "/" categories flags, 0;
37 if (pkgtree) print_package();
40 (FNR == 1 && pkgtree) {
45 split(FILENAME, a, /\//);
46 pkgtree=a[1]; package=a[2];
47 defset="X"; pri="999.999";
49 ver="0000"; categories=""
53 /^\[(P|PRI|PRIORITY)\]/ {
54 split($0, a, /[ \t]+/);
55 defset=a[2]; stages=a[3]; pri=a[4];
58 /^\[(V|VER|VERSION)\]/ {
59 split($0, a, /[ \t]+/);
60 if (ver_dup == 0) ver=a[2];
65 split($0, a, /[ \t]+/);
66 for (c=2; a[c]; c++) categories = categories " " a[c];
70 split($0, a, /[ \t]+/);
71 for (c=2; a[c]; c++) flags = flags " " a[c];
74 /^\[(R|ARCH|ARCHITECTURE)\]/ {
75 n=split($0, a, /[ \t]+/);
79 # search for an architecture match
81 for (i = 3; i<= n; ++i) {
89 else { # intentionally start at index 2: implicit exlusive selection
90 for (i = 2; i<= n; ++i) {
95 # not found: remove it
100 /^\[(K|KERN|KERNEL)\]/ {
101 n=split($0, k, /[ \t]+/);
103 # search for an kernel match
105 for (i = 3; i<= n; ++i) {
106 if (kernel == k[i]) {
113 else { # intentionally start at index 2: implicit exlusive selection
114 for (i = 2; i<= n; ++i) {
115 if (kernel == k[i]) {
119 # not found: remove it
122 }' |
(cd package
; gawk
-f - */*/*.desc
) |
sort -k3