Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 241561 Details for
Bug 321439
app-arch/rpm2targz: unable to unpack lzma compressed rpms
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
lzma patch with xz fix
lzma.patch (text/plain), 1.41 KB, created by
Onur Küçük
on 2010-08-05 20:25:47 UTC
(
hide
)
Description:
lzma patch with xz fix
Filename:
MIME Type:
Creator:
Onur Küçük
Created:
2010-08-05 20:25:47 UTC
Size:
1.41 KB
patch
obsolete
>diff -Nur rpm2targz-9.0.0.4g-old/rpmoffset.c rpm2targz-9.0.0.4g/rpmoffset.c >--- rpm2targz-9.0.0.4g-old/rpmoffset.c 2010-08-05 23:02:43.933842054 +0300 >+++ rpm2targz-9.0.0.4g/rpmoffset.c 2010-08-05 23:09:01.698801889 +0300 >@@ -25,6 +25,14 @@ > const size_t len; > } magic_t; > >+int is_lzma_header(char *buf) { >+ return (buf[0] < 0xE1 >+ && buf[0] == 0x5d >+ && buf[4] < 0x20 >+ && (memcmp (buf + 10 , "\x00\x00\x00", 3) == 0 >+ || (memcmp (buf + 5, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 8) == 0))); >+} >+ > static const unsigned char magic_gzip[] = { '\037', '\213', '\010' }; > static const unsigned char magic_bzip2[] = { 'B', 'Z', 'h' }; > static const unsigned char magic_xz[] = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; >@@ -41,6 +49,7 @@ > int main(int argc, char *argv[]) > { > int show_magic = 0; >+ size_t lzma_offset = 0; > size_t i, read_cnt, offset, left; > FILE *fp = stdin; > char p[BUFSIZ]; >@@ -77,6 +86,13 @@ > } > } > >+ /* Do not stop when we find lzma, to prefer xz over lzma, since xz has lzma header at the beginning */ >+ for (i = 0; i < read_cnt; i++) { >+ if (read_cnt + left > 10 && is_lzma_header(p+i)) { >+ lzma_offset = offset + i; >+ } >+ } >+ > memmove(p, p + left + read_cnt - MAGIC_SIZE_MIN + 1, MAGIC_SIZE_MIN - 1); > > offset += read_cnt; >@@ -86,6 +102,12 @@ > } > } > >+ if (lzma_offset) { >+ if (show_magic) >+ printf("lzma "); >+ printf("%zu\n", lzma_offset); >+ } >+ > if (ferror(stdin)) > perror(argv[0]); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 321439
:
232875
|
241561
|
244145