Exemplo n.º 1
0
    def create_pbuilder(self, cross, noccache, ccachesize):
        # Remove old pbuilder directory, if it exists
        do('rm -rf "%s" "%s"' %
           (os.path.join(self.builddir, "pbuilder"),
            os.path.join(self.builddir, "pbuilder_cross")))

        # make hooks.d and pbuilder directory
        if cross:
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "hooks.d"))
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "aptcache"))
        else:
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder", "hooks.d"))
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder", "aptcache"))
        do('mkdir -p "%s"' %
           os.path.join(self.builddir, "aptconfdir", "apt.conf.d"))

        if not noccache:
            ccache_path = os.path.join(self.builddir, "ccache")
            do('mkdir -p "%s"' % ccache_path)
            do('chmod a+w "%s"' % ccache_path)
            ccache_fp = open(os.path.join(ccache_path, "ccache.conf"), "w")
            ccache_fp.write("max_size = %s" % ccachesize)
            ccache_fp.close()

        # write config files
        if cross:
            pbuilder_write_cross_config(self.builddir, self.xml, noccache)
            pbuilder_write_repo_hook(self.builddir, self.xml, cross)
            do('chmod -R 755 "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "hooks.d"))
        else:
            pbuilder_write_config(self.builddir, self.xml, noccache)
            pbuilder_write_repo_hook(self.builddir, self.xml, cross)
            do('chmod -R 755 "%s"' %
               os.path.join(self.builddir, "pbuilder", "hooks.d"))
        pbuilder_write_apt_conf(self.builddir, self.xml)

        # Run pbuilder --create
        if cross:
            do('pbuilder --create --buildplace "%s" '
               '--configfile "%s" --aptconfdir "%s" '
               '--debootstrapopts --include="git gnupg";' %
               (os.path.join(self.builddir, "pbuilder_cross"),
                os.path.join(self.builddir, "cross_pbuilderrc"),
                os.path.join(self.builddir, "aptconfdir")))
        else:
            do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
               '--debootstrapopts --include="git gnupg"' %
               (os.path.join(self.builddir, "pbuilderrc"),
                os.path.join(self.builddir, "aptconfdir")))
Exemplo n.º 2
0
    def create_pbuilder(self, cross):
        # Remove old pbuilder directory, if it exists
        do('rm -rf "%s" "%s"' %
           (os.path.join(self.builddir, "pbuilder"),
            os.path.join(self.builddir, "pbuilder_cross")))

        # make hooks.d and pbuilder directory
        if cross:
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "hooks.d"))
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "aptcache"))
        else:
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder", "hooks.d"))
            do('mkdir -p "%s"' %
               os.path.join(self.builddir, "pbuilder", "aptcache"))
        do('mkdir -p "%s"' %
           os.path.join(self.builddir, "aptconfdir", "apt.conf.d"))

        # write config files
        if cross:
            pbuilder_write_cross_config(self.builddir, self.xml)
            pbuilder_write_repo_hook(self.builddir, self.xml, cross)
            do('chmod -R 755 "%s"' %
               os.path.join(self.builddir, "pbuilder_cross", "hooks.d"))
        else:
            pbuilder_write_config(self.builddir, self.xml)
            pbuilder_write_repo_hook(self.builddir, self.xml, cross)
            do('chmod -R 755 "%s"' %
               os.path.join(self.builddir, "pbuilder", "hooks.d"))
        pbuilder_write_apt_conf(self.builddir, self.xml)

        # Run pbuilder --create
        if cross:
            do('pbuilder --create --buildplace "%s" '
               '--configfile "%s" --aptconfdir "%s" '
               '--debootstrapopts --include="git gnupg";' %
               (os.path.join(self.builddir, "pbuilder_cross"),
                os.path.join(self.builddir, "cross_pbuilderrc"),
                os.path.join(self.builddir, "aptconfdir")))
        else:
            do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
               '--debootstrapopts --include="git gnupg"' %
               (os.path.join(self.builddir, "pbuilderrc"),
                os.path.join(self.builddir, "aptconfdir")))
Exemplo n.º 3
0
    def create_pbuilder(self):
        # Remove old pbuilder directory, if it exists
        self.log.do('rm -rf "%s"' % os.path.join(self.builddir, "pbuilder"))

        # make hooks.d and pbuilder directory
        self.log.do(
            'mkdir -p "%s"' %
            os.path.join(
                self.builddir,
                "pbuilder",
                "hooks.d"))
        self.log.do(
            'mkdir -p "%s"' %
            os.path.join(
                self.builddir,
                "pbuilder",
                "aptcache"))
        self.log.do(
            'mkdir -p "%s"' %
            os.path.join(
                self.builddir,
                "aptconfdir",
                "apt.conf.d"))

        # write config files
        pbuilder_write_config(self.builddir, self.xml, self.log)
        pbuilder_write_apt_conf(self.builddir, self.xml)
        pbuilder_write_repo_hook(self.builddir, self.xml)
        self.log.do(
            'chmod -R 755 "%s"' %
            os.path.join(
                self.builddir,
                "pbuilder",
                "hooks.d"))

        # Run pbuilder --create
        self.log.do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
                    '--debootstrapopts --include="git gnupg2"' % (
                        os.path.join(self.builddir, "pbuilderrc"),
                        os.path.join(self.builddir, "aptconfdir")))
Exemplo n.º 4
0
    def create_pbuilder(self):
        # Remove old pbuilder directory, if it exists
        self.log.do('rm -rf "%s"' % os.path.join(self.builddir, "pbuilder"))

        # make hooks.d and pbuilder directory
        self.log.do('mkdir -p "%s"' %
                    os.path.join(self.builddir, "pbuilder", "hooks.d"))
        self.log.do('mkdir -p "%s"' %
                    os.path.join(self.builddir, "aptconfdir", "apt.conf.d"))

        # write config files
        pbuilder_write_config(self.builddir, self.xml, self.log)
        pbuilder_write_apt_conf(self.builddir, self.xml)
        pbuilder_write_repo_hook(self.builddir, self.xml)
        self.log.do('chmod 755 "%s"' % os.path.join(
            self.builddir, "pbuilder", "hooks.d", "D10elbe_apt_sources"))

        # Run pbuilder --create
        self.log.do(
            'pbuilder --create --configfile "%s" --aptconfdir "%s" --extrapackages git'
            % (os.path.join(self.builddir, "pbuilderrc"),
               os.path.join(self.builddir, "aptconfdir")))
Exemplo n.º 5
0
    def create_pbuilder(self):
        # Remove old pbuilder directory, if it exists
        self.log.do('rm -rf "%s"' % os.path.join(self.builddir, "pbuilder"))

        # make hooks.d and pbuilder directory
        self.log.do('mkdir -p "%s"' %
                    os.path.join(self.builddir, "pbuilder", "hooks.d"))
        self.log.do('mkdir -p "%s"' %
                    os.path.join(self.builddir, "pbuilder", "aptcache"))
        self.log.do('mkdir -p "%s"' %
                    os.path.join(self.builddir, "aptconfdir", "apt.conf.d"))

        # write config files
        pbuilder_write_config(self.builddir, self.xml, self.log)
        pbuilder_write_apt_conf(self.builddir, self.xml)
        pbuilder_write_repo_hook(self.builddir, self.xml)
        self.log.do('chmod -R 755 "%s"' %
                    os.path.join(self.builddir, "pbuilder", "hooks.d"))

        # Run pbuilder --create
        self.log.do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
                    '--debootstrapopts --include="git gnupg"' %
                    (os.path.join(self.builddir, "pbuilderrc"),
                     os.path.join(self.builddir, "aptconfdir")))