rpms/kernel-xen/devel/scripts configcommon.pl, 1.1, 1.2 configdiff.pl, 1.1, 1.2 cross-amd64.sh, 1.1, 1.2 cross-i586.sh, 1.1, 1.2 cross-i686.sh, 1.1, 1.2 cross-ia64.sh, 1.1, 1.2 cross-iseries.sh, 1.1, 1.2 cross-ppc.sh, 1.1, 1.2 cross-ppc64.sh, 1.1, 1.2 cross-ppc8260.sh, 1.1, 1.2 cross-ppc8560.sh, 1.1, 1.2 cross-pseries.sh, 1.1, 1.2 cross-s390.sh, 1.1, 1.2 cross-s390x.sh, 1.1, 1.2 merge.pl, 1.1, 1.2 rediffall.pl, 1.1, 1.2

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Dec 21 11:24:59 UTC 2005


Author: quintela

Update of /cvs/dist/rpms/kernel-xen/devel/scripts
In directory cvs.devel.redhat.com:/tmp/cvs-serv26692/scripts

Added Files:
	configcommon.pl configdiff.pl cross-amd64.sh cross-i586.sh 
	cross-i686.sh cross-ia64.sh cross-iseries.sh cross-ppc.sh 
	cross-ppc64.sh cross-ppc8260.sh cross-ppc8560.sh 
	cross-pseries.sh cross-s390.sh cross-s390x.sh merge.pl 
	rediffall.pl 
Log Message:
merged with sct branch.  Update to kernel rawhide 2.6.14.1.7776


Index: configcommon.pl
===================================================================
RCS file: configcommon.pl
diff -N configcommon.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ configcommon.pl	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+
+my @args=@ARGV;
+my @configoptions;
+my @configvalues;
+my @common;
+my $configcounter = 0;
+
+# first, read the 1st file
+
+open (FILE,"$args[0]") || die "Could not open $args[0]";
+while (<FILE>) {
+	my $str = $_;
+	if (/\# ([\w]+) is not set/) {
+		$configoptions[$configcounter] = $1;
+		$configvalues[$configcounter] = $str;
+		$common[$configcounter] = 1;
+		$configcounter ++;
+	} else {
+		if (/([\w]+)=/) {
+			$configoptions[$configcounter] = $1;
+			$configvalues[$configcounter] = $str;
+			$common[$configcounter] = 1;
+			$configcounter ++;
+		} else {
+			$configoptions[$configcounter] = "foobarbar";
+			$configvalues[$configcounter] = $str;
+			$common[$configcounter] = 1;
+			$configcounter ++;
+		}
+	}
+};
+
+# now, read all configfiles and see of the options match the initial one.
+# if not, mark it not common
+my $cntr=1;
+
+
+while ($cntr < @ARGV) {
+	open (FILE,$args[$cntr]) || die "Could not open $args[$cntr]";	
+	while (<FILE>) {
+		my $nooutput;
+		my $counter;
+		my $configname;
+
+		if (/\# ([\w]+) is not set/) {
+			$configname = $1;
+		} else {
+			if (/([\w]+)=/) {
+				$configname  = $1;
+			} 
+		}
+
+		$counter = 0;
+		$nooutput = 0;
+		while ($counter < $configcounter) {	
+			if ("$configname" eq "$configoptions[$counter]") {	
+				if ("$_" eq "$configvalues[$counter]") {
+					1;
+				} else {
+					$common[$counter] = 0;
+				}
+			}
+			$counter++;
+		}
+	}
+
+	$cntr++;
+}
+
+# now print the common values
+my $counter = 0;
+
+while ($counter < $configcounter) {	
+	if ($common[$counter]!=0) {
+		print "$configvalues[$counter]";
+	}
+	$counter++;
+}
+
+1;
+


