pax_global_header00006660000000000000000000000064117337021360014515gustar00rootroot0000000000000052 comment=e2b6922bcd89c2a21dfe88ca3230f83e8bc8901b repocop-unittest-rpm-filetriggers-0.23/000075500000000000000000000000001173370213600202435ustar00rootroot00000000000000repocop-unittest-rpm-filetriggers-0.23/.gear/000075500000000000000000000000001173370213600212375ustar00rootroot00000000000000repocop-unittest-rpm-filetriggers-0.23/.gear/rules000064400000000000000000000000071173370213600223110ustar00rootroot00000000000000tar: . repocop-unittest-rpm-filetriggers-0.23/desktop-mime-entry.pl000064400000000000000000000014321173370213600243350ustar00rootroot00000000000000#!/usr/bin/perl -w push @SPECHOOKS, sub { my ($spec, $parent, $pkgname) = @_; my $mainsec=$spec->get_section('package',''); my $instsec=$spec->get_section('install'); unless ($instsec and $instsec->match_body('desktop-file-install')) { $mainsec->subst_body(qr'^BuildRequires:\s+desktop-file-utils\s*$',''); $mainsec->subst_body_if(qr'\s+desktop-file-utils',' ', qr'^BuildRequires:'); } $mainsec->subst_body(qr'^Requires\(post,postun\):\s+desktop-file-utils\s*$',''); my %scriptsec=map {$_=>1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); next unless $scriptsec{$secname}; $section->exclude_body(qr'update-desktop-database'); } }; 1; repocop-unittest-rpm-filetriggers-0.23/desktop-mime-entry.posttest000064400000000000000000000013251173370213600256100ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <get_section($secname,'-n '.$pkgname); unless ($section) { print STDERR "Oops! ($cmd): $secname not found for $pkgname\n" unless $suppress_oops; return; } $section->subst_body(qr"^\s*$cmd\s*\n?$",''); #" $section->subst_body(qr"$cmd(?:\s*\n?$)?",''); if ($section->is_empty()) { $section->delete; } }; 1; repocop-unittest-rpm-filetriggers-0.23/obsolete-call-in-post-alternatives-0.3.pl000064400000000000000000000037671173370213600277260ustar00rootroot00000000000000#!/usr/bin/perl -w push @SPECHOOKS, sub { my ($spec, $parent, $pkgname) = @_; my @todel; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); my %scriptsec=map {$_=>1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; if ($secname eq 'package') { $section->subst_body_if(qr'alternatives >= 0:0.2.0-alt0.12','alternatives >= 0:0.4', qr'^Requires'); $section->subst_body_if(qr'alternatives >= 0.2.0(?=(?:\s|$))','alternatives >= 0.4', qr'^Requires'); $section->subst_body_if(qr'alternatives >= 0.2(?=(\s|$))','alternatives >= 0.4', qr'^Requires'); } else { next unless $scriptsec{$secname}; $section->subst_body(qr'\s*\%post_register_alternatives\s+.+'s,''); $section->subst_body(qr'\s*\%preun_unregister_alternatives\s+.+'s,''); $section->subst_body(qr'\s*\%register_alternatives\s+.+'s,''); $section->subst_body(qr'\s*\%remove_alternatives\s+.+\n?'s,''); $section->subst_body(qr'\s*\%unregister_alternatives_always\s+.+'s,''); $section->subst_body(qr'\s*\%unregister_alternatives\s+.+'s,''); $section->subst_body(qr'\s*\%update_alternatives\s*',''); $section->exclude_body(qr'^\s*\[ -f "\%_altdir/\%name" \] \|\| exit 0\s*$'); #$section->subst(qr'\s*\',''); if ($section->is_empty()) { push @todel, [$secname,$section->get_raw_package(), $section->get_trigger_condition()]; } } } map {$spec->del_section($_->[0],$_->[1],$_->[2])} @todel; }; 1; __END__ BuildRequires: help2man, alternatives >= 0:0.2.0-alt0.12 Requires: alternatives >= 0:0.2.0-alt0.12 Requires(post): alternatives >= 0:0.2.0-alt0.12 Requires(post): alternatives >= 0:0.2.0-alt0.12 jaxp_parser_impl Requires(post,preun): alternatives >= 0.2 Requires(post,preun): alternatives >= 0.2.0 Requires(postun): alternatives >= 0:0.2.0-alt0.12 Requires(preun): alternatives >= 0:0.2.0-alt0.12 Requires(preun): alternatives >= 0:0.2.0-alt0.12 jaxp_parser_impl Requires: xml-commons-apis alternatives >= 0:0.2.0-alt0.12 repocop-unittest-rpm-filetriggers-0.23/obsolete-call-in-post-alternatives-0.3.posttest000064400000000000000000000031411173370213600311620ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_DBDIR/rpm.db" <1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); next unless $scriptsec{$secname}; $section->exclude_body(qr'^\s*touch\s+--no-create\s+(\%\{?_datadir\}?/icons|\%\{?_iconsdir\}?)/hicolor'); $section->multi_exclude_body( qr'^\s*if\s+\[\s+-x\s+.*gtk-update-icon-cache\s+\]\s*;\s*then', qr'^\s*.*gtk-update-icon-cache', qr'^\s*fi', ); $section->multi_exclude_body( qr'^\s*\[\s+"?\$1"?\s+-eq\s+1\s+\] &&\s+\\$', qr'^\s*.*gtk-update-icon-cache', ); my @body=@{$section->get_bodyref()}; my @new_body; my $multiline=0; while (scalar @body) { $_=shift(@body); next if $multiline and /\\\s*$/; if ($multiline and not /\\\s*$/) { $multiline=0; next; } if (/gtk-update-icon-cache/) { $multiline=1 if /\\\s*$/; next; } push @new_body, $_; } $section->set_body(\@new_body); $section->exclude_body(qr'gtk-update-icon-cache'); my $flag_p=$section->get_flag('-p'); if ((!$flag_p && $section->is_empty()) or ($flag_p && $flag_p=~/gtk-update-icon-cache/)) { push @todel, [$secname,$section->get_raw_package(), $section->get_trigger_condition()]; } } map {$spec->del_section($_->[0],$_->[1],$_->[2])} @todel; }; 1; __END__ repocop-unittest-rpm-filetriggers-0.23/obsolete-call-in-post-gtk-update-icon-cache.posttest000064400000000000000000000012611173370213600322200ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); if ($secname eq 'package') { $section->exclude_body(qr'^(?:Pre)?Req(?:uires)?\((post|preun|post,preun)\):\s*/sbin/install-info'); $section->exclude_body(qr'^Requires\(post\):\s*\%install_info\s*$'); $section->exclude_body(qr'^Requires\(preun\):\s*\%uninstall_info\s*$'); $section->exclude_body(qr'^Requires\(post,preun\): %__install_info\s*$'); $section->exclude_body(qr'^PreReq: \%__install_info\s*$'); } else { next unless $scriptsec{$secname}; # $section->exclude(qr'^\s*\%install_info'); # $section->exclude(qr'^\s*\%uninstall_info'); # $section->exclude(qr'^\s*\%xemacs_install_info'); # $section->exclude(qr'^\s*\%xemacs_uninstall_info'); # $section->exclude(qr'install-info[^\\]*$'); # $section->exclude(qr'^\s*\%__install_info[^\\]*$'); my @body=@{$section->get_bodyref()}; my @new_body; my $multiline=0; while (scalar @body) { $_=shift(@body); next if /^\s*\%install_info/; next if /^\s*\%uninstall_info/; next if /^\s*\%xemacs_install_info/; next if /^\s*\%xemacs_uninstall_info/; next if $multiline and /\\\s*$/; if ($multiline and not /\\\s*$/) { $multiline=0; next; } if (/^\s*\%__install_info/ or /install-info/) { $multiline=1 if /\\\s*$/; next; } push @new_body, $_; } $section->set_body(\@new_body); my $flag_p=$section->get_flag('-p'); if ((!$flag_p && $section->is_empty()) or ($flag_p && $flag_p=~/install.info/)) { push @todel, [$secname,$section->get_raw_package(), $section->get_trigger_condition()]; } } } map {$spec->del_section($_->[0],$_->[1],$_->[2])} @todel; }; 1; __END__ %post -p %install_info %preun -p %uninstall_info repocop-unittest-rpm-filetriggers-0.23/obsolete-call-in-post-install-info.posttest000064400000000000000000000016341173370213600305670ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_DBDIR/rpm.db" <get_section('package',''); $mainsec->subst_body(qr'^Requires\((?:post|postun|post,postun)\):\s+scrollkeeper\s*$',''); # TODO: common lib of utils, shared with Convert my %scriptsec=map {$_=>1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); next unless $scriptsec{$secname}; $section->exclude_body(qr'scrollkeeper-update'); } }; 1; repocop-unittest-rpm-filetriggers-0.23/obsolete-call-in-post-scrollkeeper-update.posttest000064400000000000000000000012651173370213600321420ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <get_sections()) { if ($section->get_bodyref()->[0]=~m!^\s*\%(post|preun)\s+.*-p\s+(?:\%post_|/sbin/)ldconfig!) { $spec->delete; } } &from_section($spec, $pkgname,'post','%post_ldconfig_lib',1); &from_section($spec, $pkgname,'post','%post_ldconfig_sys',1); &from_section($spec, $pkgname,'post','(?1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); next unless $scriptsec{$secname}; &_postclean_from_section($spec,$section,'(?subst_body(qr"^\s*$cmd\s*\n?$",''); #" $section->subst_body(qr"$cmd(?:\s*\n?$)?",''); if ($section->is_empty()) { $section->delete; } }; 1; repocop-unittest-rpm-filetriggers-0.23/postun_ldconfig.pl000064400000000000000000000010441173370213600237740ustar00rootroot00000000000000#!/usr/bin/perl -w require 'from_section.pl'; push @SPECHOOKS, sub { my ($spec, $parent, $pkgname) = @_; foreach my $section ($spec->get_sections()) { if ($section->get_bodyref()->[0]=~m!^\s*\%postun\s+.*-p\s+(?:\%postun_|/sbin/)ldconfig!) { $section->delete; } } &from_section($spec, $pkgname,'postun','%postun_ldconfig',1); &from_section($spec, $pkgname,'postun','(? Summary: test for obsolete calls in post/un sections Group: Development/Other License: GPL or Artistic Url: http://repocop.altlinux.org Requires: repocop > 0.55 Conflicts: repocop-unittest-post_ldconfig >= 0.03 Obsoletes: repocop-unittest-post_ldconfig < 0.03 Provides: repocop-unittest-altdesktop = 0.09 Obsoletes: repocop-unittest-altdesktop < 0.09 Conflicts: repocop-unittest-freedesktop-mime-test >= 0.04 Obsoletes: repocop-unittest-freedesktop-mime-test < 0.04 Requires: perl-RPM-Source-Editor >= 0.66 Source: %name-%version.tar %description integration test for repocop test platform. %prep %setup -q %build %install for i in *.posttest; do testname=`echo $i | sed -e s,.posttest\$,,` install -pD -m 755 $testname.posttest %buildroot%_datadir/repocop/pkgtests/$testname/posttest done mkdir -p %buildroot%_datadir/repocop/fixscripts/ install -m 644 *.pl %buildroot%_datadir/repocop/fixscripts/ %files %_datadir/repocop/pkgtests/* %_datadir/repocop/fixscripts/* %changelog * Sun Mar 25 2012 Igor Vlasenko 0.23-alt2 - further adapted for new R::S::E syntax * Thu Nov 10 2011 Igor Vlasenko 0.23-alt1 - adapted for new fixscript syntax * Fri Aug 26 2011 Igor Vlasenko 0.22-alt1 - use R::S::E 0.66 * Tue May 24 2011 Igor Vlasenko 0.21-alt1 - postclean patchgen improvements - removed support for dropped macros * Fri Feb 19 2010 Igor Vlasenko 0.20-alt7 - postclean patchgen improvement * Mon Jan 18 2010 Igor Vlasenko 0.20-alt6 - post_ldconfig patchgen improvement * Fri Jan 15 2010 Igor Vlasenko 0.20-alt5 - postclean patchgen improvement * Tue Nov 24 2009 Igor Vlasenko 0.20-alt4 - postclean patchgen improvement * Sat Nov 21 2009 Igor Vlasenko 0.20-alt3 - shared-mime-info patchgen improvement * Thu Nov 12 2009 Igor Vlasenko 0.20-alt2 - obsolete-call-in-post-install-info improvement * Sat Nov 07 2009 Igor Vlasenko 0.20-alt1 - added: + obsolete-call-in-post-gtk-update-icon-cache.pl + postclean-filetriggers.pl * Wed Sep 30 2009 Igor Vlasenko 0.19-alt1 - posttests migration * Thu May 21 2009 Igor Vlasenko 0.18-alt2 - bugfix (thanks to @php-coder) * Mon May 18 2009 Igor Vlasenko 0.18-alt1 - added obsolete-call-in-post-install-info check * Thu Mar 12 2009 Igor Vlasenko 0.17-alt1 - fixed bug in post*_ldconfig fixscripts (thanks to @ldv) * Thu Dec 18 2008 Igor Vlasenko 0.16-alt1 - support for requires alternatives >= 0:0.4 * Sun Dec 07 2008 Igor Vlasenko 0.15-alt1 - real support for %%force_update_alternatives macro: if package requires alternatives >= 0.4 no warning is issued. * Sun Dec 07 2008 Igor Vlasenko 0.14-alt1 - improvements in fixscripts * Wed Dec 03 2008 Igor Vlasenko 0.13-alt1 - accurate choice of triggers * Wed Dec 03 2008 Igor Vlasenko 0.12-alt1 - update_menus in postun also cleaned up (thanks to mike@). * Sun Nov 30 2008 Igor Vlasenko 0.11-alt1 - support for %%force_update_alternatives macro: if package requires alternatives >= 0.4 no warning is issued. * Fri Nov 28 2008 Igor Vlasenko 0.10-alt2 - bugfixes in obsolete-call-in-post-alternatives * Sun Nov 23 2008 Igor Vlasenko 0.10-alt1 - bugfixes in obsolete-call-in-post-alternatives * Sun Nov 23 2008 Igor Vlasenko 0.09-alt1 - bugfixes in obsolete-call-in-post-alternatives * Fri Nov 21 2008 Igor Vlasenko 0.08-alt1 - added new test obsolete-call-in-post-alternatives-0.3 * Sun Nov 16 2008 Igor Vlasenko 0.07-alt1 - support for Denis * Sat Nov 15 2008 Igor Vlasenko 0.06-alt1 - cleanup and fixes * Sat Nov 15 2008 Igor Vlasenko 0.05-alt1 - nice patches with no blank lines added * Sat Nov 15 2008 Igor Vlasenko 0.04-alt1 - added new tests: * obsolete-call-in-post-gtk-update-icon-cache * obsolete-call-in-post-scrollkeeper-update * Sat Nov 15 2008 Igor Vlasenko 0.03-alt1 - multiple nightly bugs and misprints fixed * Fri Nov 14 2008 Igor Vlasenko 0.02-alt1 - fixed bug in from_section.pl * Thu Nov 13 2008 Igor Vlasenko 0.01-alt1 - First build for Sisyphus. repocop-unittest-rpm-filetriggers-0.23/shared-mime-info.pl000064400000000000000000000013021173370213600237200ustar00rootroot00000000000000#!/usr/bin/perl -w push @SPECHOOKS, sub { my ($spec, $parent, $pkgname) = @_; my $mainsec=$spec->get_section('package',''); $mainsec->subst_body(qr'^BuildRequires:\s+shared-mime-info\s*(?:[<>=]+\s*\S+\s*)?$',''); $mainsec->subst_body_if(qr'\s+shared-mime-info\s*(?:[<>=]+\s*\S+)?',' ', qr'^BuildRequires:'); $mainsec->subst_body(qr'^Requires\(post,postun\):\s+shared-mime-info\s*$',''); my %scriptsec=map {$_=>1} qw/pre post preun postun triggerin triggerun triggerpostin triggerpostun/; foreach my $section ($spec->get_sections()) { my $secname=$section->get_type(); next unless $scriptsec{$secname}; $section->exclude_body(qr'update-mime-database'); } }; 1; repocop-unittest-rpm-filetriggers-0.23/shared-mime-info.posttest000064400000000000000000000013021173370213600251720ustar00rootroot00000000000000#!/bin/sh sqlite3 "$REPOCOP_TEST_TMPDIR/tmp.db" <