head	1.1;
branch	1.1.1;
access;
symbols
	pjones-sparse-experiment:1.1.1.1.0.6
	rpm-4_3_1-start:1.1.1.1
	rpm-4_3:1.1.1.1.0.4
	rpm-4_2_1-release:1.1.1.1
	rpm-4_2-release:1.1.1.1
	rpm-4_2:1.1.1.1.0.2
	postmerge-lsbpkgchk-1_2_1_20021023:1.1.1.1
	premerge-lsbpkgchk-1_2_1_20021023:1.1.1.1
	lsbpkgchk-1_2_1_20021023:1.1.1.1
	pre-lsbpkgchk-1_2_1_20021023:1.1.1.1
	lsbpkgchk-1_2_1_20021017:1.1.1.1
	lsbpkgchk:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2002.10.23.15.39.41;	author jbj;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.10.23.15.39.41;	author jbj;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/usr/bin/perl

use Mysql;

use Env qw(LSBUSER LSBDBPASSWD LSBDB LSBDBHOST);

$Dbh = Mysql->connect($LSBDBHOST,$LSBDB,$LSBUSER, $LSBDBPASSWD) || die $Mysql::db_errstr;

sub
dumptable($$)
{
local($ttype,$tname)=@@_;

$select = "SELECT DISTINCT * FROM RpmTag ";
$select.= "WHERE Rgroup='Private' OR Rgroup='".$ttype."' ";
$select.= "ORDER BY Rgroup,Rtag ";

#print "$select\n";

$sth = $Dbh->query($select) || die $Dbh->errmsg();

printf "RpmIdxTagFuncRec %s[] = {\n", $tname;

for(1..$sth->numrows) {
	%entry=$sth->fetchhash;
	printf "{%s,\t", $entry{'Rname'};
	printf "\"%s\",\t", $entry{'Rname'};
	printf "%s,\t", $entry{'Rtype'};
	printf "%s,\t", $entry{'Rcount'};
	split('_',$entry{'Rname'});
	$tagname=@@_[1];
	printf "checkRpmIdx%s,\t", $tagname;
	printf "%s,\t", $entry{'Rstatus'};
	printf "NotSeen},\n";
	}
printf "\t};\n\n", $tname;
}

print "/* Generated file - Do Not Edit */\n\n";
print "#include \"rpmchk.h\"\n";
print "#include \"tagfuncs.h\"\n\n";

dumptable("Signature","SigTags");
print "\nint numSigIdxTags = sizeof(SigTags)/sizeof(RpmIdxTagFuncRec);\n\n";
dumptable("Header","HdrTags");
print "int numHdrIdxTags = sizeof(HdrTags)/sizeof(RpmIdxTagFuncRec);\n";

@


1.1.1.1
log
@track: auto import
@
text
@@
