summaryrefslogtreecommitdiffstats
path: root/merge.pl
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2021-03-05 10:03:27 -0600
committerJustin M. Forbes <jforbes@fedoraproject.org>2021-03-05 10:03:27 -0600
commit3422e04a2e31dba3e17af206f160d4fc409f4250 (patch)
treeef03b0b60e236af96331d0ddb83208bb40bcf9f0 /merge.pl
parent7a64d107da5cd0ea8bad9200ebcd37146324361f (diff)
downloadkernel-3422e04a2e31dba3e17af206f160d4fc409f4250.tar.gz
kernel-3422e04a2e31dba3e17af206f160d4fc409f4250.tar.xz
kernel-3422e04a2e31dba3e17af206f160d4fc409f4250.zip
kernel-5.11.3-50
* Fri Mar 05 2021 Justin M. Forbes <jforbes@fedoraproject.org> [5.11.3-50] - PCI: Add MCFG quirks for Tegra194 host controllers (Vidya Sagar) - Revert "PCI: Add MCFG quirks for Tegra194 host controllers" (Peter Robinson) - forgot to push this one earlier (Justin M. Forbes) - Reference the patch as version.patchlevel to more easily see diffs between stable releases (Justin M. Forbes) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
Diffstat (limited to 'merge.pl')
-rwxr-xr-x[l---------]merge.pl73
1 files changed, 72 insertions, 1 deletions
diff --git a/merge.pl b/merge.pl
index b77225dd2..dbaf5927b 120000..100755
--- a/merge.pl
+++ b/merge.pl
@@ -1 +1,72 @@
-configs/merge.pl \ No newline at end of file
+#! /usr/bin/perl
+
+my @args=@ARGV;
+my %configvalues;
+my @configoptions;
+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 = $_;
+ my $configname;
+
+ if (/\# ([\w]+) is not set/) {
+ $configname = $1;
+ } elsif (/^\#/) {
+ # fall through on comments like 'avoid CONFIG_FOO=y'
+ ;
+ } elsif (/([\w]+)=/) {
+ $configname = $1;
+ }
+
+ if (defined($configname) && !exists($configvalues{$configname})) {
+ $configvalues{$configname} = $str;
+ $configoptions[$configcounter] = $configname;
+ $configcounter ++;
+ }
+};
+
+# now, read and output the entire configfile, except for the overridden
+# parts... for those the new value is printed.
+
+open (FILE2,"$args[1]") || die "Could not open $args[1]";
+while (<FILE2>) {
+ my $configname;
+
+ if (/\# ([\w]+) is not set/) {
+ $configname = $1;
+ } elsif (/^\#/) {
+ # fall through on comments like 'avoid CONFIG_FOO=y'
+ ;
+ } elsif (/([\w]+)=/) {
+ $configname = $1;
+ }
+
+ if (defined($configname) && exists($configvalues{$configname})) {
+ print "$configvalues{$configname}";
+ delete($configvalues{$configname});
+ } else {
+ print "$_";
+ }
+}
+
+# now print the new values from the overridden configfile
+my $counter = 0;
+
+while ($counter < $configcounter) {
+ my $configname = $configoptions[$counter];
+ if (exists($configvalues{$configname})) {
+ print "$configvalues{$configname}";
+ }
+ $counter++;
+}
+
+1;