3
0

- fix usage of perl's index()

OBS-URL: https://build.opensuse.org/package/show/Base:System/post-build-checks?expand=0&rev=54
This commit is contained in:
Stephan Kulow 2011-12-01 16:36:57 +00:00 committed by Git OBS Bridge
parent 2e0cdbb554
commit 8328e2537c
3 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,7 @@
Index: post-build-checks-1.0/checks/09-check-packaged-twice Index: post-build-checks-1.0/checks/09-check-packaged-twice
=================================================================== ===================================================================
--- post-build-checks-1.0.orig/checks/09-check-packaged-twice 2011-10-20 11:57:54.000000000 +0200 --- post-build-checks-1.0.orig/checks/09-check-packaged-twice 2011-10-20 11:57:54.000000000 +0200
+++ post-build-checks-1.0/checks/09-check-packaged-twice 2011-11-28 12:46:09.048680204 +0100 +++ post-build-checks-1.0/checks/09-check-packaged-twice 2011-12-01 17:36:22.894836849 +0100
@@ -1,61 +1,74 @@ @@ -1,61 +1,74 @@
-#!/usr/bin/perl -#!/usr/bin/perl
+#!/usr/bin/perl -w +#!/usr/bin/perl -w
@ -48,7 +48,8 @@ Index: post-build-checks-1.0/checks/09-check-packaged-twice
-if ( $#RPMS < 1 ) { -if ( $#RPMS < 1 ) {
- exit 0; - exit 0;
+open (ALL_RPMS, "find $build_root$TOPDIR/RPMS -name \"*.rpm\" |"); +print "chroot $build_root find $TOPDIR/RPMS -name \"*.rpm\"\n";
+open (ALL_RPMS, "chroot $build_root find $TOPDIR/RPMS/ -name \"*.rpm\" |");
+my @rpms = <ALL_RPMS>; +my @rpms = <ALL_RPMS>;
+chomp @rpms; +chomp @rpms;
+close ALL_RPMS; +close ALL_RPMS;
@ -59,7 +60,6 @@ Index: post-build-checks-1.0/checks/09-check-packaged-twice
+my %pkg2rpm; +my %pkg2rpm;
+ +
+for my $rpm (@rpms) { +for my $rpm (@rpms) {
+ $rpm =~ s/^$build_root//;
+ open (FILES, "chroot $build_root rpm -qp --qf '[%{FILEMODES:perms} F:%{FILEFLAGS:fflags} %{NAME} %{FILENAMES}\n]' $rpm|"); + open (FILES, "chroot $build_root rpm -qp --qf '[%{FILEMODES:perms} F:%{FILEFLAGS:fflags} %{NAME} %{FILENAMES}\n]' $rpm|");
+ my @files = <FILES>; + my @files = <FILES>;
+ chomp @files; + chomp @files;
@ -108,7 +108,7 @@ Index: post-build-checks-1.0/checks/09-check-packaged-twice
+ while (@pkgs) { + while (@pkgs) {
+ my $p1 = shift @pkgs; + my $p1 = shift @pkgs;
+ for my $p2 (@pkgs) { + for my $p2 (@pkgs) {
+ next if (index('g', $allfiles{$file}->{$p1}) != -1) && (index('g', $allfiles{$file}->{$p2}) != -1); + next if (index($allfiles{$file}->{$p1}, 'g') != -1) && (index($allfiles{$file}->{$p2}, 'g') != -1);
+ next if conflicts($pkg2rpm{$p1}, $pkg2rpm{$p2}) || conflicts($pkg2rpm{$p2}, $pkg2rpm{$p1}); + next if conflicts($pkg2rpm{$p1}, $pkg2rpm{$p2}) || conflicts($pkg2rpm{$p2}, $pkg2rpm{$p1});
+ print "ERROR: $file is packaged in both $p1 and $p2, and the packages do not conflict\n"; + print "ERROR: $file is packaged in both $p1 and $p2, and the packages do not conflict\n";
+ $had_errors = 1; + $had_errors = 1;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Dec 1 16:36:29 UTC 2011 - coolo@suse.com
- fix usage of perl's index()
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 28 11:46:44 UTC 2011 - coolo@suse.com Mon Nov 28 11:46:44 UTC 2011 - coolo@suse.com

View File

@ -15,16 +15,12 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
# norootforbuild
Name: post-build-checks Name: post-build-checks
License: GPLv2+ License: GPL-2.0+
Group: Development/Tools/Building Group: Development/Tools/Building
AutoReqProv: on
Summary: post checks for build after rpms have been created Summary: post checks for build after rpms have been created
Version: 1.0 Version: 1.0
Release: 95 Release: 0
PreReq: aaa_base permissions sed PreReq: aaa_base permissions sed
Url: http://gitorious.org/opensuse/post-build-checks Url: http://gitorious.org/opensuse/post-build-checks
# #