[PATCH] Check configuration files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duble check generated configuration files in order to avoid
discrepancies like this one:

https://bugzilla.redhat.com/show_bug.cgi?id=1347454

Signed-off-by: Miguel Flores Silverio <floresmigu3l@xxxxxxxxx>
---
* PATCHv1
   - Check config files at compilation time

 * PATCHv2
   - Check config files before and after oldconfig is aplied
   - Save log of mismatches in logs directory in tree

 * PATCHv3
   - save mismatches in .mismatches and exit compilation if
     there any.
   - Display error message and config options in .mismatches
   - Fixed bug in awk statment
   - Only save mismatches of enabled config options
   - Delete temporary files outside function to avoid confusion
   
 kernel.spec | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/kernel.spec b/kernel.spec
index 8d3587d..431a17c 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1231,9 +1231,21 @@ rm -f kernel-%{version}-*debug.config
 
 %define make make %{?cross_opts}
 
+# Check configuration files for any discrepancies
+CheckConfigs(){
+    awk 'NR==FNR{configs[$0]++;next;}
+    NR!=FNR && !($0 in configs)' $1 $2 | egrep '^CONFIG_' > .mismatches
+    if [ -s .mismatches ]
+    then
+	echo "Error: Mismatches found in configuration files"
+	cat .mismatches
+	exit 1
+    fi
+}
 # now run oldconfig over all the config files
 for i in *.config
 do
+  cat $i > temp-$i
   mv $i .config
   Arch=`head -1 .config | cut -b 3-`
   make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
@@ -1247,6 +1259,8 @@ do
   make ARCH=$Arch oldnoconfig
   echo "# $Arch" > configs/$i
   cat .config >> configs/$i
+  CheckConfigs configs/$i temp-$i
+  rm temp-$i
 done
 # end of kernel config
 %endif
--
2.7.4
_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux