uncompress a zlib file

0

I am doing a process of cleaning up old versions of artifacts in GIT (knowing that this can make GIT out of certain bugs).

I've seen that GIT compresses those files in zlib. Route for example where they are stored:

  

xpgit10.ldcb0001./usr/local/de/gitlab/repositories/repositories/ECDY/REPOCARA.git/objects/9a>   ls -lrt total 20   -r - r - r-- 1 xpgit10 gpgitl1d 163 Dec 12 15:37 4d98cb0533fb7341399a7e7204159a1bd8bfd1

you can see that the file format is

  

xpgit10.ldcb0001./usr/local/de/gitlab/repositories/repositories/ECDY/REPOCARA.git/objects/9a>   4159a1bd8bfd1 < 4d98cb0533fb7341399a7e7204159a1bd8bfd1: VAX   COFF executable - version 24450

I am trying to do a process that unzips that file in another directory. The idea is to delete / change the files that you no longer need, and recompress with the same name.

I'm trying to do that decompression but I can not do it. The closest I've seen it with openssl, but it only shows the contents of the file, but it does not decompress it

  

xpgit10.ldcb0001./tmp/unzip> openssl enc -z -none -d <   9e38a9490fc02219a44cfe1d5306ab49151665 commit 239tree   b225939232046a73af3d116e3700e21ef540fa87 parent   90b7f35d7bad3f1688d49be9037f65ebaf3b7338 author xe07904    1514548147 +0100 committer xe07904    1514548147 +0100

     

hi

I tried the solution that comes with git but it does not work either link

On my server I have the next library installed

zlib.x86_64 1.2.3-29.el6 @ dvd.repo

Is it possible to create a process that can extract the files from a zlib?

    
asked by Javi Gomez 08.01.2018 в 12:30
source

1 answer

0

Very good,

I'm trying to decompress files that have been compressed with zlib in git.

If I execute a file on the file I want to unzip I see that

xpgit10.xxxxxxx./usr/local/de/gitlab/repositories/repositories/ECDY/REPOCARA.git/objects/83> 8c9987bd86bbe < a90ad3f9987a403be349ddd028c9987bd86bbe: VAX COFF executable not stripped - version 11592

I've seen that there was a bug in Debian and the same thing happened:

link

It seems that the error is related to the loss of the file header, so it can not be decompressed.

I have searched for some information about Red Hat and I have found this (it is the OS on which I am moving)

link

Do you think it could be an OS bug?

I have created the following code in Python

import zipfile try:     import zlib     compression = zipfile.ZIP_DEFLATED except:     compression = zipfile.ZIP_STORED

zf = zipfile.ZipFile ("example.zip", mode="w")

try:     zf.write ("test.txt", compress_type = compression) finally:     zf.close ()

As output I get a compressed file in zlib called "example.zlib"

However, this seems to be correct xpgit10.ldcb0001./tmp> file example.zip example.zip: Zip archive data, at least v2.0 to extract

    
answered by 08.01.2018 в 17:28