This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-408-ga1c9859


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  a1c9859baf0b9a062bee6218e5e3402577b2c84e (commit)
      from  457663a7cd48a675b44769368567713353011b5b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a1c9859baf0b9a062bee6218e5e3402577b2c84e

commit a1c9859baf0b9a062bee6218e5e3402577b2c84e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 25 00:58:22 2016 +0000

    Make build-many-glibcs.py re-exec itself if changed by checkout.
    
    Updating build-many-glibcs.py may result in changes to the default
    versions of components, or to the set of components (if e.g. Hurd
    support is added and that requires a new component).
    
    It's desirable for the checkout process to leave a source tree that is
    ready to use.  If the checkout updated the script itself, that means
    it needs to be rerun to cause any new versions or components
    referenced by the new script version to be properly checked out.  This
    patch makes the script check if it was modified by the checkout
    process, and re-exec itself (with the same arguments) if so.
    
    	* scripts/build-many-glibcs.py (Context.__init__): Save text of
    	script being executed.
    	(Context.get_script_text): New function.
    	(Context.exec_self): Likewise.
    	(Context.checkout): Re-exec script if changed by checkout process.

diff --git a/ChangeLog b/ChangeLog
index c57a892..9c5fdc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-11-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* scripts/build-many-glibcs.py (Context.__init__): Save text of
+	script being executed.
+	(Context.get_script_text): New function.
+	(Context.exec_self): Likewise.
+	(Context.checkout): Re-exec script if changed by checkout process.
+
 2016-11-24  Joseph Myers  <joseph@codesourcery.com>
 
 	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 72f22a8..3099415 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -61,6 +61,7 @@ class Context(object):
         self.makefile = os.path.join(self.builddir, 'Makefile')
         self.wrapper = os.path.join(self.builddir, 'wrapper')
         self.save_logs = os.path.join(self.builddir, 'save-logs')
+        self.script_text = self.get_script_text()
         if action != 'checkout':
             self.build_triplet = self.get_build_triplet()
             self.glibc_version = self.get_glibc_version()
@@ -70,6 +71,15 @@ class Context(object):
         self.add_all_configs()
         self.load_versions_json()
 
+    def get_script_text(self):
+        """Return the text of this script."""
+        with open(sys.argv[0], 'r') as f:
+            return f.read()
+
+    def exec_self(self):
+        """Re-execute this script with the same arguments."""
+        os.execv(sys.executable, [sys.executable] + sys.argv)
+
     def get_build_triplet(self):
         """Determine the build triplet with config.guess."""
         config_guess = os.path.join(self.component_srcdir('gcc'),
@@ -644,6 +654,10 @@ class Context(object):
                 self.checkout_tar(k, v, update)
                 revision = v
             self.set_component_version(k, v, explicit_versions[k], revision)
+        if self.get_script_text() != self.script_text:
+            # Rerun the checkout process in case the updated script
+            # uses different default versions or new components.
+            self.exec_self()
 
     def checkout_vcs(self, component, version, update):
         """Check out the given version of the given component from version

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |    8 ++++++++
 scripts/build-many-glibcs.py |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]