Example #1
0
 def execute (self, logger):
     string, name = self.args
     kwargs = self.kwargs
     mode = 'w'
     if sys.version.startswith ('3') and type (string) == bytes:
         mode += 'b'
     if 'mode' in self.kwargs:
         mode = kwargs['mode']
         del kwargs['mode']
     loggedos.dump_file (logger, string, name, mode, **kwargs)
Example #2
0
        def wrap (logger, file):
            dir = os.path.dirname (file)
            base = os.path.basename (file)
            cmd = self.expand ('mv %(file)s %(dir)s/.%(base)s', locals ())
            loggedos.system (logger, cmd)
            loggedos.dump_file (logger, self.expand ('''#!/bin/sh
LD_LIBRARY_PATH=%(system_prefix)s/lib
%(system_prefix)s/bin/.%(base)s "$@"
''', locals ()), file)
            loggedos.chmod (logger, file, octal.o755)
Example #3
0
 def execute(self, logger):
     string, name = self.args
     kwargs = self.kwargs
     mode = 'w'
     if sys.version.startswith('3') and type(string) == bytes:
         mode += 'b'
     if 'mode' in self.kwargs:
         mode = kwargs['mode']
         del kwargs['mode']
     loggedos.dump_file(logger, string, name, mode, **kwargs)
Example #4
0
        def wrap(logger, file):
            dir = os.path.dirname(file)
            base = os.path.basename(file)
            cmd = self.expand('mv %(file)s %(dir)s/.%(base)s', locals())
            loggedos.system(logger, cmd)
            loggedos.dump_file(
                logger,
                self.expand(
                    '''#!/bin/sh
LD_LIBRARY_PATH=%(system_prefix)s/lib
%(system_prefix)s/bin/.%(base)s "$@"
''', locals()), file)
            loggedos.chmod(logger, file, octal.o755)
Example #5
0
    def execute (self, logger):
        logger.write_log ('Creating shar file from %s\n' % repr (self.kwargs), 'info') 
        name = self.kwargs['name']
        pretty_name = self.kwargs['pretty_name']
        release = self.kwargs['release']
        shar_file = self.kwargs['shar_file']
        shar_head = self.kwargs['shar_head']
        tarball = self.kwargs['tarball']
        version = self.kwargs['version']

        length = os.stat (tarball)[6]
        base_file = os.path.split (tarball)[1]
        script = loggedos.read_file (logger, shar_head)
        header_length = 0
        _z = misc.compression_flag (tarball)
        header_length = len (script % locals ()) + 1
        used_in_sharhead = '%(base_file)s %(name)s %(pretty_name)s %(version)s %(release)s %(header_length)s %(_z)s'
        used_in_sharhead % locals ()
        loggedos.dump_file (logger, script % locals (), shar_file)
        loggedos.system (logger, 'cat %(tarball)s >> %(shar_file)s' % locals ())
        loggedos.chmod (logger, shar_file, octal.o755)
        loggedos.system (logger, 'rm %(tarball)s' % locals ())
Example #6
0
    def execute(self, logger):
        logger.write_log('Creating shar file from %s\n' % repr(self.kwargs),
                         'info')
        name = self.kwargs['name']
        pretty_name = self.kwargs['pretty_name']
        release = self.kwargs['release']
        shar_file = self.kwargs['shar_file']
        shar_head = self.kwargs['shar_head']
        tarball = self.kwargs['tarball']
        version = self.kwargs['version']
        target_cpu = self.kwargs['target_cpu']

        length = os.stat(tarball)[6]
        base_file = os.path.split(tarball)[1]
        script = loggedos.read_file(logger, shar_head)
        header_length = 0
        _z = misc.compression_flag(tarball)
        header_length = len(script % locals()) + 1
        used_in_sharhead = '%(base_file)s %(name)s %(pretty_name)s %(version)s %(release)s %(header_length)s %(target_cpu)s %(_z)s'
        used_in_sharhead % locals()
        loggedos.dump_file(logger, script % locals(), shar_file)
        loggedos.system(logger, 'cat %(tarball)s >> %(shar_file)s' % locals())
        loggedos.chmod(logger, shar_file, octal.o755)
        loggedos.system(logger, 'rm %(tarball)s' % locals())