Index: configdiff.pl
===================================================================
RCS file: configdiff.pl
diff -N configdiff.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ configdiff.pl	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,76 @@
+#! /usr/bin/perl
+
+my @args=@ARGV;
+my @configoptions;
+my @configvalues;
+my @alreadyprinted;
+my $configcounter = 0;
+
+# first, read the override file
+
+open (FILE,"$args[0]") || die "Could not open $args[0]";
+while (<FILE>) {
+	my $str = $_;
+	if (/\# ([\w]+) is not set/) {
+		$configoptions[$configcounter] = $1;
+		$configvalues[$configcounter] = $str;
+		$alreadprinted[$configcounter] = 0;
+		$configcounter ++;
+	} else {
+		if (/([\w]+)=/) {
+			$configoptions[$configcounter] = $1;
+			$configvalues[$configcounter] = $str;
+			$alreadprinted[$configcounter] = 0;
+			$configcounter ++;
+		} else {
+			$configoptions[$configcounter] = "$_";
+			$configvalues[$configcounter] = $str;
+			$alreadprinted[$configcounter] = 0;
+			$configcounter ++;
+		}
+	}
+};
+
+# now, read and output the entire configfile, except for the overridden
+# parts... for those the new value is printed.
+# O(N^2) algorithm so if this is slow I need to look at it later
+
+open (FILE2,"$args[1]") || die "Could not open $args[1]";
+while (<FILE2>) {
+	my $nooutput;
+	my $counter;
+	my $configname="$_";
+	my $match;
+
+	if (/\# ([\w]+) is not set/) {
+		$configname = $1;
+	} else {
+		if (/([\w]+)=/) {
+			$configname  = $1;
+		} 
+	}
+
+	$counter = 0;
+	$nooutput = 0;
+	$match = 0;
+#	print "C : $configname";
+	while ($counter < $configcounter) {	
+		if ("$configname" eq "$configoptions[$counter]") {	
+			if ( ("$_" eq "$configvalues[$counter]") || ("$configname" eq "") ) {
+				$match = 1;
+			} else {
+				$alreadyprinted[$configcounter] = 1;
+				print "$_";
+				$match = 1;
+			}
+		}
+		$counter++;
+	}
+	if ($match == 0) {
+		print "$_";
+	}
+
+}
+
+
+1;


Index: cross-amd64.sh
===================================================================
RCS file: cross-amd64.sh
diff -N cross-amd64.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-amd64.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=x86_64-linux- ARCH=x86_64 hammer
+


Index: cross-i586.sh
===================================================================
RCS file: cross-i586.sh
diff -N cross-i586.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-i586.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make ARCH=i386 i586
+


Index: cross-i686.sh
===================================================================
RCS file: cross-i686.sh
diff -N cross-i686.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-i686.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make ARCH=i386 i686
+


Index: cross-ia64.sh
===================================================================
RCS file: cross-ia64.sh
diff -N cross-ia64.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-ia64.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,2 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ia64-linux- ARCH=ia64  ia64


Index: cross-iseries.sh
===================================================================
RCS file: cross-iseries.sh
diff -N cross-iseries.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-iseries.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc64-linux- ARCH=ppc64 ppc64iseries
+


Index: cross-ppc.sh
===================================================================
RCS file: cross-ppc.sh
diff -N cross-ppc.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-ppc.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc-linux- ARCH=ppc ppc
+


Index: cross-ppc64.sh
===================================================================
RCS file: cross-ppc64.sh
diff -N cross-ppc64.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-ppc64.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc64-linux- ARCH=ppc64 ppc64
+


Index: cross-ppc8260.sh
===================================================================
RCS file: cross-ppc8260.sh
diff -N cross-ppc8260.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-ppc8260.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc-linux- ARCH=ppc ppc8260
+


Index: cross-ppc8560.sh
===================================================================
RCS file: cross-ppc8560.sh
diff -N cross-ppc8560.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-ppc8560.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc-linux- ARCH=ppc ppc8560
+


Index: cross-pseries.sh
===================================================================
RCS file: cross-pseries.sh
diff -N cross-pseries.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-pseries.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,3 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=ppc64-linux- ARCH=ppc64 pseries64
+


Index: cross-s390.sh
===================================================================
RCS file: cross-s390.sh
diff -N cross-s390.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-s390.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,2 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=s390-linux- ARCH=s390  s390


Index: cross-s390x.sh
===================================================================
RCS file: cross-s390x.sh
diff -N cross-s390x.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cross-s390x.sh	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,2 @@
+export PATH=$PATH:/opt/cross/bin
+make CROSS_COMPILE=s390x-linux- ARCH=s390  s390x


