def fixCompiledPy(lookInto = '/usr/lib/%s/' % get.curPYTHON()): ''' cleans *.py[co] from packages ''' for root, dirs, files in os.walk('%s/%s' % (get.installDIR(),lookInto)): for compiledFile in files: if compiledFile.endswith('.pyc') or compiledFile.endswith('.pyo'): if can_access_file('%s/%s' % (root,compiledFile)): unlink('%s/%s' % (root,compiledFile))
def configure(parameters = ''): '''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"''' if can_access_file('configure'): gnuconfig_update() prefix = get.emul32prefixDIR() if get.buildTYPE() == "emul32" else get.defaultprefixDIR() args = './configure \ --prefix=/%s \ --build=%s \ --mandir=/%s \ --infodir=/%s \ --datadir=/%s \ --sysconfdir=/%s \ --localstatedir=/%s \ --libexecdir=/%s \ %s%s' % (prefix, \ get.HOST(), get.manDIR(), \ get.infoDIR(), get.dataDIR(), \ get.confDIR(), get.localstateDIR(), get.libexecDIR(), "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "", parameters) if system(args): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError(_('No configure script found.'))
def make(parameters = ''): '''make source with given parameters.''' if can_access_file('Makefile'): if system('make %s' % parameters): raise MakeError(_('Make failed.')) else: if system('perl Build %s' % parameters): raise MakeError(_('perl build failed.'))
def install(parameters = 'install'): if can_access_file('Makefile'): args = 'make DESTDIR=%s destdir=%s %s' % (get.installDIR(), get.installDIR(), parameters) if system(args): raise InstallError(_('Install failed.')) else: raise InstallError(_('No Makefile found.'))
def rawConfigure(parameters = ''): '''configure source with given parameters = "--prefix=/usr --libdir=/usr/lib --with-nls"''' if can_access_file('configure'): gnuconfig_update() if system('./configure %s' % parameters): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError(_('No configure script found.'))
def removePodfiles(path = 'usr/lib/perl5/'): ''' cleans *.pod files from perl packages ''' full_path = '%s/%s' % (get.installDIR(), path) for root, dirs, files in os.walk(full_path): for packFile in files: if packFile.endswith(".pod"): if can_access_file('%s/%s' % (root, packFile)): unlink('%s/%s' % (root, packFile)) removeEmptydirs(root)
def removePacklist(path = 'usr/lib/perl5/'): ''' cleans .packlist file from perl packages ''' full_path = '%s/%s' % (get.installDIR(), path) for root, dirs, files in os.walk(full_path): for packFile in files: if packFile == ".packlist": if can_access_file('%s/%s' % (root, packFile)): unlink('%s/%s' % (root, packFile)) removeEmptydirs(root)
def configure(parameters = ''): '''configure source with given parameters.''' export('PERL_MM_USE_DEFAULT', '1') if can_access_file('Build.PL'): if system('perl Build.PL installdirs=vendor destdir=%s' % get.installDIR()): raise ConfigureError(_('Configure failed.')) else: if system('perl Makefile.PL %s PREFIX=/usr INSTALLDIRS=vendor DESTDIR=%s' % (parameters, get.installDIR())): raise ConfigureError(_('Configure failed.'))
def install(parameters = 'install'): '''install source with given parameters.''' if can_access_file('Makefile'): if system('make %s' % parameters): raise InstallError(_('Make failed.')) else: if system('perl Build install'): raise MakeError(_('perl install failed.')) removePacklist() removePodfiles()
def configure(parameters = ''): ''' parameters = '--with-nls --with-libusb --with-something-usefull ''' if can_access_file('configure'): args = './configure \ --prefix=%s \ --build=%s \ --with-x \ --enable-mitshm \ --with-xinerama \ --with-qt-dir=%s \ --enable-mt \ --with-qt-libraries=%s/lib \ --disable-dependency-tracking \ --disable-debug \ %s' % (get.kdeDIR(), get.HOST(), get.qtDIR(), get.qtDIR(), parameters) if system(args): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError(_('No configure script found.'))
def __init__(self, value=''): pisilinux.actionsapi.Error.__init__(self, value) self.value = value ctx.ui.error(value) if can_access_file('config.log'): ctx.ui.error(_('Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd())
def fixInfoDir(): infoDir = '%s/usr/share/info/dir' % get.installDIR() if can_access_file(infoDir): unlink(infoDir)