Print this page
6366 Allow ON_CLOSED_BINS to point to a directory with tarballs
        
@@ -21,10 +21,11 @@
 
 #
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2012 by Delphix. All rights reserved.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
 #
 
 #
 # Makefile for system source
 #
@@ -135,12 +136,21 @@
 clobber_local:
         @cd tools; pwd; $(MAKE) clobber
         @cd common/mapfiles; pwd; $(MAKE) clobber
         @cd msg; pwd; $(MAKE) clobber
 
+# If the tarballs are included inside ON_CLOSED_BINS, use those to extract and
+# preserve the permissions (in case a distro ships them).
+
 closedbins: bldtools $(ROOTDIRS) FRC
         @CLOSED_ROOT="$$ON_CLOSED_BINS/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
+        if [ -f "$$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2" ]; then \
+                $(ECHO) "Extracting tarball $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2"; \
+                (cd $(ROOT); \
+                   $(TAR) xjpf $$ON_CLOSED_BINS/on-closed-bins$${RELEASE_BUILD+-nd}.$(MACH).tar.bz2); \
+                CLOSED_ROOT="$(ROOT)/closed/root_$(MACH)$${RELEASE_BUILD+-nd}"; \
+        fi; \
         if [ ! -d "$$CLOSED_ROOT" ]; then \
                 $(ECHO) "Error: ON_CLOSED_BINS must point to closed" \
                     "binaries."; \
                 $(ECHO) "root_$(MACH)$${RELEASE_BUILD+-nd} is not" \
                     "present in $$ON_CLOSED_BINS."; \