[Gelistirici] trunk/pisi/pisi - tarZ support for archives (Serdar =?iso-8859-9?q?Dalg=FD=E7?=)

Fatih Aşıcı fatih at pardus.org.tr
23 Ağu 2009 Paz 08:15:59 EEST


> Modified: trunk/pisi/pisi/archive.py
> =================================================================
> --- trunk/pisi/pisi/archive.py	(original)
> +++ trunk/pisi/pisi/archive.py	Fri Aug 14 10:08:38 2009
> @@ -119,6 +119,12 @@
>              ret, out, err = util.run_batch("lzma -k -f -d %s%s" % (self.file_path,ctx.const.lzma_suffix))
>              if ret != 0:
>                  raise LzmaRuntimeError(err)
> +        elif self.type == 'tarZ':
> +            rmode = 'r:'
> +            self.file_path = self.file_path.rstrip('.Z')
> +            ret, out, err = util.run_batch("uncompress -f %s%s" % (self.file_path,'.Z'))
> +            if ret != 0:
> +                raise RuntimeError, 'Problem occured while uncompressing %s.Z file' % self.file_path

Uzantıları silmek için rstrip kullanılmamalı. Şu durumda hata olacaktır:

  "BUZ.Z".rstrip(".Z") -> "BU"

Pisi'de başka yerlerde de aynı hata yapılmış. Bunların düzeltilmesi lazım.

Hem burada uzantıyı silmeye gerek yok sanki. Önce strip edilmiş, sonra komut
çağrılırken yeniden eklenmiş.

>          else:
>              raise UnknownArchiveType
>  
> @@ -168,8 +174,8 @@
>              if tarinfo.name.endswith(".desktop"):
>                  ctx.ui.notify(pisi.ui.desktopfile, desktopfile=tarinfo.name)
>  
> -        # Bug #10680
> -        if self.type == 'tarlzma':
> +        # Bug #10680 and addition for tarZ files
> +        if self.type == 'tarlzma' or self.type == 'tarZ':
>              os.unlink(self.file_path)
>  
>          os.chdir(oldwd)
> @@ -187,6 +193,9 @@
>              elif self.type == 'tarlzma':
>                  wmode = 'w:'
>                  self.file_path = self.file_path.rstrip(ctx.const.lzma_suffix)
> +            elif self.type == 'tarZ':
> +                wmode = 'w:'
> +                self.file_path = self.file_path.rstrip(".Z")

Aynı hata burada da var.



Gelistirici mesaj listesiyle ilgili daha fazla bilgi