-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmkusergrpcmds
More file actions
executable file
·137 lines (103 loc) · 3.38 KB
/
Copy pathmkusergrpcmds
File metadata and controls
executable file
·137 lines (103 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/perl
#
# Linux Standard Base, http://www.linuxbase.org/
# George Kraft IV, gk4@us.ibm.com, 03/09/2000
#
#
use DBI;
use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST);
local %references;
local %standards;
################################################################################
# lsbOpenDB
################################################################################
sub lsbOpenDB {
$dbh = DBI->connect("DBI:mysql:$LSBDB", $LSBUSER, $LSBDBPASSWD);
die unless $dbh;
$sth = $dbh->prepare( "SHOW TABLES" );
$sth->execute;
}
################################################################################
# lsbCloseDB
################################################################################
sub lsbCloseDB {
$sth = $dbh->prepare( "SHOW TABLES" );
$sth->execute;
$sth->finish;
$dbh->disconnect;
}
################################################################################
# lsbCommands
################################################################################
sub lsbCommands {
$sth = $dbh->prepare("SELECT DISTINCT Command.Cname, Standard.Sid, Standard.Sfull FROM Command left join StandUgCmds on Command.Cid=StandUgCmds.UGCcmd, Standard WHERE StandUgCmds.UGCstand=Standard.Sid AND StandUgCmds.UGClsb='1' ORDER BY Command.Cname");
$sth->execute;
if ($sth->rows < 1) {
printf("<para>No Commands or Utilities found!</para>\n");
return;
}
printf("<para>\n");
printf("The behaviour of the interfaces described in this\n");
printf("section are specified by the following Standards.");
printf("</para>\n");
printf("<simplelist columns=1>\n");
my $i = 0;
while (@field = $sth->fetchrow_array) {
if (!$standards{$field[1]}) {
++$i;
$standards{$field[1]} = $field[2];
$references{$i} = $field[1];
$permutation{$field[1]} = $i;
$ref = $i;
} else {
$ref = $permutation{$field[1]};
}
$ftid = sprintf("std-ugc-fn-%s-%s",
$field[1], $permutation{$field[1]});
if (!$footer{$ftid}) {
$footer{$ftid} = $ref;
printf("<member>%s\n", $standards{$field[1]});
printf("<footnote id=\"%s\">\n", $ftid);
printf("<para>%s</para></footnote>",
$standards{$field[1]});
printf("</member>\n");
}
}
printf("</simplelist>\n");
$sth = $dbh->prepare("SELECT DISTINCT Command.Cname, Standard.Sid, Standard.Sfull FROM Command left join StandUgCmds on Command.Cid=StandUgCmds.UGCcmd, Standard WHERE StandUgCmds.UGCstand=Standard.Sid AND StandUgCmds.UGClsb='1' ORDER BY Command.Cname");
$sth->execute;
if ($sth->rows < 1) {
printf("<para>No Commands or Utilities found!</para>\n");
return;
}
printf("<table>\n");
printf("<title></title>\n");
printf("<tgroup cols=5>\n");
printf("<tbody>\n");
printf("<row>\n");
my $i = 0;
while (@field = $sth->fetchrow_array) {
$ref = $permutation{$field[1]};
if ($i != 0 && 0 == ($i % 5)) {
printf("</row><row>\n");
}
$ftid = sprintf("std-ugc-fn-%s-%s",
$field[1], $permutation{$field[1]});
printf("<entry>%s\n", $field[0]);
printf("<footnoteref linkend=\"%s\">\n", $ftid);
printf("</entry>\n");
++$i;
}
printf("</row>\n");
printf("</tbody>\n");
printf("</tgroup>\n");
printf("</table>\n");
}
################################################################################
# main
################################################################################
lsbOpenDB;
lsbCommands;
lsbCloseDB;
exit;
# EOF