Exemplo n.º 1
0
    def testIsDirectory(self):
        from inary.actionsapi.shelltools import isDirectory

        assert not isDirectory('doc/dependency.pdf')
        assert isDirectory('/usr/lib')
        assert isDirectory('/etc/inary')
        assert not isDirectory('tests/shelltest.py')
Exemplo n.º 2
0
def ninja_install(parameters=""):
    insdir = util.join_path(
        get.installDIR(),
        "emul32") if get.buildTYPE() == "emul32" else get.installDIR()
    if system('DESTDIR="{}" ninja install {} -C inaryPackageBuild'.format(
            insdir, get.makeJOBS())):
        raise NinjaBuildError(_("Install failed."))
    if isDirectory("{}/emul32".format(get.installDIR())):
        if isDirectory("{}/emul32/lib32".format(get.installDIR())):
            copy("{}/emul32/lib32".format(get.installDIR()),
                 "{}/".format(get.installDIR()))
        if isDirectory("{}/emul32/usr/lib32".format(get.installDIR())):
            copy("{}/emul32/usr/lib32".format(get.installDIR()),
                 "{}/usr/".format(get.installDIR()))
        removeDir("/emul32")
Exemplo n.º 3
0
def ninja_build(parameters=""):
    if system("ninja {} {} -C inaryPackageBuild".format(
            get.makeJOBS(), parameters)):
        raise NinjaBuildError(_("Build failed."))
    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("{}/emul32".format(get.installDIR())):
            removeDir("/emul32")
Exemplo n.º 4
0
def install():
    shelltools.cd("build")

    autotools.rawInstall("install_root=%s" % get.installDIR())

    inarytools.dodir("/etc/ld.so.conf.d")

    if get.buildTYPE() != "emul32":
        #Install locales once.
        autotools.rawInstall("install_root=%s localedata/install-locales" %
                             get.installDIR())

    if get.buildTYPE() == "emul32":
        inarytools.dosym("/lib32/ld-linux.so.2", "/lib/ld-linux.so.2")

        shelltools.echo(
            "%s/etc/ld.so.conf.d/60-glibc-32bit.conf" % get.installDIR(),
            ldconf32bit)

        inarytools.removeDir("/tmp32")

    # We'll take care of the cache ourselves
    if shelltools.isFile("%s/etc/ld.so.cache" % get.installDIR()):
        inarytools.remove("/etc/ld.so.cache")

    # Prevent overwriting of the /etc/localtime symlink
    if shelltools.isFile("%s/etc/localtime" % get.installDIR()):
        inarytools.remove("/etc/localtime")

    # Nscd needs this to work
    inarytools.dodir("/var/run/nscd")
    inarytools.dodir("/var/db/nscd")

    # remove zoneinfo files since they are coming from timezone packages
    # we disable timezone build with a patch, keeping these lines for easier maintenance
    if shelltools.isDirectory("%s/usr/share/zoneinfo" % get.installDIR()):
        inarytools.removeDir("/usr/share/zoneinfo")

    #while bootstrapping whole system zic should not be removed. timezone package does not build without it. # 2013
    #for i in ["zdump","zic"]:
    #if shelltools.isFile("%s/usr/sbin/%s" % (get.installDIR(), i)):
    #inarytools.remove("/usr/sbin/%s" % i)

    shelltools.cd("..")
    #remove unused locale
    for l in ["ku", "hy"]:
        shelltools.system("rm -rf {}/usr/lib/locale/{}_*".format(
            get.installDIR(), l))
        shelltools.system("rm -rf {}/usr/share/locale/{}*".format(
            get.installDIR(), l))
        shelltools.system("rm -rf {}/usr/share/i18n/locales/{}_*".format(
            get.installDIR(), l))
    #clean
    if shelltools.isFile("%s/usr/lib/locale/locale-archive" %
                         get.installDIR()):
        inarytools.remove("/usr/lib/locale/locale-archive")

    inarytools.dodoc("NEWS", "README*", "LICENSES")
Exemplo n.º 5
0
def rawInstall(parameters='', argument='install'):
    """install source into install directory with given parameters = PREFIX=get.installDIR()"""
    if system('make {0} {1}'.format(parameters, argument)):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("{}/emul32".format(get.installDIR())):
            removeDir("/emul32")
Exemplo n.º 6
0
def install():
    inarytools.dodoc("debian/copyright", "debian/changelog", "README")
    inarytools.dobin("os-prober")
    inarytools.dobin("linux-boot-prober")
    inarytools.insinto("/usr/lib/os-prober", "newns")
    inarytools.insinto("/usr/share/os-prober", "common.sh")
    for d in ("os-probes", "os-probes/mounted", "os-probes/init",
              "linux-boot-probes", "linux-boot-probes/mounted"):
        inarytools.insinto("/usr/lib/%s" % d, "%s/common/*" % d)
        if shelltools.isDirectory("%s/x86" % d):
            inarytools.insinto("/usr/lib/%s" % d, "%s/x86/*" % d)
    shelltools.touch("labels")
    inarytools.insinto("/var/lib/os-prober/", "labels")
Exemplo n.º 7
0
def install(parameters='', argument='install'):
    """install source into install directory with given parameters"""
    args = 'make prefix={0}/{1} \
            datadir={0}/{2} \
            infodir={0}/{3} \
            localstatedir={0}/{4} \
            mandir={0}/{5} \
            sysconfdir={0}/{6} \
            {7} \
            {8}'.format(get.installDIR(), get.defaultprefixDIR(),
                        get.dataDIR(), get.infoDIR(), get.localstateDIR(),
                        get.manDIR(), get.confDIR(), parameters, argument)

    if system(args):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("{}/emul32".format(get.installDIR())):
            removeDir("/emul32")
Exemplo n.º 8
0
def fixpc():
    """ fix .pc files in installDIR()/usr/lib32/pkgconfig"""
    path = "{}/usr/lib32/pkgconfig".format(get.installDIR())
    if isDirectory(path):
        for f in ls("{}/*.pc".format(path)):
            dosed(f, get.emul32prefixDIR(), get.defaultprefixDIR())