changeset 4459:e2b86a77a303

ForcedAutogenMagic: More expand fixes.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Thu, 23 Oct 2008 16:12:25 +0200
parents 57d533c21968
children 2d425dc6ab14
files gub/commands.py
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/gub/commands.py	Thu Oct 23 16:12:02 2008 +0200
+++ b/gub/commands.py	Thu Oct 23 16:12:25 2008 +0200
@@ -282,17 +282,16 @@
         if not autodir:
             autodir = package.expand ('%(srcdir)s')
         if os.path.exists (os.path.join (autodir, 'bootstrap')):
-            self.system (package.expand ('cd %(autodir)s && ./bootstrap', locals ()), logger)
+            self.system ('cd %(autodir)s && ./bootstrap' % locals (), logger)
         elif os.path.exists (os.path.join (autodir, 'bootstrap.sh')):
-            self.system (package.expand ('cd %(autodir)s && ./bootstrap.sh', locals ()), logger)
+            self.system ('cd %(autodir)s && ./bootstrap.sh' % locals (), logger)
         elif os.path.exists (os.path.join (autodir, 'autogen.sh')):
-            s = ''
-            s = file (package.expand ('%(autodir)s/autogen.sh', locals ())).read ()
+            s = file ('%(autodir)s/autogen.sh' % locals ()).read ()
             noconfigure = ' --help'
             if '--noconfigure' in s:
                 noconfigure = ' --noconfigure' + noconfigure
-            self.system (package.expand ('cd %(autodir)s && NOCONFIGURE=1 bash autogen.sh %(noconfigure)s',
-                                         locals ()), logger)
+            self.system ('cd %(autodir)s && NOCONFIGURE=1 bash autogen.sh %(noconfigure)s' % locals (),
+                         logger)
         else:
             libtoolize = misc.path_find (os.environ['PATH'], 'libtoolize')
             if libtoolize:
@@ -304,8 +303,8 @@
                 if (os.path.isdir (os.path.join (autodir, 'ltdl'))
                     or os.path.isdir (os.path.join (autodir, 'libltdl'))):
                     libtoolize += ' --ltdl'
-                self.system (package.expand ('rm -rf %(autodir)s/libltdl %(autodir)s/ltdl && (cd %(autodir)s && %(libtoolize)s',
-                                             locals ()), logger)
+                self.system ('rm -rf %(autodir)s/libltdl %(autodir)s/ltdl && (cd %(autodir)s && %(libtoolize)s'
+                             % locals (), logger)
             aclocal_opt = ''
             if os.path.exists (package.expand ('%(system_prefix)s/share/aclocal')):
                 aclocal_opt = '-I %(system_prefix)s/share/aclocal'
@@ -313,23 +312,23 @@
             headcmd = ''
             for c in ('configure.in','configure.ac'):
                 try:
-                    str = open (package.expand ('%(autodir)s/' + c, locals ())).read ()
+                    str = file ('%(autodir)s/%(c)s' % locals ()).read ()
                     m = re.search ('A[CM]_CONFIG_HEADER', str)
                     str = 0   ## don't want to expand str
                     if m:
-                        headcmd = package.expand ('cd %(autodir)s && autoheader %(aclocal_opt)s', locals ())
+                        headcmd = 'cd %(autodir)s && autoheader %(aclocal_opt)s' % locals ()
                         break
 
                 except IOError:
                     pass
 
-            self.system (package.expand ('''
+            self.system ('''
 cd %(autodir)s && aclocal %(aclocal_opt)s
 %(headcmd)s
 cd %(autodir)s && autoconf %(aclocal_opt)s
-''', locals ()), logger)
-            if os.path.exists (package.expand ('%(srcdir)s/Makefile.am')):
-                self.system (package.expand ('cd %(srcdir)s && automake --add-missing --copy --foreign', locals ()), logger)
+''' % locals (), logger)
+            if os.path.exists ('%(autodir)s/Makefile.am' % locals ()):
+                self.system ('cd %(autodir)s && automake --add-missing --copy --foreign' % locals (), logger)
 
 class AutogenMagic (ForcedAutogenMagic):
     def execute (self, logger):