Procházet zdrojové kódy

Fix the annoying base-files autorebuild bug. When checking file mtimes in directories, timestamp.pl was following symlinks. This broke on base-files, because there are symlinks to /tmp and to /proc/mounts in the build directory.

SVN-Revision: 6084
Felix Fietkau před 19 roky
rodič
revize
0e3a29c270
3 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 1 1
      include/package.mk
  2. 1 0
      package/base-files/Makefile
  3. 2 3
      scripts/timestamp.pl

+ 1 - 1
include/package.mk

@@ -21,7 +21,7 @@ define Build/DefaultTargets
   ifeq ($(DUMP),)
     ifeq ($(CONFIG_AUTOREBUILD),y)
       _INFO:=
-      ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) .),$(PKG_BUILD_DIR))
+      ifneq ($$(shell $(SCRIPT_DIR)/timestamp.pl -p $(PKG_BUILD_DIR) . $(PKG_FILE_DEPEND)),$(PKG_BUILD_DIR))
         _INFO+=$(subst $(TOPDIR)/,,$(PKG_BUILD_DIR))
         $(PKG_BUILD_DIR)/.prepared: package-clean
       endif

+ 1 - 0
package/base-files/Makefile

@@ -13,6 +13,7 @@ PKG_NAME:=base-files
 PKG_RELEASE:=8
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
+PKG_FILE_DEPEND:=$(PLATFORM_DIR)
 
 REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
 ifeq ($(REV),)

+ 2 - 3
scripts/timestamp.pl

@@ -17,9 +17,8 @@ sub get_ts($$) {
 	while (<FIND>) {
 		chomp;
 		my $file = $_;
-		open FILE, "<$file";
-		my @stat = stat FILE;
-		close FILE;
+		next if -l $file;
+		my @stat = stat $file;
 		if ($stat[9] > $ts) {
 			$ts = $stat[9];
 			$fn = $file;