diff options
-rw-r--r-- | build/pack.c | 6 | ||||
-rw-r--r-- | build/parsePrep.c | 3 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | lib/psm.c | 4 | ||||
-rw-r--r-- | lib/rpmds.c | 6 | ||||
-rw-r--r-- | macros.in | 3 | ||||
-rw-r--r-- | rpm2cpio.c | 4 | ||||
-rw-r--r-- | rpmio/rpmfileutil.c | 4 | ||||
-rw-r--r-- | rpmio/rpmfileutil.h | 3 | ||||
-rw-r--r-- | rpmio/rpmio.c | 32 | ||||
-rw-r--r-- | rpmio/rpmio_internal.h | 2 |
11 files changed, 38 insertions, 30 deletions
diff --git a/build/pack.c b/build/pack.c index 9d2be0cce..31350e90d 100644 --- a/build/pack.c +++ b/build/pack.c @@ -385,9 +385,9 @@ rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, compr = "bzip2"; /* Add prereq on rpm version that understands bzip2 payloads */ (void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1"); - } else if (strcmp(s+1, "lzdio") == 0) { - compr = "lzma"; - (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.90-1"); + } else if (strcmp(s+1, "xzdio") == 0) { + compr = "xz"; + (void) rpmlibNeedsFeature(h, "PayloadIsXz", "5.2-1"); } else { rpmlog(RPMLOG_ERR, _("Unknown payload compression: %s\n"), rpmio_flags); diff --git a/build/parsePrep.c b/build/parsePrep.c index fbb63db34..9a919bd8b 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -203,6 +203,9 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) case COMPRESSED_LZMA: t = "%{__lzma} -dc"; break; + case COMPRESSED_XZ: + t = "%{__xz} -dc"; + break; } zipper = rpmGetPath(t, NULL); if (needtar) { diff --git a/configure.ac b/configure.ac index 2940a9182..0455e5a95 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,7 @@ AC_SUBST(__ID_U) AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) AC_PATH_PROG(__LZMA, lzma, /usr/bin/lzma, $MYPATH) +AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH) AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) @@ -1607,8 +1607,8 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) psm->rpmio_flags = "r.gzdio"; if (!strcmp(payload_compressor, "bzip2")) psm->rpmio_flags = "r.bzdio"; - if (!strcmp(payload_compressor, "lzma")) - psm->rpmio_flags = "r.lzdio"; + if (!strcmp(payload_compressor, "xz")) + psm->rpmio_flags = "r.xzdio"; rpmtdFreeData(&pc); headerFree(h); diff --git a/lib/rpmds.c b/lib/rpmds.c index bdc865f39..39649db06 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -970,9 +970,11 @@ static const struct rpmlibProvides_s rpmlibProvides[] = { (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), N_("package payload can be compressed using bzip2.") }, #endif - { "rpmlib(PayloadIsLzma)", "4.4.90-1", +#if HAVE_LZMA_H + { "rpmlib(PayloadIsXz)", "5.2-1", (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), - N_("package payload can be compressed using lzma.") }, + N_("package payload can be compressed using xz.") }, +#endif { "rpmlib(PayloadFilesHavePrefix)", "4.0-1", (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), N_("package payload file(s) have \"./\" prefix.") }, @@ -47,6 +47,7 @@ %__install @__INSTALL@ %__ln_s @LN_S@ %__lzma @__LZMA@ +%__xz @__XZ@ %__make @__MAKE@ %__mkdir @__MKDIR@ %__mkdir_p @MKDIR_P@ @@ -322,7 +323,7 @@ package or when debugging this package.\ # Compression type and level for source/binary package payloads. # "w9.gzdio" gzip level 9 (default). # "w9.bzdio" bzip2 level 9. -# "w7.lzdio" lzma level 7, lzma's default. +# "w7.xzdio" xz level 7, xz's default. # #%_source_payload w9.gzdio #%_binary_payload w9.gzdio diff --git a/rpm2cpio.c b/rpm2cpio.c index 6674a722a..cdf36b1ba 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -78,8 +78,8 @@ int main(int argc, char *argv[]) rpmio_flags = "r.gzdio"; if (!strcmp(payload_compressor, "bzip2")) rpmio_flags = "r.bzdio"; - if (!strcmp(payload_compressor, "lzma")) - rpmio_flags = "r.lzdio"; + if (!strcmp(payload_compressor, "xz")) + rpmio_flags = "r.xzdio"; rpmtdFreeData(&pc); } diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index 5e47db4fd..92685bc56 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -358,8 +358,8 @@ int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed) } else if ((magic[0] == 0xfd) && (magic[1] == 0x37) && (magic[2] == 0x7a) && (magic[3] == 0x58) && (magic[4] == 0x5a) && (magic[5] == 0x00)) { - /* new style lzma with magic */ - *compressed = COMPRESSED_LZMA; + /* new style xz (lzma) with magic */ + *compressed = COMPRESSED_XZ; } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */ ((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */ ((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */ diff --git a/rpmio/rpmfileutil.h b/rpmio/rpmfileutil.h index fd7a813ba..d0bba5315 100644 --- a/rpmio/rpmfileutil.h +++ b/rpmio/rpmfileutil.h @@ -22,7 +22,8 @@ typedef enum rpmCompressedMagic_e { COMPRESSED_OTHER = 1, /*!< gzip can handle */ COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ COMPRESSED_ZIP = 3, /*!< unzip can handle */ - COMPRESSED_LZMA = 4 /*!< lzma can handle */ + COMPRESSED_LZMA = 4, /*!< lzma can handle */ + COMPRESSED_XZ = 5 /*!< xz can handle */ } rpmCompressedMagic; /** \ingroup rpmfileutil diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 3cd03ba57..d471433fa 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -36,7 +36,7 @@ extern int h_errno; #define FDONLY(fd) assert(fdGetIo(fd) == fdio) #define GZDONLY(fd) assert(fdGetIo(fd) == gzdio) #define BZDONLY(fd) assert(fdGetIo(fd) == bzdio) -#define LZDONLY(fd) assert(fdGetIo(fd) == lzdio) +#define LZDONLY(fd) assert(fdGetIo(fd) == xzdio) #define UFDONLY(fd) /* assert(fdGetIo(fd) == ufdio) */ @@ -91,7 +91,7 @@ static const FDIO_t fpio; static const FDIO_t ufdio; static const FDIO_t gzdio; static const FDIO_t bzdio; -static const FDIO_t lzdio; +static const FDIO_t xzdio; /** */ @@ -140,8 +140,8 @@ static const char * fdbg(FD_t fd) sprintf(be, "BZD %p fdno %d", fps->fp, fps->fdno); #endif #if HAVE_LZMA_H - } else if (fps->io == lzdio) { - sprintf(be, "LZD %p fdno %d", fps->fp, fps->fdno); + } else if (fps->io == xzdio) { + sprintf(be, "XZD %p fdno %d", fps->fp, fps->fdno); #endif } else if (fps->io == fpio) { sprintf(be, "%s %p(%d) fdno %d", @@ -1162,7 +1162,7 @@ static const char * getFdErrstr (FD_t fd) } else #endif /* HAVE_BZLIB_H */ #ifdef HAVE_LZMA_H - if (fdGetIo(fd) == lzdio) { + if (fdGetIo(fd) == xzdio) { errstr = fd->errcookie; } else #endif /* HAVE_LZMA_H */ @@ -1355,7 +1355,7 @@ static inline void * lzdFileno(FD_t fd) FDSANE(fd); for (i = fd->nfps; i >= 0; i--) { FDSTACK_t * fps = &fd->fps[i]; - if (fps->io != lzdio) + if (fps->io != xzdio) continue; rc = fps->fp; break; @@ -1371,7 +1371,7 @@ static FD_t lzdOpen(const char * path, const char * mode) if ((lzfile = lzopen(path, mode)) == NULL) return NULL; fd = fdNew("open (lzdOpen)"); - fdPop(fd); fdPush(fd, lzdio, lzfile, -1); + fdPop(fd); fdPush(fd, xzdio, lzfile, -1); return fdLink(fd, "lzdOpen"); } @@ -1387,7 +1387,7 @@ static FD_t lzdFdopen(void * cookie, const char * fmode) if (fdno < 0) return NULL; lzfile = lzdopen(fdno, fmode); if (lzfile == NULL) return NULL; - fdPush(fd, lzdio, lzfile, fdno); + fdPush(fd, xzdio, lzfile, fdno); return fdLink(fd, "lzdFdopen"); } @@ -1471,18 +1471,18 @@ static int lzdClose(void * cookie) DBGIO(fd, (stderr, "==>\tlzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); - if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "LZDIO", stderr); + if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "XZDIO", stderr); if (rc == 0) fd = fdFree(fd, "open (lzdClose)"); return rc; } -static struct FDIO_s lzdio_s = { +static struct FDIO_s xzdio_s = { lzdRead, lzdWrite, lzdSeek, lzdClose, NULL, NULL, NULL, fdFileno, NULL, lzdOpen, lzdFileno, lzdFlush }; -static const FDIO_t lzdio = &lzdio_s; +static const FDIO_t xzdio = &xzdio_s; #endif /* HAVE_LZMA_H */ @@ -1719,8 +1719,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); fd = bzdFdopen(fd, zstdio); #endif #if HAVE_LZMA_H - } else if (!strcmp(end, "lzdio")) { - iof = lzdio; + } else if (!strcmp(end, "xzdio")) { + iof = xzdio; fd = lzdFdopen(fd, zstdio); #endif } else if (!strcmp(end, "ufdio")) { @@ -1850,7 +1850,7 @@ int Fflush(FD_t fd) return bzdFlush(vh); #endif #if HAVE_LZMA_H - if (vh && fdGetIo(fd) == lzdio) + if (vh && fdGetIo(fd) == xzdio) return lzdFlush(vh); #endif /* FIXME: If we get here, something went wrong above */ @@ -1879,9 +1879,9 @@ int Ferror(FD_t fd) i--; /* XXX fdio under bzdio always has fdno == -1 */ #endif #if HAVE_LZMA_H - } else if (fps->io == lzdio) { + } else if (fps->io == xzdio) { ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0; - i--; /* XXX fdio under lzdio always has fdno == -1 */ + i--; /* XXX fdio under xzdio always has fdno == -1 */ #endif } else { /* XXX need to check ufdio/gzdio/bzdio/fdio errors correctly. */ diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 3d53aa8eb..82dd43381 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -46,7 +46,7 @@ struct _FD_s { ssize_t bytesRemain; /* ufdio: */ int syserrno; /* last system errno encountered */ - const void *errcookie; /* gzdio/bzdio/ufdio/lzdio: */ + const void *errcookie; /* gzdio/bzdio/ufdio/xzdio: */ FDSTAT_t stats; /* I/O statistics */ |