configtest.pl 829 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/perl
  2. #
  3. # Copyright (C) 2006 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. my %change = (
  9. '^BUSYBOX' => 'make package/busybox-clean',
  10. 'OPENVPN_' => 'make package/openvpn-clean',
  11. 'SYSCONF_' => 'make package/base-files-clean target_clean',
  12. '' => 'make target_clean'
  13. );
  14. my @configfiles = (
  15. # ['package/linux/linux.config', 'build_mipsel/linux/.config' =>
  16. # 'make -C package linux-clean']
  17. );
  18. foreach my $change (keys %change) {
  19. my $v1 = `grep '$change' .config.test`;
  20. my $v2 = `grep '$change' .config`;
  21. $v1 eq $v2 or system($change{$change});
  22. }
  23. foreach my $file (@configfiles) {
  24. if ((-f $file->[0]) and (-f $file->[1])) {
  25. my @s1 = stat $file->[0];
  26. my @s2 = stat $file->[1];
  27. $s1[9] > $s2[9] and system($file->[2]);
  28. }
  29. }