def _doInstall(self): ball = self.getBall() if cautils.is_tarfile(ball): if not self.__cygwinPlatform: self._doInstallExternal(ball) tf = cautils.open_tarfile(ball, self.__dosXz) if self.__cygwinPlatform: tf.extractall(self.__absRoot) # Force slash to the end of each directories members = tf.getmembers() tf.close() lst = [] for m in members: if m.isdir() and not m.name.endswith("/"): lst.append(m.name + "/") else: lst.append(m.name) else: print("{0}: bad tarball {1}. Install failed.".format( self.__appName, ball), file=sys.stderr) return self._writeFileList(lst) status = 1 if not self.__pkgName in self._integrityControl(): status = 0 self.__installed[status][self.__pkgName] = os.path.basename(ball) self._writeInstalled()
def _doInstall(self): ball = self.getBall(); if cautils.is_tarfile(ball): if not self.__cygwinPlatform: self._doInstallExternal(ball); tf = cautils.open_tarfile(ball, self.__dosXz); if self.__cygwinPlatform: tf.extractall(self.__absRoot); # Force slash to the end of each directories members = tf.getmembers(); tf.close(); lst = []; for m in members: if m.isdir() and not m.name.endswith("/"): lst.append(m.name + "/"); else: lst.append(m.name); else: print("{0}: bad tarball {1}. Install failed.".format( self.__appName, ball ), file=sys.stderr); return; self._writeFileList(lst); status = 1; if not self.__pkgName in self._integrityControl(): status = 0; self.__installed[status][self.__pkgName] = os.path.basename(ball); self._writeInstalled();
def _doUnpack(self): ball = self.getBall() basename = os.path.basename(ball) self.__pkgName = re.sub(r"(-src)*\.tar\.(bz2|gz)", '', basename) if os.path.exists(self.__pkgName): self._printErr("{0} already exists. Not overwriting.".format( self.__pkgName)) return 1 os.mkdir(self.__pkgName) if cautils.is_tarfile(ball): tf = cautils.open_tarfile(ball, self.__dosXz) tf.extractall(self.__pkgName) tf.close() else: raise InvalidFileException("Bad source tarball {0}, \n" "SOURCE UNPACK FAILED".format(ball)) if not os.path.exists(self.__pkgName): raise IOError(self.__pkgName) print(self.__pkgName)
def _doUnpack(self): ball = self.getBall(); basename = os.path.basename(ball); self.__pkgName = re.sub(r"(-src)*\.tar\.(bz2|gz)", '', basename); if os.path.exists(self.__pkgName): self._printErr("{0} already exists. Not overwriting.".format( self.__pkgName )); return 1; os.mkdir(self.__pkgName); if cautils.is_tarfile(ball): tf = cautils.open_tarfile(ball, self.__dosXz); tf.extractall(self.__pkgName); tf.close(); else: raise InvalidFileException( "Bad source tarball {0}, \n" "SOURCE UNPACK FAILED".format(ball) ); if not os.path.exists(self.__pkgName): raise IOError(self.__pkgName); print(self.__pkgName);