repocop-collector-rpmbuild-files-req-list-0.02/000075500000000000000000000000001214412711400215335ustar00rootroot00000000000000repocop-collector-rpmbuild-files-req-list-0.02/rpmbuild-files-req-list.filepattern000064400000000000000000000000401214412711400304400ustar00rootroot00000000000000^/usr/lib/rpm/.*-files.req.list repocop-collector-rpmbuild-files-req-list-0.02/rpmbuild-files-req-list.sql000064400000000000000000000006451214412711400267350ustar00rootroot00000000000000-- -*- mode: sql -*- -- rpmbuild-files-req-list.db schema version -- PRAGMA user_version = 0; -- PKGNAME here is to avoid multiple versions clash CREATE TABLE IF NOT EXISTS RPMBUILDFILESREQLIST ( PKGID TEXT, PKGNAME TEXT, REQLISTFILE TEXT DEFAULT '', FILEREQDIR TEXT DEFAULT '', FILEREQNAME TEXT DEFAULT '', PRIMARY KEY(PKGNAME,REQLISTFILE,FILEREQDIR) ON CONFLICT REPLACE ); repocop-collector-rpmbuild-files-req-list-0.02/rpmbuild-files-req-list.test000075500000000000000000000021031214412711400271070ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; use DBI; my $dbh; my $sth_insert_files; my $pkgkey=$ENV{'REPOCOP_PKG_KEY'}; my $pkgname=$ENV{'REPOCOP_PKG_NAME'}; &connect(); foreach my $filename(glob $ENV{'REPOCOP_PKG_ROOT'}."/usr/lib/rpm/*-files.req.list") { open my $fh, $filename or die $!; my @content = <$fh>; close $fh; foreach (@content){ chomp; next if /^\s*#/ or /^\s*$/; /(\S+)\s+(\S+)\s*/; my ($dirpath,$dirowner)=($1,$2); $sth_insert_files->execute($pkgkey,$pkgname,$filename,$dirpath,$dirowner); } } &disconnect(); sub connect { my $dbfile=$ENV{'REPOCOP_TEST_DB'}; die "database is not initialized properly!" unless $dbfile; $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","", { PrintError => 1, AutoCommit => 0, }) or die $dbh->errstr; $sth_insert_files=$dbh->prepare('INSERT INTO RPMBUILDFILESREQLIST VALUES(?,?,?,?,?)') or die $dbh->errstr; } sub disconnect { $dbh->commit; $sth_insert_files->finish; # hack around closing dbh with active statement handles bug local $SIG{'__WARN__'} = sub {}; $dbh->disconnect; }