Merge b-s to m-c.
authorKyle Huey <khuey@kylehuey.com>
Wed, 04 Jan 2012 10:39:52 -0500
changeset 84960 58326f271ab78de6d77d6f08ca6806d6a0b5f84b
parent 84955 0eec6ba6a87aa3149854bb7680eff9ac0cb924f4 (current diff)
parent 84959 c56d11e05feb181418c308766dd93f13733e413d (diff)
child 84961 29f2858488df164802458ce9a9a158993b6a5107
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
Merge b-s to m-c.
config/autoconf.mk.in
--- a/build/pymake/pymake/functions.py
+++ b/build/pymake/pymake/functions.py
@@ -188,19 +188,18 @@ class FilteroutFunction(Function):
 class SortFunction(Function):
     name = 'sort'
     minargs = 1
     maxargs = 1
 
     __slots__ = Function.__slots__
 
     def resolve(self, makefile, variables, fd, setting):
-        d = list(self._arguments[0].resolvesplit(makefile, variables, setting))
-        d.sort()
-        util.joiniter(fd, d)
+        d = set(self._arguments[0].resolvesplit(makefile, variables, setting))
+        util.joiniter(fd, sorted(d))
 
 class WordFunction(Function):
     name = 'word'
     minargs = 2
     maxargs = 2
 
     __slots__ = Function.__slots__
 
new file mode 100644
--- /dev/null
+++ b/build/pymake/tests/sort.mk
@@ -0,0 +1,4 @@
+# sort should remove duplicates
+all:
+	@test "$(sort x a y b z c a z b x c y)" = "a b c x y z"
+	@echo "TEST-PASS"
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -365,16 +365,17 @@ BIN_SUFFIX	= @BIN_SUFFIX@
 ASM_SUFFIX	= @ASM_SUFFIX@
 IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
 LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@
 USE_N32		= @USE_N32@
 HAVE_64BIT_OS	= @HAVE_64BIT_OS@
 
 CC		    = @CC@
 CXX		    = @CXX@
+CPP       = @CPP@
 
 CC_VERSION	= @CC_VERSION@
 CXX_VERSION	= @CXX_VERSION@
 
 GNU_AS		= @GNU_AS@
 GNU_LD		= @GNU_LD@
 GNU_CC		= @GNU_CC@
 GNU_CXX		= @GNU_CXX@
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -187,16 +187,17 @@ BIN_SUFFIX	= @BIN_SUFFIX@
 ASM_SUFFIX	= @ASM_SUFFIX@
 IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
 LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@
 USE_N32		= @USE_N32@
 HAVE_64BIT_OS	= @HAVE_64BIT_OS@
 
 CC		    = @CC@
 CXX		    = @CXX@
+CPP       = @CPP@
 
 CC_VERSION	= @CC_VERSION@
 CXX_VERSION	= @CXX_VERSION@
 
 GNU_AS		= @GNU_AS@
 GNU_LD		= @GNU_LD@
 GNU_CC		= @GNU_CC@
 GNU_CXX		= @GNU_CXX@
--- a/toolkit/mozapps/installer/Packager.pm
+++ b/toolkit/mozapps/installer/Packager.pm
@@ -32,27 +32,29 @@ my($line)             = "";   # line bei
 my($srcdir)           = "";   # root directory being copied from
 my($destdir)          = "";   # root directory being copied to
 my($package)          = "";   # file listing files to copy
 my($os)               = "";   # os type (MSDOS, Unix)
 my($lineno)           = 0;    # line # of package file for error text
 my($debug)            = 0;    # controls amount of debug output
 my($dirflag)          = 0;    # flag: are we copying a directory?
 my($help)             = 0;    # flag: if set, print usage
+my($fatal_warnings)   = 0;    # flag: whether package warnings (missing files or invalid entries) are fatal
 my($flat)             = 0;    # copy everything into the package dir, not into separate
                               #   component dirs
-
+my($delayed_error)    = 0;    # flag: whether an error was found while reading the manifest but we still
+                              # chose to finish reading it 
 #
 # Copy
 #
 # Loop over each line in the specified manifest, copying into $destdir
 #
 
 sub Copy {
-  ($srcdir, $destdir, $package, $os, $flat, $help, $debug, @components) = @_;
+  ($srcdir, $destdir, $package, $os, $flat, $fatal_warnings, $help, $debug, @components) = @_;
 
   check_arguments();
 
   if ($os eq "MSDOS") {
     $srcdir =~ s|\\|/|;
     $destdir =~ s|\\|/|;
   }
 
@@ -142,23 +144,25 @@ sub Copy {
     (-d "$srcdir/$line") && do {
       ($debug >= 10) && print "directory copy.\n";
       do_copydir ("$srcdir/$line");
       next LINE;
     };
 
     # if we hit this, it's either a file in the package file that is
     # not in the src directory, or it is not a valid entry.
-    print "Warning: package error or possible missing or unnecessary file: $line ($package, $lineno).\n";
+    delayed_die_or_warn("package error or possible missing or unnecessary file: $line ($package, $lineno).");
 
   } # LINE
 
   close (MANIFEST);
   chdir ($saved_cwd);
-
+  if ($delayed_error) {
+    die "Error: found error(s) while packaging, see above for details.\n"
+  }
 }
 
 #
 # Delete the given file or directory
 #
 sub do_delete
 {
   my ($targetpath) = $_[0];
@@ -435,16 +439,30 @@ sub do_component
     } else {
       ($debug >= 4) && print " mkdir $destdir/$component\n";
       mkdir ("$destdir/$component", 0755) ||
         die "Error: couldn't create component directory \"$component\": $!.  Exiting...\n";
     }
   }
 }
 
+#
+# Print error (and die later) or warn, based on whether $fatal_warnings is set.
+#
+sub delayed_die_or_warn
+{
+  my ($msg) = $_[0];
+
+  if ($fatal_warnings) {
+    warn "Error: $msg\n";
+    $delayed_error = 1;
+  } else {
+    warn "Warning: $msg\n";
+  }
+}
 
 #
 # Check that arguments to script are valid.
 #
 sub check_arguments
 {
   my ($exitval) = 0;
 
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -653,19 +653,25 @@ endif
 # the MOZ_PKG_MANIFEST file and the following vars:
 # MOZ_NONLOCALIZED_PKG_LIST
 # MOZ_LOCALIZED_PKG_LIST
 # MOZ_OPTIONAL_PKG_LIST
 
 PKG_ARG = , "$(pkg)"
 
 # Define packager macro to work around make 3.81 backslash issue (bug #339933)
+
+# Controls whether missing file warnings should be fatal
+ifndef MOZ_PKG_FATAL_WARNINGS
+MOZ_PKG_FATAL_WARNINGS = 0
+endif
+
 define PACKAGER_COPY
 $(PERL) -I$(MOZILLA_DIR)/toolkit/mozapps/installer -e 'use Packager; \
-       Packager::Copy($1,$2,$3,$4,$5,$6,$7);'
+       Packager::Copy($1,$2,$3,$4,$5,$(MOZ_PKG_FATAL_WARNINGS),$6,$7);'
 endef
 
 installer-stage: stage-package
 ifndef MOZ_PKG_MANIFEST
 	$(error MOZ_PKG_MANIFEST unspecified!)
 endif
 	@rm -rf $(DEPTH)/installer-stage $(DIST)/xpt
 	@echo "Staging installer files..."