(self, tarball_file)
return True
Install the tarball
Install the tarball
Install the tarball
def _install(self, tarball_file):
        """Install the tarball"""
        if not (tarball_file and os.path.isfile(tarball_file)):
            return False
        FileUtil(self.localrepo.topdir).chmod()
        self.localrepo.create_repo()

        try:
            tfile = tarfile.open(tarball_file, "r:gz")
            FileUtil(self.localrepo.bindir).rchmod()
            for tar_in in tfile.getmembers():
                if tar_in.name.startswith("udocker_dir/bin/"):
                    tar_in.name = os.path.basename(tar_in.name)
                    Msg().out("Info: extrating", tar_in.name, l=Msg.DBG)
                    tfile.extract(tar_in, self.localrepo.bindir)
            FileUtil(self.localrepo.bindir).rchmod(stat.S_IRUSR |
                                                   stat.S_IWUSR |
                                                   stat.S_IXUSR)

            FileUtil(self.localrepo.libdir).rchmod()
            for tar_in in tfile.getmembers():
                if tar_in.name.startswith("udocker_dir/lib/"):
                    tar_in.name = os.path.basename(tar_in.name)
                    Msg().out("Info: extrating", tar_in.name, l=Msg.DBG)
                    tfile.extract(tar_in, self.localrepo.libdir)
            FileUtil(self.localrepo.libdir).rchmod()

            FileUtil(self.localrepo.docdir).rchmod()
            for tar_in in tfile.getmembers():
                if tar_in.name.startswith("udocker_dir/doc/"):
                    tar_in.name = os.path.basename(tar_in.name)
                    Msg().out("Info: extrating", tar_in.name, l=Msg.DBG)
                    tfile.extract(tar_in, self.localrepo.docdir)
            FileUtil(self.localrepo.docdir).rchmod()
            tfile.close()
        except tarfile.TarError:
            return False
        return True
def _install ( self , tarball_file ) : if not ( tarball_file and os . path . isfile ( tarball_file ) ) : return False FileUtil ( self . localrepo . topdir ) . chmod ( ) self . localrepo . create_repo ( ) try : tfile = tarfile . open ( tarball_file , "r:gz" ) FileUtil ( self . localrepo . bindir ) . rchmod ( ) for tar_in in tfile . getmembers ( ) : if tar_in . name . startswith ( "udocker_dir/bin/" ) : tar_in . name = os . path . basename ( tar_in . name ) Msg ( ) . out ( "Info: extrating" , tar_in . name , l = Msg . DBG ) tfile . extract ( tar_in , self . localrepo . bindir ) FileUtil ( self . localrepo . bindir ) . rchmod ( stat . S_IRUSR | stat . S_IWUSR | stat . S_IXUSR ) FileUtil ( self . localrepo . libdir ) . rchmod ( ) for tar_in in tfile . getmembers ( ) : if tar_in . name . startswith ( "udocker_dir/lib/" ) : tar_in . name = os . path . basename ( tar_in . name ) Msg ( ) . out ( "Info: extrating" , tar_in . name , l = Msg . DBG ) tfile . extract ( tar_in , self . localrepo . libdir ) FileUtil ( self . localrepo . libdir ) . rchmod ( ) FileUtil ( self . localrepo . docdir ) . rchmod ( ) for tar_in in tfile . getmembers ( ) : if tar_in . name . startswith ( "udocker_dir/doc/" ) : tar_in . name = os . path . basename ( tar_in . name ) Msg ( ) . out ( "Info: extrating" , tar_in . name , l = Msg . DBG ) tfile . extract ( tar_in , self . localrepo . docdir ) FileUtil ( self . localrepo . docdir ) . rchmod ( ) tfile . close ( ) except tarfile . TarError : return False return True