Changeset 552
- Timestamp:
- 09/10/99 22:55:29 (14 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/mkpatch/mkpatch.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/mkpatch/mkpatch.pl
r551 r552 368 368 # This generates diffs for drivers/i2c/Config.in 369 369 # Several adapter drivers that are included in the lm_sensors package are 370 # added at the bottom.370 # added at the first and onlu sensors marker. 371 371 # Of course, care is taken old lines are removed. 372 372 # $_[0]: sensors package root (like /tmp/sensors) … … 383 383 or die "Can't open $package_root/$package_file"; 384 384 while(<INPUT>) { 385 if (m@CONFIG_I2C_MAINBOARD@) { 386 $_ = <INPUT> while not m@^ fi$@; 387 $_ = <INPUT>; 388 $_ = <INPUT> if m@^$@; 389 } 390 if (m@^fi@) { 391 print OUTPUT << 'EOF' 385 if (m@sensors code starts here@) { 386 print OUTPUT; 387 while (<INPUT>) { 388 last if m@sensors code ends here@; 389 } 390 print OUTPUT << 'EOF'; 392 391 bool 'I2C mainboard interfaces' CONFIG_I2C_MAINBOARD 393 392 if [ "$CONFIG_I2C_MAINBOARD" = "y" ]; then … … 425 424 or die "Can't open $package_root/$package_file"; 426 425 while(<INPUT>) { 427 while (m@CONFIG_I2C_ALI5X3@ or m@CONFIG_I2C_HYDRA@ or m@CONFIG_I2C_PIIX4@ or 428 m@CONFIG_I2C_VIA@ or m@CONFIG_I2C_ISA@) { 429 $_ = <INPUT> while not m@^endif@; 430 $_ = <INPUT>; 431 $_ = <INPUT> if m@^$@; 432 } 433 if (m@Rules.make@) { 434 print OUTPUT << 'EOF' 426 if (m@sensors code starts here@) { 427 print OUTPUT; 428 while (<INPUT>) { 429 last if m@sensors code ends here@; 430 } 431 print OUTPUT << 'EOF'; 435 432 ifeq ($(CONFIG_I2C_ALI5X3),y) 436 433 L_OBJS += i2c-ali5x3.o … … 493 490 my $kernel_file = "drivers/i2c/i2c-core.c"; 494 491 my $package_file = $temp; 495 my $ right_place = 0;492 my $patch_nr = 1; 496 493 497 494 open INPUT,"$kernel_root/$kernel_file" … … 500 497 or die "Can't open $package_root/$package_file"; 501 498 while(<INPUT>) { 502 while (m@CONFIG_I2C_ALI5X3@ or m@CONFIG_I2C_HYDRA@ or m@CONFIG_I2C_PIIX4@ or 503 m@CONFIG_I2C_VIA@ or m@CONFIG_I2C_ISA@) { 504 $_ = <INPUT> while not m@#endif@; 505 $_ = <INPUT>; 506 } 507 if (m@^int __init i2c_init_all@) { 508 $right_place = 1; 509 print OUTPUT << 'EOF'; 499 if (m@sensors code starts here@) { 500 print OUTPUT; 501 while (<INPUT>) { 502 last if m@sensors code ends here@; 503 } 504 if ($patch_nr == 1) { 505 print OUTPUT << 'EOF'; 510 506 #ifdef CONFIG_I2C_ALI5X3 511 507 extern int i2c_ali5x3_init(void); … … 524 520 #endif 525 521 EOF 526 } 527 if ($right_place and m@return 0;@) { 522 } elsif ($patch_nr == 2) { 528 523 print OUTPUT << 'EOF'; 529 524 #ifdef CONFIG_I2C_ALI5X3 … … 543 538 #endif 544 539 EOF 540 } 541 $patch_nr ++; 545 542 } 546 543 print OUTPUT;
