pax_global_header00006660000000000000000000000064122310410250014500gustar00rootroot0000000000000052 comment=7bb5c6b4fe4c9d331b3e184d26c3b7bde886c5e2 repocop-report-qa-robot-0.35/000075500000000000000000000000001223104102500161275ustar00rootroot00000000000000repocop-report-qa-robot-0.35/.gear/000075500000000000000000000000001223104102500171235ustar00rootroot00000000000000repocop-report-qa-robot-0.35/.gear/rules000064400000000000000000000000071223104102500201750ustar00rootroot00000000000000tar: . repocop-report-qa-robot-0.35/bin/000075500000000000000000000000001223104102500166775ustar00rootroot00000000000000repocop-report-qa-robot-0.35/bin/catcol2000075500000000000000000000000211223104102500201450ustar00rootroot00000000000000awk '{print $2}' repocop-report-qa-robot-0.35/bin/catcol23000075500000000000000000000000311223104102500202310ustar00rootroot00000000000000awk '{print $2 "\t" $3}' repocop-report-qa-robot-0.35/bin/catcol234000075500000000000000000000000411223104102500203160ustar00rootroot00000000000000awk '{print $2 "\t" $3 "\t" $4}' repocop-report-qa-robot-0.35/bin/catcol45000075500000000000000000000000311223104102500202350ustar00rootroot00000000000000awk '{print $4 "\t" $5}' repocop-report-qa-robot-0.35/bin/catcol567000075500000000000000000000000411223104102500203270ustar00rootroot00000000000000awk '{print $5 "\t" $6 "\t" $7}' repocop-report-qa-robot-0.35/bin/repocop-error000075500000000000000000000000541223104102500214220ustar00rootroot00000000000000perl /usr/bin/repocop-report-qa-robot-fail repocop-report-qa-robot-0.35/bin/repocop-experimental000075500000000000000000000000641223104102500227670ustar00rootroot00000000000000perl /usr/bin/repocop-report-qa-robot-experimental repocop-report-qa-robot-0.35/bin/repocop-info000075500000000000000000000000541223104102500212240ustar00rootroot00000000000000perl /usr/bin/repocop-report-qa-robot-info repocop-report-qa-robot-0.35/bin/repocop-patch000075500000000000000000000001651223104102500213730ustar00rootroot00000000000000#!/bin/sh #ls ~/.repocop/reports/diff/by-srpm | grep -v -- '-digest\.' cat ~/.repocop/reports/diff/qa-robot/diff.ls repocop-report-qa-robot-0.35/bin/repocop-report000075500000000000000000000000531223104102500216030ustar00rootroot00000000000000perl /usr/bin/repocop-report-qa-robot-all repocop-report-qa-robot-0.35/bin/repocop-warning000075500000000000000000000000541223104102500217360ustar00rootroot00000000000000perl /usr/bin/repocop-report-qa-robot-warn repocop-report-qa-robot-0.35/qa-robot-repocop000075500000000000000000000214341223104102500212520ustar00rootroot00000000000000#!/bin/sh -ef export LC_ALL=C format_new=cat format_old=cat format_updated=cat arch= workdir= mailto= subj= opt_join= opt_noreplace= args=`getopt -u -l format-new:,format-old:,format-updated: -o a:d:jnm:s:h -- $*` if [ $? -ne 0 ] then pod2usage --exit=2 "$0"; exit 2 ; fi set -- $args for i do case "$i" in -a) arch="${2:?}"; shift; readonly arch ; shift;; -d) workdir="$(readlink -ev "${2:?}")"; shift; readonly workdir ; shift;; -m) mailto="${2:?}"; shift; readonly mailto ; shift;; -s) subj="${2:?}"; shift; shift;; -j) opt_join=1; shift;; -n) opt_noreplace=1; shift;; --format-new) format_new="$2"; shift; shift;; --format-old) format_old="$2"; shift; shift;; --format-updated) format_updated="$2"; shift; shift;; --) shift; break;; esac done if [ -z "$*" ]; then echo "${0##*/}: not enough arguments" >&2 pod2usage --exit=2 "$0"; exit 2 fi cmd="$1"; shift; OPTIND=1 which "$cmd" >/dev/null name="$(basename "$cmd")" count() { inflect --noun -- "$@"; } noun="${name%s}" [ -n "$subj" ] || subj="I: Sisyphus-$(date +%Y%m%d)${arch:+ }${arch:-} $(count 2 "$noun"):" fmt_start() { :; } fmt_plus() { subj="$subj +$1"; echo " $1 NEW $2 added to the list"; cat; echo; } fmt_new() { subj="$subj +$1!"; echo " $1 NEW $2 added to the list"; cat; echo; } fmt_minus() { subj="$subj -$1"; echo " $1 $2 REMOVED from the list"; cat; echo; } fmt_old() { subj="$subj -$1"; echo " $1 $2 REMOVED from the list"; cat; echo; } fmt_updated() { subj="$subj +$1"; echo " $1 NOT FIXED $2"; cat; echo; } fmt_total() { subj="$subj ($1)"; echo "Total $1 $2."; } if [ -z "$workdir" ]; then workdir="$(readlink -ev "$HOME")/.qa-robot/$name${arch:+/}${arch:-}" mkdir -p "$workdir" fi readonly workdir . trap.sh lockfile -r0 "$workdir"/lock add_trap rm -f "$workdir"/lock . "$cmd" ${1+"$@"} >"$workdir/dump.new" cd "$workdir" readonly PWD if [ ! -s dump.new ]; then echo "${0##*/}: empty $name state unexpected." >&2 exit 1 fi if [ -n "$opt_join" ]; then sort -o dump.new -u -t$'\t' -k1,1 dump.new else sort -o dump.new -u dump.new fi if [ ! -s dump.old ]; then mv -f dump.new dump.old n=`wc -l &2 exit 0 fi qa_unchanged() { [ -t 2 ] || exit 0 n=`wc -l &2 exit 0 } comm -13 dump.old dump.new >comm.plus comm -23 dump.old dump.new >comm.minus [ -s comm.plus -o -s comm.minus ] || qa_unchanged if [ -n "$opt_join" ]; then join -t$'\t' comm.minus comm.plus | $format_updated >join.updated join -t$'\t' -v1 comm.minus comm.plus | $format_old >join.old join -t$'\t' -v2 comm.minus comm.plus | $format_new >join.new [ -s join.updated -o -s join.old -o -s join.new ] || qa_unchanged fi fmt_start >message if [ -n "$opt_join" ]; then for s in new old updated; do [ -s join.$s ] || continue n=`wc -l >message n=`wc -l >message zmail() { local subj="$1" file="$2"; shift 2 local size="$(du -bk "$file" |cut -f1)" local LC_ALL= if [ "$size" -gt 1024 ]; then echo "Message size is ${size}K, E2BIG." >&2 return 1 elif [ "$size" -gt 32 ]; then gzip -9nf "$file" mutt -x -s "$subj" -a "$file.gz" "$@" message$$ mv -f message$$ message [ -n "$mailto" ] || cat message if [ -z "$opt_noreplace" ]; then [ -f dump.log ] ||: >dump.log diff -U1 dump.old dump.new |cat - dump.log >dump.log$$ mv -f dump.log$$ dump.log mv -f dump.old dump.bak mv -f dump.new dump.old fi : <<'__EOF__' =head1 NAME qa-robot - simple notification system =head1 SYNOPSIS B [B<-h>] [B<-d> I] [B<-j>] [B<-n>] [B<-m> I] [B<-s> I] I [I] =head1 DESCRIPTION B reports various state changes, in terms of new, old, and (possibly) updated entries. I must be a shell script which, whenever sourced or executed, dumps its current state to C, one line per entry; the script may also provide its custom formatting routines. =head1 OPTIONS =over =item B<-d> I Use I working directory. Save I state under I. Default working directory is C)>>. =item B<-j> Enable join mode; join records on the first field. Fields must be separated by tabs. =item B<-n> Do not finally replace the old I state with the new one. Useful for test runs. =item B<-m> I Suppress normal output. Send email notification to I address(es) instead. Messages larger than 32K are sent as gzipped attachments. Messages larger than 1024K produce a fatal error. =item B<-s> I Specify initial subject for email message. =item B<-h> Display this help and exit. =back =head1 FILES =head2 Files in use under the working directory =over =item B, B Current and previous I state files. =item B, B Comparison between B and B. B has lines unique to the current state, while B has lines unique to the previous state. =item B, B, B In join mode, B and B' lines are treated as records, whose fields are separated by tabs. The first field must be a primary key. B and B are then joined on the first field. Thus B has records unique to B (i.e. lines in B unpairable with those in B), B has records unique to B, and B contains pairable records joined on the first field. =item B Semaphore file, to guard against simultaneous runs. =item B The report is saved to this file. =item B When email message is sent, this file, should it exist, is appended to the message (except when sending gzipped attachments). =back =head2 Other files =over =item B<$PATH> Default I script location. =item B<$HOME/.qa-robot/$(basename I)> Default working directory. =back =head1 FORMATTING =head2 Variables =over =item B A countable noun that describes the entries, in the singular number. =item B The message subject. =back =head2 Functions =over =item B Executed when formatting is started. =item B, B Main formatting routines, for displaying new and old entries; executed only when the entries have actually been found. Calling convention for these routines is as follows: fmt_$s $n $noun is the number of entries, C<$noun> is the noun that describes the entries (in the proper number, according to C<$n>), and C is the appropriate file, connected to C, with C<$n> entries in it. =item B, B, B Alternative formatting routines for join mode (similar to B and B). =item B Formatting routine for the total number of entries. fmt_total $n $noun comes with a few real-world components used by ALT QA Team to notify subscribers of ALT Linux mailing lists: =over =item B Reports new and resolved unmet dependencies. Creates aptbox to distance the host system setup. =item B [I] Bugzilla watchdog. Reports new and resolved bugs (whether a bug has been resolved is subject to specific bugzilla conventions), along with the total number of pending (i.e. unresolved) bugs. The I specifies base Bugzilla URL. The default base URL is L. =item B [I] Reports new, old (removed), and updated rpm packages under I directory. Last changelog entry is listed for new and updated packages. The default I is C<$sisyphus/files/SRPMS>, where C<$sisyphus> is vendor-specific location. =back =head1 BUGS B is executed in C and C mode, so is the I sciprt. After I script is sourced, the current working directory is set to I and may not be changed by formatting routines. The locale is set to C. =head1 AUTHOR Written by Alexey Tourbin . =head1 COPYING Copyright (c) 2005 Alexey Tourbin, 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 __EOF__ repocop-report-qa-robot-0.35/repocop-report-email000075500000000000000000000023321223104102500221220ustar00rootroot00000000000000#!/bin/sh EMAIL_ADDR="$1" if [ -z "$EMAIL_ADDR" ]; then echo "first argument should be an e-mail address"; exit 1 fi QA_ROBOT="qa-robot-repocop -m $EMAIL_ADDR" QFORMAT="-j --format-old=/usr/share/repocop-report-email/bin/catcol23 --format-new=/usr/share/repocop-report-email/bin/catcol23 --format-updated=/usr/share/repocop-report-email/bin/catcol45" $QA_ROBOT $QFORMAT -s repocop-warning /usr/share/repocop-report-email/bin/repocop-warning $QA_ROBOT $QFORMAT -s repocop-error /usr/share/repocop-report-email/bin/repocop-error $QA_ROBOT $QFORMAT -s repocop-info /usr/share/repocop-report-email/bin/repocop-info $QA_ROBOT $QFORMAT -s repocop-experimental /usr/share/repocop-report-email/bin/repocop-experimental $QA_ROBOT -j --format-old=/usr/share/repocop-report-email/bin/catcol2 --format-new=/usr/share/repocop-report-email/bin/catcol2 --format-updated=/usr/share/repocop-report-email/bin/catcol23 -s repocop-patch /usr/share/repocop-report-email/bin/repocop-patch #$QA_ROBOT -j --format-old=/usr/share/repocop-report-email/bin/catcol234 --format-new=/usr/share/repocop-report-email/bin/catcol234 --format-updated=/usr/share/repocop-report-email/bin/catcol567 -s repocop-reports /usr/share/repocop-report-email/bin/repocop-report repocop-report-qa-robot-0.35/repocop-report-qa-robot-all000075500000000000000000000035531223104102500233330ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; use Test::Repocop::Options; use Test::Repocop::TestDB; use Test::Repocop::Metadata; #use Test::Repocop::ALTLinuxACL; $Repocop::arg::reportlevel='experimental'; &Test::Repocop::Options::get_common_options(); &Test::Repocop::Options::die_if_nothing_to_report(); #my $aclmap; #$aclmap=Test::Repocop::ALTLinuxACL->new($Repocop::arg::aclfile) if $Repocop::arg::aclfile; my $metadata=Test::Repocop::Metadata->new(); my $testdb=Test::Repocop::TestDB->new(); my $cache=$testdb->get_pkg_test_status_iterator(); while (my ($rpm,$test,$status)=$cache->iterate3_filtered()) { #my $srpm=$metadata->sourceid($rpm); #my $packager=$metadata->nick($rpm); my $name=$metadata->name($rpm); #my $version=$metadata->version($rpm); #my $release=$metadata->release($rpm); #my $arch=$metadata->arch($rpm); #my $srcname=$metadata->name($srpm); print "$name\t$rpm\t$status\t$test\n"; } #print STDERR "done.\n" if $verbose; =head1 NAME repocop-report-qa-diff - a tool that creates repocop reports for qa-robot-like processing. =head1 SYNOPSIS see repocop-report-txt =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 see repocop-report-txt =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-qa-robot-0.35/repocop-report-qa-robot-experimental000077700000000000000000000000001223104102500326022repocop-report-qa-robot-failustar00rootroot00000000000000repocop-report-qa-robot-0.35/repocop-report-qa-robot-fail000075500000000000000000000037311223104102500234740ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; use Test::Repocop::Options; use Test::Repocop::TestDB; use Test::Repocop::Metadata; $Repocop::arg::reportlevel ='experimental'; &Test::Repocop::Options::get_common_options(); &Test::Repocop::Options::die_if_nothing_to_report(); my $mode='fail'; $mode='warn' if ($0=~/warn(?:ing)?s?$/); $mode='info' if ($0=~/info$/); $mode='experimental' if ($0=~/experimental$/); my $metadata=Test::Repocop::Metadata->new(); my $testdb=Test::Repocop::TestDB->new(); my $cache=$testdb->get_pkg_test_status_iterator(); while (my ($rpm,$test,$status)=$cache->iterate3_filtered()) { my $name=$metadata->name($rpm); #print "${name}\t$rpm\t$test\n" if $status eq $mode; print "${name}#${test}\t$rpm\t$test\n" if $status eq $mode; } =head1 NAME repocop-report-qa-robot-* - report repocop unit tests results for qa-robot. =head1 SYNOPSIS B =include synopsis.pod.in =head1 DESCRIPTION B processes results of repocop unit tests, created with repocop-run command and stored in , and creates results in form sutable for qa-robot input. B lists all packages that got warnings along with corresponding tests names. B lists all packages that failed tests along with corresponding tests names. Presize subset of tests can be selected using B<--include> and B<--exclude> options. =head1 OPTIONS =over =include options.pod.in =back =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-qa-robot-0.35/repocop-report-qa-robot-info000077700000000000000000000000001223104102500310402repocop-report-qa-robot-failustar00rootroot00000000000000repocop-report-qa-robot-0.35/repocop-report-qa-robot-warn000077700000000000000000000000001223104102500310542repocop-report-qa-robot-failustar00rootroot00000000000000repocop-report-qa-robot-0.35/repocop-report-qa-robot.spec000064400000000000000000000024331223104102500235070ustar00rootroot00000000000000Name: repocop-report-qa-robot Version: 0.35 Release: alt1 BuildArch: noarch Packager: Igor Yu. Vlasenko Summary: Repocop qa-robot mail reports. Group: Development/Other License: GPL or Artistic Url: http://repocop.altlinux.org Source: %name-%version.tar Conflicts: repocop < 0.34 Requires: repocop > 0.68 BuildRequires: repocop > 0.68 %description Repocop is a repository unit tests platform. This package provides tools for repocop mail reports. %prep %setup -q %build %install mkdir -p $RPM_BUILD_ROOT{%_bindir,%_datadir/repocop-report-email/bin} install -m755 qa-robot-repocop repocop-report-email repocop-report-qa-robot-* $RPM_BUILD_ROOT%_bindir/ install -m755 bin/* $RPM_BUILD_ROOT%_datadir/repocop-report-email/bin/ %files %_bindir/repocop-report-qa-robot-* %_bindir/repocop-report-email %_bindir/qa-robot-repocop %_datadir/repocop-report-email %changelog * Sun Oct 20 2013 Igor Vlasenko 0.35-alt1 - support for TestDB interface * Thu May 31 2012 Igor Vlasenko 0.34-alt3 - bugfix * Mon May 28 2012 Igor Vlasenko 0.34-alt2 - bugfix * Mon May 21 2012 Igor Vlasenko 0.34-alt1 - added repocop-report-email * Sun Jan 03 2010 Igor Vlasenko 0.33-alt1 - split from main repocop package