コード例 #1
0
    def completeInstallation(self, component, archs, builder):
        sandbox = Sandbox([self], builder)

        print("==> Complete MySQL installation")

        sandbox.setup()

        if not os.path.isdir(os.path.join(sandbox.path, "xamppfiles", 'etc')):
            os.makedirs(os.path.join(sandbox.path, "xamppfiles", 'etc'))

        # Install config file
        shutil.copy(os.path.join(self.resourcesPath, 'my.cnf'),
                    os.path.join(sandbox.path, "xamppfiles", 'etc/my.cnf'))

        check_call([
            os.path.join(sandbox.path, "xamppfiles", "bin/mysql_install_db"),
            "--datadir=%s" % os.path.join(sandbox.path, "var/mysql/")
        ])

        changes = sandbox.changes()

        print("Changes: %s", changes)

        filesToCopy = list(changes['new'])
        filesToCopy.extend([file['file'] for file in changes['changed']])

        for src in filesToCopy:
            dest = os.path.join(self.buildPath, src[1:])

            if not os.path.isdir(os.path.dirname(dest)):
                os.makedirs(os.path.dirname(dest))

            shutil.copy(src, dest)

        sandbox.tearDown()
コード例 #2
0
ファイル: MySQL.py プロジェクト: ApacheFriends/XAMPP-Builder
    def completeInstallation(self, component, archs, builder):
        sandbox = Sandbox([self], builder)

        print("==> Complete MySQL installation")

        sandbox.setup()

        if not os.path.isdir(os.path.join(sandbox.path, "xamppfiles", 'etc')):
            os.makedirs(os.path.join(sandbox.path, "xamppfiles", 'etc'))

        # Install config file
        shutil.copy(
            os.path.join(self.resourcesPath, 'my.cnf'),
            os.path.join(sandbox.path, "xamppfiles", 'etc/my.cnf')
        )

        check_call([os.path.join(sandbox.path, "xamppfiles", "bin/mysql_install_db"), "--datadir=%s" % os.path.join(sandbox.path, "var/mysql/")])

        changes = sandbox.changes()

        print("Changes: %s", changes)

        filesToCopy = list(changes['new'])
        filesToCopy.extend([ file['file'] for file in changes['changed'] ])

        for src in filesToCopy:
            dest = os.path.join(self.buildPath, src[1:])

            if not os.path.isdir(os.path.dirname(dest)):
                os.makedirs(os.path.dirname(dest))

            shutil.copy(src, dest)

        sandbox.tearDown()
コード例 #3
0
    def setupCPANP(self, component, archs, builder):
        sandbox = Sandbox([self], builder)

        print("==> Setup CPANP")

        sandbox.setup()

        perl_lib = os.path.join(sandbox.path, 'xamppfiles', 'lib', 'perl5',
                                self.version)

        # Install config files
        shutil.copy(os.path.join(self.resourcesPath, 'Config.pm'),
                    os.path.join(perl_lib, 'CPAN/Config.pm'))

        if not os.path.isdir(os.path.join(perl_lib, 'CPANPLUS/Config')):
            os.makedirs(os.path.join(perl_lib, 'CPANPLUS/Config'))
        shutil.copy(os.path.join(self.resourcesPath, 'System.pm'),
                    os.path.join(perl_lib, 'CPANPLUS/Config/System.pm'))

        check_call([
            os.path.join(sandbox.path, 'xamppfiles', 'bin/cpanp'), 's',
            'selfupdate', 'core'
        ])

        check_call([
            os.path.join(sandbox.path, 'xamppfiles', 'bin/perl'),
            os.path.join(self.resourcesPath, 'upgrade_modules.pl')
        ])

        modules = ['MLDBM', 'Digest::MD5', 'MLDBM::Sync', 'Apache::ASP']
        for module in modules:
            check_call([
                os.path.join(sandbox.path, 'xamppfiles', 'bin/cpanp'), 'i',
                module, '--skiptest', '--verbose'
            ])

        shutil.rmtree(os.path.join(sandbox.path, 'xamppfiles', 'var'))

        changes = sandbox.changes()

        filesToCopy = list(changes['new'])
        filesToCopy.extend([file['file'] for file in changes['changed']])

        for src in filesToCopy:
            dest = os.path.join(self.buildPath, src[1:])

            if not os.path.isdir(os.path.dirname(dest)):
                os.makedirs(os.path.dirname(dest))

            if os.path.exists(dest) and not os.access(dest, os.W_OK):
                check_call(['chmod', '+w', dest])

            shutil.copy(src, dest)

        sandbox.tearDown()
コード例 #4
0
ファイル: Perl.py プロジェクト: ApacheFriends/XAMPP-Builder
    def setupCPANP(self, component, archs, builder):
        sandbox = Sandbox([self], builder)

        print("==> Setup CPANP")

        sandbox.setup()

        perl_lib = os.path.join(sandbox.path, 'xamppfiles', 'lib', 'perl5', self.version)

        # Install config files
        shutil.copy(
            os.path.join(self.resourcesPath, 'Config.pm'),
            os.path.join(perl_lib, 'CPAN/Config.pm')
        )

        if not os.path.isdir(os.path.join(perl_lib, 'CPANPLUS/Config')):
            os.makedirs(os.path.join(perl_lib, 'CPANPLUS/Config'))
        shutil.copy(
            os.path.join(self.resourcesPath, 'System.pm'),
            os.path.join(perl_lib, 'CPANPLUS/Config/System.pm')
        )

        check_call([os.path.join(sandbox.path, 'xamppfiles', 'bin/cpanp'),'s','selfupdate','core'])

        check_call([os.path.join(sandbox.path, 'xamppfiles', 'bin/perl'),
                    os.path.join(self.resourcesPath, 'upgrade_modules.pl')])

        modules = ['MLDBM', 'Digest::MD5', 'MLDBM::Sync', 'Apache::ASP']
        for module in modules:
            check_call([os.path.join(sandbox.path, 'xamppfiles', 'bin/cpanp'), 'i', module, '--skiptest', '--verbose'])

        shutil.rmtree(os.path.join(sandbox.path, 'xamppfiles', 'var'))

        changes = sandbox.changes()

        filesToCopy = list(changes['new'])
        filesToCopy.extend([ file['file'] for file in changes['changed'] ])

        for src in filesToCopy:
            dest = os.path.join(self.buildPath, src[1:])

            if not os.path.isdir(os.path.dirname(dest)):
                os.makedirs(os.path.dirname(dest))

            if os.path.exists(dest) and not os.access(dest, os.W_OK):
                check_call(['chmod', '+w', dest])

            shutil.copy(src, dest)

        sandbox.tearDown()