(self)
return fakechroot_so
Select fakechroot sharable object library
Select fakechroot sharable object library
Select fakechroot sharable object library
def select_fakechroot_so(self):
        """Select fakechroot sharable object library"""
        image_list = []
        if Config.conf['fakechroot_so']:
            if isinstance(Config.conf['fakechroot_so'], list):
                image_list = Config.conf['fakechroot_so']
            elif is_genstr(Config.conf['fakechroot_so']):
                image_list = [Config.conf['fakechroot_so'], ]

            if "/" in Config.conf['fakechroot_so']:
                if os.path.exists(Config.conf['fakechroot_so']):
                    return os.path.realpath(Config.conf['fakechroot_so'])
        elif os.path.exists(self.container_dir + "/libfakechroot.so"):
            return self.container_dir + "/libfakechroot.so"
        else:
            lib = "libfakechroot"
            deflib = "libfakechroot.so"
            image_list = [deflib, ]
            guest = OSInfo(self.container_root)
            arch = guest.arch()
            (distro, version) = guest.osdistribution()
            if "Alpine" not in distro:
                version = version.split(".")[0]

            if arch == "amd64":
                image_list = ["%s-%s-%s-x86_64.so" % (lib, distro, version),
                              "%s-%s-x86_64.so" % (lib, distro),
                              "%s-x86_64.so" % (lib), deflib]
            elif arch == "i386":
                image_list = ["%s-%s-%s-x86.so" % (lib, distro, version),
                              "%s-%s-x86.so" % (lib, distro),
                              "%s-x86.so" % (lib), deflib]
            elif arch == "arm64":
                image_list = ["%s-%s-%s-arm64.so" % (lib, distro, version),
                              "%s-%s-arm64.so" % (lib, distro),
                              "%s-arm64.so" % (lib), deflib]
            elif arch == "arm":
                image_list = ["%s-%s-%s-arm.so" % (lib, distro, version),
                              "%s-%s-arm.so" % (lib, distro),
                              "%s-arm.so" % (lib), deflib]

        f_util = FileUtil(self.localrepo.libdir)
        fakechroot_so = f_util.find_file_in_dir(image_list)
        if not os.path.exists(fakechroot_so):
            Msg().err("Error: no libfakechroot found", image_list)
            sys.exit(1)

        Msg().out("Info: fakechroot_so:", fakechroot_so, l=Msg.DBG)
        return fakechroot_so
def select_fakechroot_so ( self ) : image_list = [ ] if Config . conf [ 'fakechroot_so' ] : if isinstance ( Config . conf [ 'fakechroot_so' ] , list ) : image_list = Config . conf [ 'fakechroot_so' ] elif is_genstr ( Config . conf [ 'fakechroot_so' ] ) : image_list = [ Config . conf [ 'fakechroot_so' ] , ] if "/" in Config . conf [ 'fakechroot_so' ] : if os . path . exists ( Config . conf [ 'fakechroot_so' ] ) : return os . path . realpath ( Config . conf [ 'fakechroot_so' ] ) elif os . path . exists ( self . container_dir + "/libfakechroot.so" ) : return self . container_dir + "/libfakechroot.so" else : lib = "libfakechroot" deflib = "libfakechroot.so" image_list = [ deflib , ] guest = OSInfo ( self . container_root ) arch = guest . arch ( ) ( distro , version ) = guest . osdistribution ( ) if "Alpine" not in distro : version = version . split ( "." ) [ 0 ] if arch == "amd64" : image_list = [ "%s-%s-%s-x86_64.so" % ( lib , distro , version ) , "%s-%s-x86_64.so" % ( lib , distro ) , "%s-x86_64.so" % ( lib ) , deflib ] elif arch == "i386" : image_list = [ "%s-%s-%s-x86.so" % ( lib , distro , version ) , "%s-%s-x86.so" % ( lib , distro ) , "%s-x86.so" % ( lib ) , deflib ] elif arch == "arm64" : image_list = [ "%s-%s-%s-arm64.so" % ( lib , distro , version ) , "%s-%s-arm64.so" % ( lib , distro ) , "%s-arm64.so" % ( lib ) , deflib ] elif arch == "arm" : image_list = [ "%s-%s-%s-arm.so" % ( lib , distro , version ) , "%s-%s-arm.so" % ( lib , distro ) , "%s-arm.so" % ( lib ) , deflib ] f_util = FileUtil ( self . localrepo . libdir ) fakechroot_so = f_util . find_file_in_dir ( image_list ) if not os . path . exists ( fakechroot_so ) : Msg ( ) . err ( "Error: no libfakechroot found" , image_list ) sys . exit ( 1 ) Msg ( ) . out ( "Info: fakechroot_so:" , fakechroot_so , l = Msg . DBG ) return fakechroot_so