pax_global_header00006660000000000000000000000064123173412240014511gustar00rootroot0000000000000052 comment=c7dc9674a44f7a9251d500b3c7e251b7f6781f5e repocop-report-distrodb-0.17/000075500000000000000000000000001231734122400162265ustar00rootroot00000000000000repocop-report-distrodb-0.17/.gear/000075500000000000000000000000001231734122400172225ustar00rootroot00000000000000repocop-report-distrodb-0.17/.gear/rules000064400000000000000000000000071231734122400202740ustar00rootroot00000000000000tar: . repocop-report-distrodb-0.17/repocop-report-distrodb000075500000000000000000000203741231734122400227520ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; use Test::Repocop::Options; use Test::Repocop::Common; $Repocop::arg::reportlevel='skip'; my $distro='altlinux'; my $branch='sisyphus'; my $component='classic'; &Test::Repocop::Options::get_common_options( "distribution=s" => \$distro, "branch=s" => \$branch, "component=s" => \$component, ); $branch=lc($branch); &Test::Repocop::Options::die_if_nothing_to_report(); &Test::Repocop::Common::mkdir_test_environment(''); my $distrodbdir="$ENV{'HOME'}/.cache/distrodb/$distro/$branch"; my $db_version=5; my $db_compat_version=5; `rm -rf $distrodbdir`; `mkdir -p $distrodbdir/groups-allowed`; my $repocop_statedir=$ENV{'REPOCOP_STATEDIR'}; die "Oops! REPOCOP_STATEDIR is not initialized" unless defined $repocop_statedir; if (-f "$repocop_statedir/distromap/groups_allowed/GROUPS") { `cp -a "$repocop_statedir/distromap/groups_allowed/GROUPS" $distrodbdir/groups-allowed/GROUPS.tsv`; } my @compactify=qw!bin devel-libs gir headers headers-rebased path perl pkg-config provides python2 python3 srcname2binnames!; # no need to compactify sourcename foreach my $type (@compactify, qw!sourcename unique_data!) { `mkdir -p "$distrodbdir/$type"`; } open SQLITE, "| sqlite3 '$ENV{'REPOCOP_TEST_DBDIR'}/rpm.db'" || die "can't run sqlite3: $!"; print SQLITE ".mode tabs .output $distrodbdir/sourcename/${component}.txt SELECT rpm.name, srcrpm.name FROM rpm JOIN srcrpm ON rpm.sourceid = srcrpm.pkgid; .output $distrodbdir/srcname2binnames/${component}.txt SELECT srcrpm.name, rpm.name FROM rpm JOIN srcrpm ON rpm.sourceid = srcrpm.pkgid; .output $distrodbdir/provides/${component}.txt select DISTINCT providename, rpm.name FROM rpm_provides JOIN rpm ON rpm_provides.pkgid = rpm.pkgid ORDER BY PROVIDENAME; .output $distrodbdir/devel-libs/${component}.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/lib*.so' or filename glob '/lib64/lib*.so'; .output $distrodbdir/headers/${component}.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/include/*.*' and filemode & 16384 = 0; .output $distrodbdir/pkg-config/${component}-lib.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/pkgconfig/*.pc'; .output $distrodbdir/pkg-config/${component}-share.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/share/pkgconfig/*.pc'; .output $distrodbdir/bin/${component}.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/bin/*' or filename glob '/usr/sbin/*' or filename glob '/bin/*' or filename glob '/sbin/*' or filename glob '/usr/games/*'; .output $distrodbdir/gir/${component}.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/share/gir-1.0/*.gir'; .output $distrodbdir/perl/${component}.txt select providename, name from rpm_provides join rpm on rpm_provides.pkgid=rpm.pkgid where providename glob 'perl(*)'; .output $distrodbdir/python2/${component}-rp.txt select providename, name from rpm_provides join rpm on rpm_provides.pkgid=rpm.pkgid where providename glob 'python2.*(*)'; .output $distrodbdir/python3/${component}-rp.txt select providename, name from rpm_provides join rpm on rpm_provides.pkgid=rpm.pkgid where providename glob 'python3.*(*)'; .output $distrodbdir/python2/${component}-py.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/python2.*/site-packages/*.py' or filename glob '/usr/lib/python2.*/site-packages/*.py'; .output $distrodbdir/python3/${component}-py.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/python3.*/site-packages/*.py' or filename glob '/usr/lib/python3.*/site-packages/*.py'; .output $distrodbdir/python2/${component}-so.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/python2.*/site-packages/*.so'; .output $distrodbdir/python3/${component}-so.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filename glob '/usr/lib64/python3.*/site-packages/*.so'; .output $distrodbdir/unique_data/${component}.txt select filename, name from rpm_files join rpm on rpm_files.pkgid=rpm.pkgid where filemode & 16384 = 0 and filename glob '/usr/share/*' GROUP BY filename HAVING COUNT(filename)=1; "; close (SQLITE); `sed -e 's,^/usr,,;s,^/sbin/,,;s,^/bin/,,;s,^/games/,,' $distrodbdir/bin/${component}.txt > $distrodbdir/path/${component}.txt`; `sed -i -e 's,^/usr,,;s,^/lib64/,,;s,^lib,,;s,\.so\t,\t,' $distrodbdir/devel-libs/${component}.txt`; `sed -i -e 's,^/usr/include/,,' $distrodbdir/headers/${component}.txt`; `sed -i -e 's,^/usr,,;s,^/lib64/,,;s,^/lib/,,;s,^/share/,,;s,^pkgconfig/,,;s,\.pc\t,\t,' $distrodbdir/pkg-config/*.txt`; `sed -i -e 's,^/usr/share/gir-1.0/,,;s,\.gir\t,\t,' $distrodbdir/gir/${component}.txt`; `sed -i -e '/^debug64\(/d' $distrodbdir/provides/${component}.txt`; `sed -i -e 's,^python2\.[0-9]*(,,;s,)\t,.py\t,' $distrodbdir/python2/${component}-rp.txt`; `sed -i -e 's,^python3\.[0-9]*(,,;s,)\t,.py\t,' $distrodbdir/python3/${component}-rp.txt`; `awk '{sub(/\./,"/",\$1)}' $distrodbdir/python2/${component}-rp.txt > $distrodbdir/python2/${component}-pf.txt`; `awk '{sub(/\./,"/",\$1)}' $distrodbdir/python3/${component}-rp.txt > $distrodbdir/python3/${component}-pf.txt`; `rm -f $distrodbdir/python2/${component}-rp.txt`; `rm -f $distrodbdir/python3/${component}-rp.txt`; `sed -i -e 's,/lib/,/lib64/,;s,^/usr/lib64/python2.*/site-packages/,,' $distrodbdir/python2/${component}-{so,py}.txt`; `sed -i -e 's,/lib/,/lib64/,;s,^/usr/lib64/python3.*/site-packages/,,' $distrodbdir/python3/${component}-{so,py}.txt`; `cat $distrodbdir/python2/${component}-??.txt | sort -u > $distrodbdir/python2/${component}.txt`; `cat $distrodbdir/python3/${component}-??.txt | sort -u > $distrodbdir/python3/${component}.txt`; `rm -f $distrodbdir/python2/${component}-??.txt`; `rm -f $distrodbdir/python3/${component}-??.txt`; ### should be no CPANPLUS in autodependencies `sed -i -e '/^perl(CPANPLUS\b/d' $distrodbdir/perl/${component}.txt`; &rebase_1dep("$distrodbdir/headers/$component.txt","$distrodbdir/headers-rebased/$component.txt"); foreach my $component (grep {-e $_} map {glob "$distrodbdir/$_/*.txt"} @compactify) { &compactify($component); } `echo $db_version > $distrodbdir/.version`; `echo $db_compat_version > $distrodbdir/.compat`; sub compactify { my ($file)=@_; my %KEY; open my $fh, "<", $file or die $!; while (<$fh>) { chomp; my @line=split(/\s+/); my $ref=$KEY{$line[0]}; unless ($ref) { $ref=[]; $KEY{$line[0]}=$ref; } my $val=$line[1]; push @$ref, $val if not grep {$_ eq $val} @$ref; } close $fh; open $fh, '>', $file or die $!; map {print $fh "$_\t", join("\t",@{$KEY{$_}}),"\n"} sort {$a cmp $b} keys (%KEY); close $fh; } sub rebase_1dep { my ($infile,$outfile)=@_; open (my $in,'<',$infile) || die "$!"; open (my $out,'>',$outfile) || die "$!"; while (<$in>) { my ($header)=split(/\t/,$_,-1); next if $header=~/^\./; my $rebased_header=$header; $rebased_header=~s!^[^/]*/!!; $rebased_header=~s!^[\d\.]*/!!; print $out "$rebased_header\t$header\n"; } close($in) || die "$!"; close($out) || die "$!"; } #print STDERR "done.\n" if $verbose; =head1 NAME repocop-report-distromap-db - a tool that creates repocop report as a distrodb db. =head1 SYNOPSIS see repocop-report-distromap-db =head1 DESCRIPTION B processes results of repocop unit tests, created with repocop-run command, stored in and creates results in txt form. Presize subset of tests can be selected using B<--include> and B<--exclude> options. =head1 OPTIONS --branch =head1 AUTHOR Written by Igor Vlasenko . =head1 ACKNOWLEGEMENTS To Alexey Torbin , whose qa-robot package had a strong influence on repocop. =head1 COPYING Copyright (c) 2008 Igor Vlasenko, ALT Linux Team. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. =cut repocop-report-distrodb-0.17/repocop-report-distrodb.spec000064400000000000000000000060311231734122400236720ustar00rootroot00000000000000Name: repocop-report-distrodb Version: 0.17 Release: alt2 BuildArch: noarch Packager: Igor Yu. Vlasenko Summary: repocop report script that dumps test results to prometeus format Group: Development/Other License: GPL or Artistic Url: http://repocop.altlinux.org Requires: repocop > 0.67 Obsoletes: repocop-report-distromap-db < 0.12 BuildRequires: perl-devel perldoc BuildRequires: repocop Source: %name-%version.tar %description Repocop is a repository unit tests platform. %summary %prep %setup rm -f *.spec %build %install mkdir -p %buildroot/%_bindir install -m 755 repocop-report-* %buildroot/%_bindir/ ln -s repocop-report-distrodb %buildroot/%_bindir/repocop-report-distromap-db %files #doc README ChangeLog %_bindir/repocop-report-distromap-db %_bindir/repocop-report-distrodb #%_man1dir/repocop-report-prometeus-* %changelog * Thu Apr 03 2014 Igor Vlasenko 0.17-alt2 - no perl(CPANPLUS) in distrodb hack * Sun Oct 20 2013 Igor Vlasenko 0.17-alt1 - support for repocop > 0.67 * Mon Sep 02 2013 Igor Vlasenko 0.16-alt1 - added headers-rebased * Fri Apr 26 2013 Igor Vlasenko 0.15-alt2 - bugfix release * Thu Apr 25 2013 Igor Vlasenko 0.15-alt1 - extra db * Tue Mar 05 2013 Igor Vlasenko 0.14-alt4 - bugfix release * Mon Mar 04 2013 Igor Vlasenko 0.14-alt3 - bugfix release * Fri Jan 11 2013 Igor Vlasenko 0.14-alt2 - bugfix release * Fri Jan 11 2013 Igor Vlasenko 0.14-alt1 - internal version 5; added bin db * Tue Jan 08 2013 Igor Vlasenko 0.13-alt2 - bugfix release * Fri Jan 04 2013 Igor Vlasenko 0.13-alt1 - bugfix in path - new python format * Sat Dec 15 2012 Igor Vlasenko 0.12-alt1 - python db - renamed to repocop-report-distrodb * Wed May 09 2012 Igor Vlasenko 0.11-alt1 - perl provides support * Fri May 04 2012 Igor Vlasenko 0.10-alt2 - gir format shortened * Wed May 02 2012 Igor Vlasenko 0.10-alt1 - gir support; support for repo components * Sun Mar 25 2012 Igor Vlasenko 0.09-alt2 - bugfix release * Sat Dec 31 2011 Igor Vlasenko 0.09-alt1 - added srcname2binnames table * Thu Dec 15 2011 Igor Vlasenko 0.08-alt1 - moved to distrodb * Mon Dec 12 2011 Igor Vlasenko 0.07-alt2 - added /usr/share/pkgconfig to pkg-config db * Mon Dec 12 2011 Igor Vlasenko 0.07-alt1 - fixed pkg-config db * Sun Dec 11 2011 Igor Vlasenko 0.06-alt2 - bugfix * Sun Dec 11 2011 Igor Vlasenko 0.06-alt1 - added compactification * Sat Dec 10 2011 Igor Vlasenko 0.05-alt1 - added path db * Fri Dec 02 2011 Igor Vlasenko 0.04-alt1 - fixed libs map * Wed Aug 31 2011 Igor Vlasenko 0.03-alt1 - added provides map * Wed Aug 31 2011 Igor Vlasenko 0.02-alt1 - First build for Sisyphus.