Index: merge.pl
===================================================================
RCS file: merge.pl
diff -N merge.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ merge.pl	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,79 @@
+#! /usr/bin/perl
+
+my @args=@ARGV;
+my @configoptions;
+my @configvalues;
+my @alreadyprinted;
+my $configcounter = 0;
+
+# optionally print out the architecture as the first line of our output
+my $arch = $args[2];
+if (defined $arch) {
+	print "# $arch\n";
+}
+
+# first, read the override file
+
+open (FILE,"$args[0]") || die "Could not open $args[0]";
+while (<FILE>) {
+	my $str = $_;
+	if (/\# ([\w]+) is not set/) {
+		$configoptions[$configcounter] = $1;
+		$configvalues[$configcounter] = $str;
+		$alreadyprinted[$configcounter] = 0;
+		$configcounter ++;
+	} else {
+		if (/([\w]+)=/) {
+			$configoptions[$configcounter] = $1;
+			$configvalues[$configcounter] = $str;
+			$alreadyprinted[$configcounter] = 0;
+			$configcounter ++;
+		} 
+	}
+};
+
+# now, read and output the entire configfile, except for the overridden
+# parts... for those the new value is printed.
+# O(N^2) algorithm so if this is slow I need to look at it later
+
+open (FILE2,"$args[1]") || die "Could not open $args[1]";
+while (<FILE2>) {
+	my $nooutput;
+	my $counter;
+	my $configname;
+
+	if (/\# ([\w]+) is not set/) {
+		$configname = $1;
+	} else {
+		if (/([\w]+)=/) {
+			$configname  = $1;
+		} 
+	}
+
+	$counter = 0;
+	$nooutput = 0;
+	while ($counter < $configcounter) {	
+		if ("$configname" eq "$configoptions[$counter]") {	
+			$nooutput = 1;
+			$alreadyprinted[$configcounter] = 1;
+			print "$configvalues[$counter]";
+		}
+		$counter++;
+	}
+
+	if ($nooutput == 0) {
+		print "$_";
+	}
+}
+
+# now print the new values from the overridden configfile
+my $counter = 0;
+
+while ($counter < $configcounter) {	
+	if ($alreadyprinted[$counter]==0) {
+		print "$configvalues[$counter]";
+	}
+	$counter++;
+}
+
+1;


Index: rediffall.pl
===================================================================
RCS file: rediffall.pl
diff -N rediffall.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rediffall.pl	21 Dec 2005 11:24:56 -0000	1.2
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+#
+# Script to rediff all patches in the spec
+# Usage: perl -w rediffall.pl < kernel-2.4.spec
+#
+# $workdir is where the new rediff'ed patches are created
+# $origdir is where the original patches and tarball are located
+#
+# Note that both $workdir and $origdir must be absolute path names.
+# Suggestion: create a /kernel symbolic link to the top of your CVS tree.
+
+my $workdir = "/dev/shm/redifftree";
+my $origdir = "/home/davej/src/rhat/kernel/devel";
+my $kernver = "linux-2.6.13";
+my $datestrip = "s/^\\(\\(+++\\|---\\) [^[:blank:]]\\+\\)[[:blank:]].*/\\1/";
+my $patchindex = 0;
+my @patchlist;
+
+# phase 1: create a tree
+print "Extracting pristine source..\n";
+system("mkdir -p $workdir");
+system("rm -rf $workdir/*");
+chdir("$workdir");
+system("tar -jxvf $origdir/$kernver.tar.bz2 &> /dev/null");
+system("cp -al $kernver linux-$patchindex");
+
+# phase 2: read the spec from stdin and store all patches
+print "Reading specfile..\n";
+
+while (<>) {
+	my $line = $_;
+	if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.\+]+\.patch)/) {
+		$patchlist[$1] = $2;
+	} else {
+		if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.]+\.bz2)/) {
+			$patchlist[$1] = $2;
+		}
+	}
+
+	if ($line =~ /^%patch([0-9]+) -p1/) {
+		# copy the tree, apply the patch, diff and remove the old tree
+		my $oldindex = $patchindex;
+		$patchindex = $1;
+
+		print "rediffing patch number $patchindex: $patchlist[$patchindex]\n";
+
+		system("cp -al linux-$oldindex linux-$patchindex");
+		chdir("linux-$patchindex");
+		if ($patchlist[$patchindex] =~ /bz2/) {
+			system("bzcat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null");
+		} else {
+			system("cat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null");
+		}
+		chdir("$workdir");
+		system("rm -f `find -name \"*orig\"`");
+		if ($patchlist[$patchindex] =~ /bz2/) {
+		} else {
+			system("diff -urNp --exclude-from=/home/davej/.exclude linux-$oldindex linux-$patchindex | sed '$datestrip' > $patchlist[$patchindex]");
+		}
+		system("rm -rf linux-$oldindex");
+	}
+};
+
+1;




More information about the fedora-cvs-commits mailing list