RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Anders F. Björklund Root: /v/rpm/cvs Email: a...@rpm5.org Module: xar Date: 15-Jan-2009 16:27:02 Branch: HEAD Handle: 2009011515270200 Modified files: xar/lib lzmaxar.c Log: xar: adjust liblzma api for xz 4.999.7beta Summary: Revision Changes Path 1.14 +18 -2 xar/lib/lzmaxar.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: xar/lib/lzmaxar.c ============================================================================ $ cvs diff -u -r1.13 -r1.14 lzmaxar.c --- xar/lib/lzmaxar.c 29 Dec 2008 21:30:38 -0000 1.13 +++ xar/lib/lzmaxar.c 15 Jan 2009 15:27:02 -0000 1.14 @@ -134,7 +134,9 @@ else return 0; + #if LZMA_VERSION < 49990070U lzma_init_decoder(); + #endif #ifdef LZMA_STREAM_INIT_VAR LZMA_CONTEXT(context)->lzma = LZMA_STREAM_INIT_VAR; #endif @@ -143,9 +145,12 @@ #elif LZMA_VERSION < 49990060U r = lzma_auto_decoder(&LZMA_CONTEXT(context)->lzma, lzma_easy_memory_usage(preset_level), 0); - #else + #elif LZMA_VERSION < 49990070U r = lzma_auto_decoder(&LZMA_CONTEXT(context)->lzma, lzma_easy_encoder_memusage(preset_level, 0), 0); + #else + r = lzma_auto_decoder(&LZMA_CONTEXT(context)->lzma, + lzma_easy_encoder_memusage(preset_level), 0); #endif if( (r != LZMA_OK) ) { xar_err_new(x); @@ -277,7 +282,9 @@ } } +#if LZMA_VERSION < 49990070U lzma_init_encoder(); +#endif #if LZMA_VERSION < 49990050U LZMA_CONTEXT(context)->options.check = LZMA_CHECK_CRC64; LZMA_CONTEXT(context)->options.has_crc32 = 1; /* true */ @@ -334,7 +341,7 @@ else r = lzma_stream_encoder(&LZMA_CONTEXT(context)->lzma, LZMA_CONTEXT(context)->filters, LZMA_CONTEXT(context)->check); -#else +#elif LZMA_VERSION < 49990070U if (alone){ lzma_lzma_preset(&(LZMA_CONTEXT(context)->options2), level); r = lzma_alone_encoder(&LZMA_CONTEXT(context)->lzma, @@ -343,6 +350,15 @@ else r = lzma_easy_encoder(&LZMA_CONTEXT(context)->lzma, level, 0, LZMA_CHECK_CRC64); +#else + if (alone){ + lzma_lzma_preset(&(LZMA_CONTEXT(context)->options2), level); + r = lzma_alone_encoder(&LZMA_CONTEXT(context)->lzma, + &(LZMA_CONTEXT(context)->options2)); + } + else + r = lzma_easy_encoder(&LZMA_CONTEXT(context)->lzma, + level, LZMA_CHECK_CRC64); #endif if( (r != LZMA_OK) ) { xar_err_new(x); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org