RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 09-Jun-2017 06:39:12 Branch: rpm-5_4 Handle: 2017060904391002 Added files: (Branch: rpm-5_4) rpm/rpmio tmount.c Modified files: (Branch: rpm-5_4) rpm CHANGES rpmqv.c rpm/build files.c rpm/lib libsql.c query.c rpmchecksig.c rpminstall.c tgi.c rpm/rpmdb rpmrepo.c rpm/rpmio Makefile.am librpmio.vers mount.c poptIO.c poptIO.h rpmct.c rpmjs.cpp rpmzstd.c tdir.c tfts.c tget.c tglob.c thtml.c tmq.c tzstd.c rpm/tools roto.c rpmcache.c rpmdigest.c rpmmtree.c Log: - rpmio: rename rpmio{Fts,Open}Flags. - rpmio: add rpmio{Mount,Umount}Flags. Summary: Revision Changes Path 1.3501.2.574+2 -0 rpm/CHANGES 1.369.2.16 +7 -3 rpm/build/files.c 2.4.2.4 +2 -2 rpm/lib/libsql.c 2.216.2.17 +8 -8 rpm/lib/query.c 1.240.2.21 +6 -6 rpm/lib/rpmchecksig.c 1.229.2.9 +3 -3 rpm/lib/rpminstall.c 2.28.4.5 +4 -4 rpm/lib/tgi.c 1.4.2.9 +3 -3 rpm/rpmdb/rpmrepo.c 1.293.2.89 +9 -2 rpm/rpmio/Makefile.am 2.199.2.87 +8 -4 rpm/rpmio/librpmio.vers 2.2.10.1 +12 -4 rpm/rpmio/mount.c 1.94.2.35 +373 -70 rpm/rpmio/poptIO.c 1.8.4.7 +9 -6 rpm/rpmio/poptIO.h 1.1.2.10 +2 -2 rpm/rpmio/rpmct.c 1.1.2.6 +2 -1 rpm/rpmio/rpmjs.cpp 1.1.2.10 +3 -3 rpm/rpmio/rpmzstd.c 2.21.4.1 +1 -1 rpm/rpmio/tdir.c 2.33.4.2 +11 -7 rpm/rpmio/tfts.c 1.20.4.4 +2 -1 rpm/rpmio/tget.c 2.17.4.1 +2 -1 rpm/rpmio/tglob.c 1.2.4.3 +3 -2 rpm/rpmio/thtml.c 1.1.2.1 +318 -0 rpm/rpmio/tmount.c 1.1.2.16 +2 -2 rpm/rpmio/tmq.c 1.1.2.6 +2 -2 rpm/rpmio/tzstd.c 1.167.4.15 +2 -2 rpm/rpmqv.c 1.1.2.11 +4 -4 rpm/tools/roto.c 2.41.4.5 +6 -6 rpm/tools/rpmcache.c 2.18.4.9 +1 -1 rpm/tools/rpmdigest.c 2.17.2.12 +8 -8 rpm/tools/rpmmtree.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3501.2.573 -r1.3501.2.574 CHANGES --- rpm/CHANGES 6 Jun 2017 12:14:19 -0000 1.3501.2.573 +++ rpm/CHANGES 9 Jun 2017 04:39:10 -0000 1.3501.2.574 @@ -1,4 +1,6 @@ 5.4.17 -> 5.4.18: + - jbj: rpmio: rename rpmio{Fts,Open}Flags. + - jbj: rpmio: add rpmio{Mount,Umount}Flags. - jbj: rpmzstd: enable dictionary modes. - jbj: rpmzstd: use rpmio instead of stdio. - jbj: rpmio: fix: Fread/Fwrite/Fseek rc consistent with stdio. @@ . patch -p0 <<'@@ .' Index: rpm/build/files.c ============================================================================ $ cvs diff -u -r1.369.2.15 -r1.369.2.16 files.c --- rpm/build/files.c 16 May 2017 20:14:30 -0000 1.369.2.15 +++ rpm/build/files.c 9 Jun 2017 04:39:10 -0000 1.369.2.16 @@ -1467,6 +1467,9 @@ he->append = 0; ui32 = (rpmuint32_t) flp->fl_size; + /* XXX reproducible builds: rpm.org pull #229 */ + if (S_ISDIR(flp->fl_mode)) + flp->fl_size = 0; he->tag = RPMTAG_FILESIZES; he->t = RPM_UINT32_TYPE; he->p.ui32p = &ui32; @@ -1570,7 +1573,8 @@ } buf[0] = '\0'; - if (S_ISREG(flp->fl_mode)) { + /* XXX reproducible builds: rpm.org pull #228 */ + if (S_ISREG(flp->fl_mode) && !(flp->flags & RPMFILE_GHOST)) { unsigned dflags = 0x01; /* asAscii */ #define _mask (RPMVERIFY_FDIGEST|RPMVERIFY_HMAC) if ((flp->verifyFlags & _mask) == RPMVERIFY_HMAC) @@ -2018,7 +2022,7 @@ char * ftsSet[2]; FTS * ftsp; FTSENT * fts; - int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); + unsigned myFtsFlags = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); rpmRC rc = RPMRC_FAIL; fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */ @@ -2026,7 +2030,7 @@ ftsSet[0] = (char *) diskURL; ftsSet[1] = NULL; - ftsp = Fts_open(ftsSet, myFtsOpts, NULL); + ftsp = Fts_open(ftsSet, myFtsFlags, NULL); while ((fts = Fts_read(ftsp)) != NULL) { switch (fts->fts_info) { case FTS_D: /* preorder directory */ @@ . patch -p0 <<'@@ .' Index: rpm/lib/libsql.c ============================================================================ $ cvs diff -u -r2.4.2.3 -r2.4.2.4 libsql.c --- rpm/lib/libsql.c 15 Apr 2012 21:20:57 -0000 2.4.2.3 +++ rpm/lib/libsql.c 9 Jun 2017 04:39:10 -0000 2.4.2.4 @@ -629,9 +629,9 @@ rpmts _ts = rpmtsCreate(); int _tag = RPMDBI_ARGLIST; rpmgi _gi = rpmgiNew(_ts, _tag, NULL, 0); - int _FtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + unsigned _FtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); int _giFlags = RPMGI_NONE; - rpmRC rc = rpmgiSetArgs(_gi, vt->av, _FtsOpts, _giFlags); + rpmRC rc = rpmgiSetArgs(_gi, vt->av, _FtsFlags, _giFlags); rc = rc; vt->_ts = _ts; vt->_gi = _gi; @@ . patch -p0 <<'@@ .' Index: rpm/lib/query.c ============================================================================ $ cvs diff -u -r2.216.2.16 -r2.216.2.17 query.c --- rpm/lib/query.c 16 May 2017 18:29:10 -0000 2.216.2.16 +++ rpm/lib/query.c 9 Jun 2017 04:39:10 -0000 2.216.2.17 @@ -804,7 +804,7 @@ switch (qva->qva_source) { case RPMQV_ALL: qva->qva_gi = rpmgiNew(ts, RPMDBI_PACKAGES, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, RPMGI_NONE); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, RPMGI_NONE); if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) @@ -817,7 +817,7 @@ break; case RPMQV_RPM: qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, giFlags); if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) @@ -830,7 +830,7 @@ break; case RPMQV_HDLIST: qva->qva_gi = rpmgiNew(ts, RPMDBI_HDLIST, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, giFlags); if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) @@ -842,10 +842,10 @@ rpmtsEmpty(ts); break; case RPMQV_FTSWALK: - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); qva->qva_gi = rpmgiNew(ts, RPMDBI_FTSWALK, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, giFlags); + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, giFlags); if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) @@ -859,7 +859,7 @@ default: if (giFlags & RPMGI_TSADD) { qva->qva_gi = rpmgiNew(ts, RPMTAG_NVRA, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, (rpmgiFlags) (giFlags | (RPMGI_NOGLOB ))); if (rpmgiGetFlags(qva->qva_gi) & RPMGI_TSADD) /* Load the ts with headers. */ while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) @@ -871,7 +871,7 @@ rpmtsEmpty(ts); } else { qva->qva_gi = rpmgiNew(ts, RPMDBI_ARGLIST, NULL, 0); - qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsOpts, + qva->qva_rc = rpmgiSetArgs(qva->qva_gi, argv, rpmioFtsFlags, (rpmgiFlags) (giFlags | (RPMGI_NOGLOB|RPMGI_NOHEADER))); while ((rpmrc = rpmgiNext(qva->qva_gi)) == RPMRC_OK) { const char * path; @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmchecksig.c ============================================================================ $ cvs diff -u -r1.240.2.20 -r1.240.2.21 rpmchecksig.c --- rpm/lib/rpmchecksig.c 16 May 2017 18:29:11 -0000 1.240.2.20 +++ rpm/lib/rpmchecksig.c 9 Jun 2017 04:39:10 -0000 1.240.2.21 @@ -198,9 +198,9 @@ rpmgiFlags _giFlags = RPMGI_NONE; gi = rpmgiNew(ts, tag, NULL, 0); - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); - rpmrc = rpmgiSetArgs(gi, argv, rpmioFtsOpts, (rpmgiFlags)(_giFlags|RPMGI_NOHEADER)); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + rpmrc = rpmgiSetArgs(gi, argv, rpmioFtsFlags, (rpmgiFlags)(_giFlags|RPMGI_NOHEADER)); while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { const char * fn = rpmgiHdrPath(gi); @@ -1317,10 +1317,10 @@ rpmgiFlags _giFlags = RPMGI_NONE; rpmRC rc; - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); rc = (rpmRC) - rpmgiSetArgs(gi, argv, rpmioFtsOpts, + rpmgiSetArgs(gi, argv, rpmioFtsFlags, (rpmgiFlags)(_giFlags|RPMGI_NOHEADER)); while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { const char * fn = rpmgiHdrPath(gi); @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpminstall.c ============================================================================ $ cvs diff -u -r1.229.2.8 -r1.229.2.9 rpminstall.c --- rpm/lib/rpminstall.c 16 May 2017 18:29:11 -0000 1.229.2.8 +++ rpm/lib/rpminstall.c 9 Jun 2017 04:39:11 -0000 1.229.2.9 @@ -558,9 +558,9 @@ rpmgiFlags _giFlags = RPMGI_NONE; const char * fn = NULL;; - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); - rc = rpmgiSetArgs(gi, argv, rpmioFtsOpts, _giFlags); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + rc = rpmgiSetArgs(gi, argv, rpmioFtsFlags, _giFlags); while ((rpmrc = rpmgiNext(gi)) == RPMRC_OK) { Header h; @@ . patch -p0 <<'@@ .' Index: rpm/lib/tgi.c ============================================================================ $ cvs diff -u -r2.28.4.4 -r2.28.4.5 tgi.c --- rpm/lib/tgi.c 16 May 2017 18:29:12 -0000 2.28.4.4 +++ rpm/lib/tgi.c 9 Jun 2017 04:39:11 -0000 2.28.4.5 @@ -147,7 +147,7 @@ { "queryformat", '\0', POPT_ARG_STRING, &queryFormat, 0, N_("use the following query format"), "QUERYFORMAT" }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, N_("File tree walk options for fts(3):"), NULL }, @@ -179,8 +179,8 @@ if (optCon == NULL) exit(EXIT_FAILURE); - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); if (gitagstr != NULL) { gitag = tagValue(gitagstr); @@ -223,7 +223,7 @@ gi = rpmgiNew(ts, gitag, gikeystr, 0); - (void) rpmgiSetArgs(gi, av, rpmioFtsOpts, giFlags); + (void) rpmgiSetArgs(gi, av, rpmioFtsFlags, giFlags); #if defined(REFERENCE_FORNOW) if (fileURL[0] == '=') { @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmrepo.c ============================================================================ $ cvs diff -u -r1.4.2.8 -r1.4.2.9 rpmrepo.c --- rpm/rpmdb/rpmrepo.c 26 May 2017 20:49:24 -0000 1.4.2.8 +++ rpm/rpmdb/rpmrepo.c 9 Jun 2017 04:39:11 -0000 1.4.2.9 @@ -1648,8 +1648,8 @@ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, _rpmrepoOptions, 0, N_("Repository options:"), NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, - N_("Fts(3) traversal options:"), NULL }, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("Fts(3) traversal flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, repoCompressionPoptTable, 0, N_("Available compressions:"), NULL }, @@ -1688,7 +1688,7 @@ if (rpmIsDebug()) repo->verbose++; - repo->ftsoptions = (rpmioFtsOpts ? rpmioFtsOpts : FTS_PHYSICAL); + repo->ftsoptions = (rpmioFtsFlags ? rpmioFtsFlags : FTS_PHYSICAL); switch (repo->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL)) { case (FTS_LOGICAL|FTS_PHYSICAL): rpmrepoError(1, "FTS_LOGICAL and FTS_PYSICAL are mutually exclusive"); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/Makefile.am ============================================================================ $ cvs diff -u -r1.293.2.88 -r1.293.2.89 Makefile.am --- rpm/rpmio/Makefile.am 5 Jun 2017 08:25:51 -0000 1.293.2.88 +++ rpm/rpmio/Makefile.am 9 Jun 2017 04:39:11 -0000 1.293.2.89 @@ -27,8 +27,8 @@ EXTRA_PROGRAMS += bsdiff bspatch fanotify pcrsed rpmborg rpmcurl \ rpmgenbasedir rpmgenpkglist rpmgensrclist rpmgpg \ rpmpbzip2 rpmpigz rpmzstd \ - tasn tbf tcap tder tdir tfts tget tglob thkp tmagic \ - tmire todbc toid tperl tpython tput trpmio tsexp tsvn tsw ttcl \ + tasn tbf tcap tder tdir tfts tget tglob thkp tmagic tmire \ + tmount todbc toid tperl tpython tput trpmio tsexp tsvn tsw ttcl \ dumpasn1 lookup3 trel twitter github tmicrojson #noinst_PROGRAMS += b2sum tset tblake2b tblake2bp tblake2s tblake2sp tgfs @@ -621,6 +621,9 @@ tmagic_SOURCES = tmagic.c tmagic_LDADD = $(RPMIO_LDADD_COMMON) +tmount_SOURCES = tmount.c +tmount_LDADD = $(RPMIO_LDADD_COMMON) + tmire_SOURCES = tmire.c tmire_LDADD = $(RPMIO_LDADD_COMMON) @@ -633,6 +636,10 @@ tperl_SOURCES = tperl.c tperl_LDADD = $(RPMIO_LDADD_COMMON) +#tpie_SOURCES = tpie.c +#tpie_CFLAGS = -Wno-address -pie -fPIE -I /usr/include/python2.7 -g -rdynamic +#tpie_LDFLAGS = -Wl,--version-script,tpie.map,-soname,tpie + tpython = tpython.c tpython_LDADD = $(RPMIO_LDADD_COMMON) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/librpmio.vers ============================================================================ $ cvs diff -u -r2.199.2.86 -r2.199.2.87 librpmio.vers --- rpm/rpmio/librpmio.vers 3 Jun 2017 09:02:26 -0000 2.199.2.86 +++ rpm/rpmio/librpmio.vers 9 Jun 2017 04:39:11 -0000 2.199.2.87 @@ -573,8 +573,8 @@ rpmioFiniUsage; rpmioFreePool; rpmioFreePoolItem; - rpmioFtsOpts; - rpmioFtsPoptTable; + rpmioFtsFlags; + rpmioFtsFlagsTable; rpmioGetPool; rpmioHttpAccept; rpmioHttpConnectTimeoutSecs; @@ -597,15 +597,19 @@ rpmioMcheck; rpmioMcheckPedantic; rpmioMcheckCheckAll; + rpmioMountFlags; + rpmioMountFlagsTable; rpmioMprobe; rpmioNewPool; - rpmioOFlags; - rpmioOFlagsPoptTable; + rpmioOpenFlags; + rpmioOpenFlagsTable; rpmioParse; rpmioPFree; rpmioPipeOutput; rpmioPutPool; rpmioRootDir; + rpmioUmountFlags; + rpmioUmountFlagsTable; rpmioUnlinkPoolItem; _rpmjni_debug; _rpmjniI; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/mount.c ============================================================================ $ cvs diff -u -r2.2 -r2.2.10.1 mount.c --- rpm/rpmio/mount.c 28 Aug 2007 20:45:49 -0000 2.2 +++ rpm/rpmio/mount.c 9 Jun 2017 04:39:11 -0000 2.2.10.1 @@ -4,6 +4,7 @@ */ #if defined(__linux__) + #include "system.h" #include <sys/mount.h> #include "rpmio.h" @@ -13,16 +14,23 @@ const char *filesystemtype, unsigned long mountflags, const void *data) { - return mount(source, target, filesystemtype, mountflags, data); + int rc = mount(source, target, filesystemtype, mountflags, data); +fprintf(stderr, "<-- %s(%s,%s,%s,0x%lx,%p) rc %d\n", __FUNCTION__, source, target, filesystemtype, mountflags, data, rc); + return rc; } int Umount(const char *target) { - return umount(target); + int rc = umount(target); +fprintf(stderr, "<-- %s(%s) rc %d\n", __FUNCTION__, target, rc); + return rc; } int Umount2(const char *target, int flags) { - return umount2(target, flags); + int rc = umount2(target, flags); +fprintf(stderr, "<-- %s(%s,0x%x) rc %d\n", __FUNCTION__, target, flags, rc); + return rc; } -#endif + +#endif /* __linux__ */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/poptIO.c ============================================================================ $ cvs diff -u -r1.94.2.34 -r1.94.2.35 poptIO.c --- rpm/rpmio/poptIO.c 5 Jun 2017 19:08:43 -0000 1.94.2.34 +++ rpm/rpmio/poptIO.c 9 Jun 2017 04:39:11 -0000 1.94.2.35 @@ -5,6 +5,9 @@ #include "system.h" +#if defined(HAVE_SYS_MOUNT_H) +# include <sys/mount.h> +#endif #if defined(HAVE_SYS_IPC_H) # include <sys/ipc.h> #endif @@ -523,6 +526,35 @@ rpmlog(lvl, "%s exit.\n", msg); } +__attribute__((constructor(101))) +static void rpmioCtor(void) +{ + fprintf(stderr, "--> %s at %s:%u\n", __FUNCTION__, __FILE__, __LINE__); + const char * cmdline = rpmGetPath("/proc/%pid/cmdline", NULL); + fprintf(stderr, "\tcmdline: %s\n", cmdline); + cmdline = _free(cmdline); +} + +__attribute__((destructor(101))) +static void rpmioDtor(void) +{ + fprintf(stderr, "<-- %s at %s:%u\n", __FUNCTION__, __FILE__, __LINE__); +} + +void rpmioMain(int argc, char **argv, char **env); +__attribute__((section(".init_array"))) +static void *rpmioPreInit = &rpmioMain; + +void rpmioMain(int argc, char **argv, char **env) +{ + (void)rpmioPreInit; +#ifdef NOTYET + fprintf(stderr, "--> %s(%d,%p,%p) %s\n", __func__, argc, argv, env, *argv); +#else + fprintf(stderr, "--> %s at %s:%u\n", __FUNCTION__, __FILE__, __LINE__); +#endif /* NOTYET */ +} + /** */ static void rpmioAllArgCallback(poptContext con, @@ -656,143 +688,414 @@ } } -int rpmioOFlags = 0; -struct poptOption rpmioOFlagsPoptTable[] = { +unsigned rpmioOpenFlags = 0; +struct poptOption rpmioOpenFlagsTable[] = { #ifdef O_APPEND - { "append", '\0', POPT_BIT_SET, &rpmioOFlags, O_APPEND, - N_("O_APPEND"), NULL }, + { "append", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_APPEND, + N_("append"), N_("O_APPEND") }, #endif #ifdef O_ASYNC - { "async", '\0', POPT_BIT_SET, &rpmioOFlags, O_ASYNC, - N_("O_ASYNC"), NULL }, + { "async", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_ASYNC, + N_("async"), N_("O_ASYNC") }, #endif #ifdef O_CLOEXEC - { "cloexec", '\0', POPT_BIT_SET, &rpmioOFlags, O_CLOEXEC, - N_("O_CLOEXEC"), NULL }, + { "cloexec", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_CLOEXEC, + N_("cloexec"), N_("O_CLOEXEC") }, #endif #ifdef O_CREAT - { "creat", '\0', POPT_BIT_SET, &rpmioOFlags, O_CREAT, - N_("O_CREAT"), NULL }, + { "creat", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_CREAT, + N_("creat"), N_("O_CREAT") }, #endif #ifdef O_DIRECT - { "direct", '\0', POPT_BIT_SET, &rpmioOFlags, O_DIRECT, - N_("O_DIRECT"), NULL }, + { "direct", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_DIRECT, + N_("direct"), N_("O_DIRECT") }, #endif #ifdef O_DIRECTORY - { "directory", '\0', POPT_BIT_SET, &rpmioOFlags, O_DIRECTORY, - N_("O_DIRECTORY"), NULL }, + { "directory", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_DIRECTORY, + N_("directory"), N_("O_DIRECTORY") }, #endif #ifdef O_DSYNC - { "dsync", '\0', POPT_BIT_SET, &rpmioOFlags, O_DSYNC, - N_("O_DSYNC"), NULL }, + { "dsync", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_DSYNC, + N_("dsync"), N_("O_DSYNC") }, #endif #ifdef O_EXCL - { "excl", '\0', POPT_BIT_SET, &rpmioOFlags, O_EXCL, - N_("O_EXCL"), NULL }, + { "excl", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_EXCL, + N_("excl"), N_("O_EXCL") }, #endif #ifdef O_LARGEFILE - { "largefile", '\0', POPT_BIT_SET, &rpmioOFlags, O_LARGEFILE, - N_("O_LARGEFILE"), NULL }, + { "largefile", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_LARGEFILE, + N_("largefile"), N_("O_LARGEFILE") }, #endif #ifdef O_NOATIME - { "noatime", '\0', POPT_BIT_SET, &rpmioOFlags, O_NOATIME, - N_("O_NOATIME"), NULL }, + { "noatime", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_NOATIME, + N_("noatime"), N_("O_NOATIME") }, #endif #ifdef O_NOCTTY - { "noctty", '\0', POPT_BIT_SET, &rpmioOFlags, O_NOCTTY, - N_("O_NOCTTY"), NULL }, + { "noctty", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_NOCTTY, + N_("noctty"), N_("O_NOCTTY") }, #endif #ifdef O_NOFOLLOW - { "nofollow", '\0', POPT_BIT_SET, &rpmioOFlags, O_NOFOLLOW, - N_("O_NOFOLLOW"), NULL }, + { "nofollow", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_NOFOLLOW, + N_("nofollow"), N_("O_NOFOLLOW") }, #endif #ifdef O_NONBLOCK - { "nonblock", '\0', POPT_BIT_SET, &rpmioOFlags, O_NONBLOCK, - N_("O_NONBLOCK"), NULL }, + { "nonblock", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_NONBLOCK, + N_("nonblock"), N_("O_NONBLOCK") }, #endif #ifdef O_NDELAY - { "ndelay", '\0', POPT_BIT_SET, &rpmioOFlags, O_NDELAY, - N_("O_NDELAY"), NULL }, + { "ndelay", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_NDELAY, + N_("ndelay"), N_("O_NDELAY") }, #endif #ifdef O_PATH - { "path", '\0', POPT_BIT_SET, &rpmioOFlags, O_PATH, - N_("O_PATH"), NULL }, + { "path", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_PATH, + N_("path"), N_("O_PATH") }, #endif #ifdef NOTYET /* XXX O_ACCMODE needed */ #ifdef O_RDONLY - { "rdonly", '\0', POPT_BIT_SET, &rpmioOFlags, O_RDONLY, - N_("O_RDONLY"), NULL }, + { "rdonly", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_RDONLY, + N_("rdonly"), N_("O_RDONLY") }, #endif #ifdef O_RDWR - { "rdwr", '\0', POPT_BIT_SET, &rpmioOFlags, O_RDWR, - N_("O_RDONLY"), NULL }, + { "rdwr", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_RDWR, + N_("rdwr"), N_("O_RDWR") }, #endif #endif /* XXX O_ACCMODE needed */ #ifdef O_SYNC - { "sync", '\0', POPT_BIT_SET, &rpmioOFlags, O_SYNC, - N_("O_SYNC"), NULL }, + { "sync", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_SYNC, + N_("sync"), N_("O_SYNC") }, #endif #ifdef O_TMPFILE - { "tmpfile", '\0', POPT_BIT_SET, &rpmioOFlags, O_TMPFILE, - N_("O_TMPFILE"), NULL }, + { "tmpfile", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_TMPFILE, + N_("tmpfile"), N_("O_TMPFILE") }, #endif #ifdef O_TRUNC - { "trunc", '\0', POPT_BIT_SET, &rpmioOFlags, O_TRUNC, - N_("O_TRUNC"), NULL }, + { "trunc", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_TRUNC, + N_("trunc"), N_("O_TRUNC") }, #endif #ifdef NOTYET /* XXX O_ACCMODE needed */ #ifdef O_WRONLY - { "wronly", '\0', POPT_BIT_SET, &rpmioOFlags, O_WRONLY, - N_("O_WRONLY"), NULL }, + { "wronly", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_WRONLY, + N_("wronly"), N_("O_WRONLY") }, #endif #endif /* XXX O_ACCMODE needed */ #ifdef O_SHLOCK - { "shlock", '\0', POPT_BIT_SET, &rpmioOFlags, O_SHLOCK, - N_("O_SHLOCK"), NULL }, + { "shlock", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_SHLOCK, + N_("shlock"), N_("O_SHLOCK") }, #endif #ifdef O_EXLOCK - { "exlock", '\0', POPT_BIT_SET, &rpmioOFlags, O_EXLOCK, - N_("O_EXLOCK"), NULL }, + { "exlock", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_EXLOCK, + N_("exlock"), N_("O_EXLOCK") }, #endif #ifdef O_SYMLINK - { "symlink", '\0', POPT_BIT_SET, &rpmioOFlags, O_SYMLINK, - N_("O_SYMLINK"), NULL }, + { "symlink", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_SYMLINK, + N_("symlink"), N_("O_SYMLINK") }, #endif #ifdef O_EVTONLY - { "evtonly", '\0', POPT_BIT_SET, &rpmioOFlags, O_EVTONLY, - N_("O_EVTONLY"), NULL }, + { "evtonly", '\0', POPT_BIT_SET, &rpmioOpenFlags, O_EVTONLY, + N_("evtonly"), N_("O_EVTONLY") }, #endif POPT_TABLEEND }; -int rpmioFtsOpts = 0; -struct poptOption rpmioFtsPoptTable[] = { - { "comfollow", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_COMFOLLOW, - N_("FTS_COMFOLLOW: follow command line symlinks"), NULL }, - { "logical", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_LOGICAL, - N_("FTS_LOGICAL: logical walk"), NULL }, - { "nochdir", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_NOCHDIR, - N_("FTS_NOCHDIR: don't change directories"), NULL }, - { "nostat", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_NOSTAT, - N_("FTS_NOSTAT: don't get stat info"), NULL }, - { "physical", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_PHYSICAL, - N_("FTS_PHYSICAL: physical walk"), NULL }, - { "seedot", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_SEEDOT, - N_("FTS_SEEDOT: return dot and dot-dot"), NULL }, - { "xdev", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_XDEV, - N_("FTS_XDEV: don't cross devices"), NULL }, - { "whiteout", '\0', POPT_BIT_SET, &rpmioFtsOpts, FTS_WHITEOUT, - N_("FTS_WHITEOUT: return whiteout information"), NULL }, +unsigned int rpmioMountFlags = 0; +struct poptOption rpmioMountFlagsTable[] = { + +#if defined(MS_RDONLY) + { "read-only", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_RDONLY, + N_("read-only"), N_("MS_RDONLY") }, +#endif +#if defined(MS_RDONLY) + { "ro", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmioMountFlags, MS_RDONLY, + N_("read-only"), N_("MS_RDONLY") }, +#endif +#if defined(MS_RDONLY) + { "read-write", '\0', POPT_BIT_CLR, &rpmioMountFlags, MS_RDONLY, + N_("read-write"), N_("~MS_RDONLY") }, +#endif +#if defined(MS_RDONLY) + { "rw", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &rpmioMountFlags, MS_RDONLY, + N_("read-write"), N_("~MS_RDONLY") }, +#endif + +#if defined(MNT_RDONLY) + { "read-only", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_RDONLY, + N_("read-only"), N_("MNT_RDONLY") }, +#endif +#if defined(MNT_RDONLY) + { "ro", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmioMountFlags, MNT_RDONLY, + N_("read-only"), N_("MNT_RDONLY") }, +#endif +#if defined(MNT_RDONLY) + { "read-write", '\0', POPT_BIT_CLR, &rpmioMountFlags, MNT_RDONLY, + N_("read-write"), N_("~MNT_RDONLY") }, +#endif +#if defined(MNT_RDONLY) + { "rw", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, &rpmioMountFlags, MNT_RDONLY, + N_("read-write"), N_("~MS_RDONLY") }, +#endif + +#if defined(MS_NOSUID) + { "nosuid", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_NOSUID, + N_("nosuid"), N_("MS_NOSUID") }, +#endif +#if defined(MNT_NOSUID) + { "nosuid", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NOSUID, + N_("nosuid"), N_("MNT_NOSUID") }, +#endif + +#if defined(MS_NOEXEC) + { "noexec", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_NOEXEC, + N_("noexec"), N_("MS_NOEXEC") }, +#endif +#if defined(MNT_NOEXEC) + { "noexec", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NOEXEC, + N_("noexec"), N_("MNT_NOEXEC") }, +#endif + +#if defined(MS_SYNCHRONOUS) + { "sync", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_SYNC, + N_("sync"), N_("MS_SYNCHRONOUS") }, +#endif +#if defined(MNT_SYNCHRONOUS) + { "sync", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_SYNC, + N_("sync"), N_("MNT_SYNCHRONOUS") }, +#endif + +#if defined(MS_REMOUNT) + { "remount", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_REMOUNT, + N_("remount"), N_("MS_REMOUNT") }, +#endif +#if defined(MS_MANDLOCK) + { "mandlock", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_MANDLOCK, + N_("mandlock"), N_("MS_MANDLOCK") }, +#endif +#if defined(MS_DIRSYNC) + { "dirsync", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_DIRSYNC, + N_("dirsync"), N_("MS_DIRSYNC") }, +#endif + +#if defined(MS_NOATIME) + { "noatime", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_NOATIME, + N_("noatime"), N_("MS_NOATIME") }, +#endif +#if defined(MNT_NOATIME) + { "noatime", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NOATIME, + N_("noatime"), N_("MNT_NOATIME") }, +#endif + +#if defined(MS_NODIRATIME) + { "nodiratime", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_NODIRATIME, + N_("nodiratime"), N_("MS_NODIRATIME") }, +#endif +#if defined(MS_BIND) + { "bind", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_BIND, + N_("bind"), N_("MS_BIND") }, +#endif +#if defined(MS_MOVE) + { "move", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_MOVE, + N_("move"), N_("MS_MOVE") }, +#endif +#if defined(MS_REC) + { "rec", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_REC, + N_("rec"), N_("MS_REC") }, +#endif +#if defined(MS_SILENT) + { "silent", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_SILENT, + N_("silent"), N_("MS_SILENT") }, +#endif +#if defined(MS_POSIXACL) + { "posixacl", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_POSIXACL, + N_("posixacl"), N_("MS_POSIXACL") }, +#endif +#if defined(MS_UNBINDABLE) + { "unbindable", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_UNBINDABLE, + N_("bindable"), N_("MS_UNBINDABLE") }, +#endif +#if defined(MS_PRIVATE) + { "private", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_PRIVATE, + N_("private"), N_("MS_PRIVATE") }, +#endif +#if defined(MS_SLAVE) + { "slave", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_SLAVE, + N_("slave"), N_("MS_SLAVE") }, +#endif +#if defined(MS_SHARED) + { "shared", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_SHARED, + N_("shared"), N_("MS_SHARED") }, +#endif +#if defined(MS_RELATIME) + { "relatime", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_RELATIME, + N_("relatime"), N_("MS_RELATIME") }, +#endif +#if defined(MS_KERNMOUNT) + { "kernmount", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_KERNMOUNT, + N_("kernmount"), N_("MS_KERNMOUNT") }, +#endif +#if defined(MS_I_VERSION) + { "i-version", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_I_VERSION, + N_("i-version"), N_("MS_I_VERSION") }, +#endif +#if defined(MS_STRICTATIME) + { "strictatime", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_STRICTATIME, + N_("strictatime"), N_("MS_STRICTATIME") }, +#endif +#if defined(MS_LAZYTIME) + { "lazytime", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_LAZYTIME, + N_("lazytime"), N_("MS_LAZYTIME") }, +#endif +#if defined(MS_ACTIVE) + { "active", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_ACTIVE, + N_("active"), N_("MS_ACTIVE") }, +#endif +#if defined(MS_NOUSER) + { "nouser", '\0', POPT_BIT_SET, &rpmioMountFlags, MS_NOUSER, + N_("nouser"), N_("MS_NOUSER") }, +#endif + +#if defined(MNT_NODEV) + { "nodev", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NODEV, + N_("nodev"), N_("MNT_NODEV") }, +#endif +#if defined(MNT_UNION) + { "union", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_UNION, + N_("union"), N_("MNT_UNION") }, +#endif +#if defined(MNT_ASYNC) + { "async", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_ASYNC, + N_("async"), N_("MNT_ASYNC") }, +#endif +#if defined(MNT_CPROTECT) + { "cprotect", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_CPROTECT, + N_("cprotect"), N_("MNT_CPROTECT") }, +#endif +#if defined(MNT_EXPORTED) + { "exported", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_EXPORTED, + N_("exported"), N_("MNT_EXPORTED") }, +#endif +#if defined(MNT_QUARANTINE) + { "quarantine", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_QUARANTINE, + N_("quarantine"), N_("MNT_QUARANTINE") }, +#endif +#if defined(MNT_LOCAL) + { "local", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_LOCAL, + N_("local"), N_("MNT_LOCAL") }, +#endif +#if defined(MNT_QUOTA) + { "quota", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_QUOTA, + N_("quota"), N_("MNT_QUOTA") }, +#endif +#if defined(MNT_ROOTFS) + { "rootfs", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_ROOTFS, + N_("rootfs"), N_("MNT_ROOTFS") }, +#endif +#if defined(MNT_DOVOLFS) + { "dovolfs", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_DOVOLFS, + N_("dovolfs"), N_("MNT_DOVOLFS") }, +#endif +#if defined(MNT_DONTBROWSE) + { "dontbrowse", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_DONTBROWSE, + N_("dontbrowse"), N_("MNT_DONTBROWSE") }, +#endif + +#if defined(MNT_IGNORE_OWNERSHIP) + { "ignore-ownership", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_IGNORE_OWNERSHIP, + N_("ignore-ownership"), N_("MNT_IGNORE_OWNERSHIP") }, +#endif +#if defined(MNT_UNKNOWNPERMOSSIONS) + { "unknownpermissions", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmioMountFlags, MNT_UNKNOWNPERMISSIONS, + N_("unknownpermissions"), N_("MNT_UNKNOWNPERMISSIONS") }, +#endif + +#if defined(MNT_AUTOMOUNTED) + { "automounted", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_AUTOMOUNTED, + N_("automounted"), N_("MNT_AUTOMOUNTED") }, +#endif +#if defined(MNT_JOURNALED) + { "journaled", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_JOURNALED, + N_("journaled"), N_("MNT_JOURNALED") }, +#endif +#if defined(MNT_NOUSERXATTR) + { "nouserxattr", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NOUSERXATTR, + N_("nouserxattr"), N_("MNT_NOUSERXATTR") }, +#endif +#if defined(MNT_DEFWRITE) + { "defwrite", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_DEFWRITE, + N_("defwrite"), N_("MNT_DEFWRITE") }, +#endif +#if defined(MNT_MULTILABEL) + { "multilabel", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_MULTILABEL, + N_("multilabel"), N_("MNT_MULTILABEL") }, +#endif + +#if defined(MNT_UPDATE) + { "update", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_UPDATE, + N_("update"), N_("MNT_UPDATE") }, +#endif +#if defined(MNT_NOBLOCK) + { "noblock", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_NOBLOCK, + N_("noblock"), N_("MNT_NOBLOCK") }, +#endif +#if defined(MNT_RELOAD) + { "reload", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_RELOAD, + N_("reload"), N_("MNT_RELOAD") }, +#endif +#if defined(MNT_CMDFLAGS) + { "cmdflags", '\0', POPT_BIT_SET, &rpmioMountFlags, MNT_CMDFLAGS, + N_("cmdflags"), N_("MNT_CMDFLAGS") }, +#endif + + POPT_TABLEEND +}; + +unsigned int rpmioUmountFlags = 0; +struct poptOption rpmioUmountFlagsTable[] = { +#if defined(MNT_FORCE) + { "force", '\0', POPT_BIT_SET, &rpmioUmountFlags, MNT_FORCE, + N_("force"), N_("MNT_FORCE") }, +#endif +#if defined(MNT_DETACH) + { "detach", '\0', POPT_BIT_SET, &rpmioUmountFlags, MNT_DETACH, + N_("detach"), N_("MNT_DETACH") }, +#endif +#if defined(MNT_EXPIRE) + { "expire", '\0', POPT_BIT_SET, &rpmioUmountFlags, MNT_EXPIRE, + N_("expire"), N_("MNT_EXPIRE") }, +#endif +#if defined(UMOUNT_NOFOLLOW) + { "nofollow", '\0', POPT_BIT_SET, &rpmioUmountFlags, UMOUNT_NOFOLLOW, + N_("nofollow"), N_("UMOUNT_NOFOLLOW") }, +#endif + POPT_TABLEEND +}; + +unsigned rpmioFtsFlags = 0; +struct poptOption rpmioFtsFlagsTable[] = { + { "comfollow", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_COMFOLLOW, + N_("Follow command line symlinks"), N_("FTS_COMFOLLOW") }, + { "logical", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_LOGICAL, + N_("Logical walk"), N_("FTS_LOGICAL") }, + { "nochdir", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_NOCHDIR, + N_("Don't change directories"), N_("FTS_NOCHDIR") }, + { "nostat", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_NOSTAT, + N_("Don't get stat info"), N_("FTS_NOSTAT") }, + { "physical", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_PHYSICAL, + N_("Physical walk"), N_("FTS_PHYSICAL") }, + { "seedot", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_SEEDOT, + N_("Return dot and dot-dot"), N_("FTS_SEEDOT") }, + { "xdev", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_XDEV, + N_("Don't cross devices"), N_("FTS_XDEV") }, + { "whiteout", '\0', POPT_BIT_SET, &rpmioFtsFlags, FTS_WHITEOUT, + N_("Return whiteout information"), N_("FTS_WHITEOUT") }, POPT_TABLEEND }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/poptIO.h ============================================================================ $ cvs diff -u -r1.8.4.6 -r1.8.4.7 poptIO.h --- rpm/rpmio/poptIO.h 3 Jun 2017 09:02:26 -0000 1.8.4.6 +++ rpm/rpmio/poptIO.h 9 Jun 2017 04:39:11 -0000 1.8.4.7 @@ -41,15 +41,18 @@ */ extern struct poptOption rpmioAllPoptTable[]; -extern int rpmioFtsOpts; +extern unsigned rpmioFtsFlags; /** \ingroup rpmio - * Popt option table for options to set Fts(3) options. + * Popt table(s) for options to set Fts(3)/Open(2)/Mount(2)/Umount(2) flags. */ -extern struct poptOption rpmioFtsPoptTable[]; - -extern int rpmioOFlags; -extern struct poptOption rpmioOFlagsPoptTable[]; +extern struct poptOption rpmioFtsFlagsTable[]; +extern unsigned rpmioOpenFlags; +extern struct poptOption rpmioOpenFlagsTable[]; +extern unsigned int rpmioMountFlags; +extern struct poptOption rpmioMountFlagsTable[]; +extern unsigned int rpmioUmountFlags; +extern struct poptOption rpmioUmountFlagsTable[]; extern const char * rpmioPipeOutput; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmct.c ============================================================================ $ cvs diff -u -r1.1.2.9 -r1.1.2.10 rpmct.c --- rpm/rpmio/rpmct.c 26 May 2017 20:49:23 -0000 1.1.2.9 +++ rpm/rpmio/rpmct.c 9 Jun 2017 04:39:11 -0000 1.1.2.10 @@ -770,8 +770,8 @@ N_("Stay on thgis file system"), NULL }, #ifdef NOTYET - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, - N_("Fts(3) traversal options:"), NULL }, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("Fts(3) traversal flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioDigestPoptTable, 0, N_("Available digests:"), NULL }, @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmjs.cpp ============================================================================ $ cvs diff -u -r1.1.2.5 -r1.1.2.6 rpmjs.cpp --- rpm/rpmio/rpmjs.cpp 19 Apr 2016 13:05:28 -0000 1.1.2.5 +++ rpm/rpmio/rpmjs.cpp 9 Jun 2017 04:39:11 -0000 1.1.2.6 @@ -1,6 +1,7 @@ #include "system.h" -#include "rpmio_internal.h" +#include "rpmio.h" +#include <rpmlog.h> #include <argv.h> #include <popt.h> @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmzstd.c ============================================================================ $ cvs diff -u -r1.1.2.9 -r1.1.2.10 rpmzstd.c --- rpm/rpmio/rpmzstd.c 7 Jun 2017 07:01:16 -0000 1.1.2.9 +++ rpm/rpmio/rpmzstd.c 9 Jun 2017 04:39:11 -0000 1.1.2.10 @@ -30,11 +30,11 @@ #define ZSTD_LZ4COMPRESS 1 #define ZSTD_LZ4DECOMPRESS 1 #endif +#endif /* NOTYET */ #if defined(WITH_PTHREADS) #define ZSTD_MULTITHREAD 1 #endif -#endif /* NOTYET */ #if defined(USE_RPMIO) #include <rpmio_internal.h> @@ -76,7 +76,7 @@ #undef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) -static int _debug = -1; +static int _debug = 0; #define SPEW(_fmt, ...) \ if (_debug) fprintf(stderr, _fmt, __VA_ARGS__) @@ -22831,7 +22831,7 @@ { "debug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_debug, 1, NULL, NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOFlagsPoptTable, 0, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOpenFlagsTable, 0, N_("Open(2) flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tdir.c ============================================================================ $ cvs diff -u -r2.21 -r2.21.4.1 tdir.c --- rpm/rpmio/tdir.c 4 Jul 2009 23:45:44 -0000 2.21 +++ rpm/rpmio/tdir.c 9 Jun 2017 04:39:11 -0000 2.21.4.1 @@ -104,7 +104,7 @@ _av_debug = -1; _dav_debug = -1; _ftp_debug = -1; -_url_debug = -1; +_rpmurl_debug = -1; _rpmio_debug = -1; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tfts.c ============================================================================ $ cvs diff -u -r2.33.4.1 -r2.33.4.2 tfts.c --- rpm/rpmio/tfts.c 17 May 2017 12:34:41 -0000 2.33.4.1 +++ rpm/rpmio/tfts.c 9 Jun 2017 04:39:11 -0000 2.33.4.2 @@ -1,10 +1,14 @@ #include "system.h" +#include <rpmdefs.h> #include <fts.h> #include <rpmdir.h> #include <rpmdav.h> +#include <rpmurl.h> #include <poptIO.h> +#include <mire.h> + #include <magic.h> #include "debug.h" @@ -275,8 +279,8 @@ N_("use cached http OPTIONS"), NULL}, #endif - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, - N_("Options for Fts(3):"), + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("Fts(3) traversal flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, @@ -300,19 +304,19 @@ /* Process options. */ - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); - fts->ftsoptions = rpmioFtsOpts; + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + fts->ftsoptions = rpmioFtsFlags; if (__debug) { _av_debug = -1; _dav_debug = -1; _ftp_debug = -1; _fts_debug = -1; -_url_debug = -1; +_rpmurl_debug = -1; _rpmio_debug = -1; _rpmmg_debug = 1; -_mire_debug = 1; +_rpmmire_debug = 1; } dav = poptGetArgs(optCon); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tget.c ============================================================================ $ cvs diff -u -r1.20.4.3 -r1.20.4.4 tget.c --- rpm/rpmio/tget.c 20 May 2017 13:42:50 -0000 1.20.4.3 +++ rpm/rpmio/tget.c 9 Jun 2017 04:39:11 -0000 1.20.4.4 @@ -3,6 +3,7 @@ #include <rpmio.h> #include <rpmdir.h> #include <rpmdav.h> +#include <rpmurl.h> #include <poptIO.h> #include <mire.h> @@ -331,7 +332,7 @@ _av_debug = -1; _dav_debug = -1; _ftp_debug = -1; -_url_debug = -1; +_rpmurl_debug = -1; _rpmio_debug = -1; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tglob.c ============================================================================ $ cvs diff -u -r2.17 -r2.17.4.1 tglob.c --- rpm/rpmio/tglob.c 3 Jul 2009 18:19:32 -0000 2.17 +++ rpm/rpmio/tglob.c 9 Jun 2017 04:39:11 -0000 2.17.4.1 @@ -3,6 +3,7 @@ #include <rpmio.h> #include <rpmdir.h> #include <rpmdav.h> +#include <rpmurl.h> #include <poptIO.h> #include "debug.h" @@ -66,7 +67,7 @@ _av_debug = -1; _dav_debug = -1; _ftp_debug = -1; -_url_debug = -1; +_rpmurl_debug = -1; _rpmio_debug = -1; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/thtml.c ============================================================================ $ cvs diff -u -r1.2.4.2 -r1.2.4.3 thtml.c --- rpm/rpmio/thtml.c 20 May 2017 13:42:50 -0000 1.2.4.2 +++ rpm/rpmio/thtml.c 9 Jun 2017 04:39:11 -0000 1.2.4.3 @@ -16,6 +16,7 @@ #include <rpmio.h> #include <rpmdir.h> #include <rpmdav.h> +#include <rpmurl.h> #include <rpmcb.h> #include <argv.h> #include <popt.h> @@ -824,7 +825,7 @@ N_("debug protocol data stream"), NULL}, { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1, N_("debug rpmio I/O"), NULL}, - { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1, + { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmurl_debug, -1, N_("debug URL cache handling"), NULL}, { "verbose", 'v', 0, 0, 'v', NULL, NULL }, @@ -856,7 +857,7 @@ _av_debug = -1; _dav_debug = -1; _ftp_debug = -1; -_url_debug = -1; +_rpmurl_debug = -1; _rpmio_debug = -1; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tmount.c ============================================================================ $ cvs diff -u -r0 -r1.1.2.1 tmount.c --- /dev/null 2017-06-09 06:37:47.000000000 +0200 +++ tmount.c 2017-06-09 06:39:11.916032155 +0200 @@ -0,0 +1,318 @@ +/** + * Copyright 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the license found in the + * LICENSE-examples file in the root directory of this source tree. + */ + +#include "system.h" + +#include <sys/mount.h> + +#include "rpmio.h" +#include <rpmlog.h> +#include <rpmmacro.h> +#include <poptIO.h> +#include <argv.h> + +#include "debug.h" + +/*==============================================================*/ + +#if !defined(POPT_BIT_XOR) +#define POPT_BIT_XOR (POPT_ARG_VAL|POPT_ARGFLAG_XOR) +#endif + +#ifdef REFERENCE + -a, --all + Mount all filesystems (of the given types) mentioned in fstab + (except for those whose line contains the noauto keyword). The + filesystems are mounted following their order in fstab. + + -B, --bind + Remount a subtree somewhere else (so that its contents are + available in both places). See above, under Bind mounts. + + -c, --no-canonicalize + Dont canonicalize paths. The mount command canonicalizes all + paths (from command line or fstab) by default. This option can + be used together with the -f flag for already canonicalized + absolute paths. The option is designed for mount helpers which + call mount -i. It is strongly recommended to not use this comâ + mand-line option for normal mount operations. + + Note that mount(8) does not pass this option to the + /sbin/mount.type helpers. + + -F, --fork + (Used in conjunction with -a.) Fork off a new incarnation of + mount for each device. This will do the mounts on different + devices or different NFS servers in parallel. This has the + advantage that it is faster; also NFS timeouts go in parallel. + A disadvantage is that the mounts are done in undefined order. + Thus, you cannot use this option if you want to mount both /usr + and /usr/spool. + + -f, --fake + Causes everything to be done except for the actual system call; + if its not obvious, this "fakes" mounting the filesystem. + This option is useful in conjunction with the -v flag to deterâ + mine what the mount command is trying to do. It can also be + used to add entries for devices that were mounted earlier with + the -n option. The -f option checks for an existing record in + /etc/mtab and fails when the record already exists (with a reguâ + lar non-fake mount, this check is done by the kernel). + + -i, --internal-only + Dont call the /sbin/mount.filesystem helper even if it exists. + + -L, --label label + Mount the partition that has the specified label. + + -l, --show-labels + Add the labels in the mount output. mount must have permission + to read the disk device (e.g. be suid root) for this to work. + One can set such a label for ext2, ext3 or ext4 using the + e2label(8) utility, or for XFS using xfs_admin(8), or for reisâ + erfs using reiserfstune(8). + + -M, --move + Move a subtree to some other place. See above, the subsection + The move operation. + + -n, --no-mtab + Mount without writing in /etc/mtab. This is necessary for examâ + ple when /etc is on a read-only filesystem. + + -O, --test-opts opts + Limit the set of filesystems to which the -a option applies. In + this regard it is like the -t option except that -O is useless + without -a. For example, the command: + + mount -a -O no_netdev + + mounts all filesystems except those which have the option _netâ + dev specified in the options field in the /etc/fstab file. + + It is different from -t in that each option is matched exactly; + a leading no at the beginning of one option does not negate the + rest. + + The -t and -O options are cumulative in effect; that is, the + command + + mount -a -t ext2 -O _netdev + + mounts all ext2 filesystems with the _netdev option, not all + filesystems that are either ext2 or have the _netdev option + specified. + + -o, --options opts + Use the specified mount options. The opts argument is a comma- + separated list. For example: + + mount LABEL=mydisk -o noatime,nodev,nosuid + + For more details, see the FILESYSTEM-INDEPENDENT MOUNT OPTIONS + and FILESYSTEM-SPECIFIC MOUNT OPTIONS sections. + + -R, --rbind + Remount a subtree and all possible submounts somewhere else (so + that its contents are available in both places). See above, the + subsection Bind mounts. + + -r, --read-only + Mount the filesystem read-only. A synonym is -o ro. + + Note that, depending on the filesystem type, state and kernel + behavior, the system may still write to the device. For examâ + ple, ext3 and ext4 will replay the journal if the filesystem is + dirty. To prevent this kind of write access, you may want to + mount an ext3 or ext4 filesystem with the ro,noload mount + options or set the block device itself to read-only mode, see + the blockdev(8) command. + + -s Tolerate sloppy mount options rather than failing. This will + ignore mount options not supported by a filesystem type. Not + all filesystems support this option. Currently its supported + by the mount.nfs mount helper only. + +X --source device + If only one argument for the mount command is given then the + argument might be interpreted as target (mountpoint) or source + (device). This option allows to explicitly define that the + argument is the mount source. + +X --target directory + If only one argument for the mount command is given then the + argument might be interpreted as target (mountpoint) or source + (device). This option allows to explicitly define that the + argument is the mount target. + + -T, --fstab path + Specifies an alternative fstab file. If path is a directory + then the files in the directory are sorted by strverscmp(3); + files that start with "." or without an .fstab extension are + ignored. The option can be specified more than once. This + option is mostly designed for initramfs or chroot scripts where + additional configuration is specified beyond standard system + configuration. + + Note that mount(8) does not pass the option --fstab to the + /sbin/mount.type helpers, meaning that the alternative fstab + files will be invisible for the helpers. This is no problem for + normal mounts, but user (non-root) mounts always require fstab + to verify the users rights. + + -t, --types fstype + The argument following the -t is used to indicate the filesystem + type. The filesystem types which are currently supported depend + on the running kernel. See /proc/filesystems and /lib/modâ + ules/$(uname -r)/kernel/fs for a complete list of the filesysâ + tems. The most common are ext2, ext3, ext4, xfs, btrfs, vfat, + sysfs, proc, nfs and cifs. + + The programs mount and umount support filesystem subtypes. The + subtype is defined by a '.subtype' suffix. For example + 'fuse.sshfs'. Its recommended to use subtype notation rather + than add any prefix to the mount source (for example + 'sshfs#example.com' is deprecated). + + If no -t option is given, or if the auto type is specified, + mount will try to guess the desired type. Mount uses the blkid + library for guessing the filesystem type; if that does not turn + up anything that looks familiar, mount will try to read the file + /etc/filesystems, or, if that does not exist, /proc/filesystems. + All of the filesystem types listed there will be tried, except + for those that are labeled "nodev" (e.g. devpts, proc and nfs). + If /etc/filesystems ends in a line with a single *, mount will + read /proc/filesystems afterwards. While trying, all filesystem + types will be mounted with the mount option silent. + + The auto type may be useful for user-mounted floppies. Creating + a file /etc/filesystems can be useful to change the probe order + (e.g., to try vfat before msdos or ext3 before ext2) or if you + use a kernel module autoloader. + + More than one type may be specified in a comma-separated list, + for option -t as well as in an /etc/fstab entry. The list of + filesystem types for option -t can be prefixed with no to specâ + ify the filesystem types on which no action should be taken. + The prefix no has no effect when specified in an /etc/fstab + entry. + + The prefix no can be meaningful with the -a option. For examâ + ple, the command + + mount -a -t nomsdos,smbfs + + mounts all filesystems except those of type msdos and smbfs. + + For most types all the mount program has to do is issue a simple + mount(2) system call, and no detailed knowledge of the filesysâ + tem type is required. For a few types however (like nfs, nfs4, + cifs, smbfs, ncpfs) an ad hoc code is necessary. The nfs, nfs4, + cifs, smbfs, and ncpfs filesystems have a separate mount proâ + gram. In order to make it possible to treat all types in a uniâ + form way, mount will execute the program /sbin/mount.type (if + that exists) when called with type type. Since different verâ + sions of the smbmount program have different calling convenâ + tions, /sbin/mount.smbfs may have to be a shell script that sets + up the desired call. + + -U, --uuid uuid + Mount the partition that has the specified uuid. + + -v, --verbose + Verbose mode. + + -w, --rw, --read-write + Mount the filesystem read/write. This is the default. A synâ + onym is -o rw. + + -V, --version + Display version information and exit. + + -h, --help + Display help text and exit. + +#endif + +int +main(int argc, char *argv[]) +{ + const char * _mount_source = xstrdup("sysfs.img"); + const char * _mount_target = xstrdup("/mnt/initrd"); + const char * _mount_type = xstrdup("sysfs"); + const char * _mount_options = NULL; + + unsigned long _mount_flags = 0; + const void * _mount_data = NULL; + int _umount_flags = MNT_FORCE; + + struct poptOption rpmmountOptionsTable[] = { + { "debug", 'd', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, 1, + NULL, NULL }, + + { "source", '\0', POPT_ARG_STRING, &_mount_source, 0, + N_("file system SOURCE"), N_("SOURCE") }, + { "target", '\0', POPT_ARG_STRING, &_mount_target, 0, + N_("file system TARGET"), N_("TARGET") }, + { "type", 't', POPT_ARG_STRING, &_mount_type, 0, + N_("file system TYPE"), N_("TYPE") }, + { "options", 'o', POPT_ARG_STRING, &_mount_type, 0, + N_("file system OPTIONS"), N_("OPTIONS") }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOpenFlagsTable, 0, + N_("Open(2) flags:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioMountFlagsTable, 0, + N_("Mount(2) flags:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioUmountFlagsTable, 0, + N_("Umount(2) flags:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("Fts(3) traversal flags:"), NULL }, + + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, + N_("Common options for all rpmio executables:"), NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + POPT_TABLEEND + }; + + poptContext con = rpmioInit(argc, argv, rpmmountOptionsTable); +#ifdef NOTYET + ARGV_t av = poptGetArgs(con); + int ac = argvCount(av); +#endif /* NOTYET */ + int ec = 0; + int rc; + + _mount_flags = rpmioMountFlags; + +#if defined(__linux__) + _mount_flags |= MS_MGC_VAL; +#endif +#if defined(__APPLE__) || defined(MNT_VISFLAGMASK) + _mount_flags &= MNT_VISFLAGMASK; +#endif + + _umount_flags = rpmioUmountFlags; + + rc = Mount(_mount_source, _mount_target, _mount_type, _mount_flags, _mount_data); + + rc = Umount2(_mount_target, _umount_flags); + + _mount_source = _free(_mount_source); + _mount_target = _free(_mount_target); + _mount_type = _free(_mount_type); + _mount_options = _free(_mount_options); + + con = rpmioFini(con); + + return ec; +} @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tmq.c ============================================================================ $ cvs diff -u -r1.1.2.15 -r1.1.2.16 tmq.c --- rpm/rpmio/tmq.c 3 Jun 2017 09:02:27 -0000 1.1.2.15 +++ rpm/rpmio/tmq.c 9 Jun 2017 04:39:11 -0000 1.1.2.16 @@ -702,7 +702,7 @@ { "priority", 'p', POPT_ARG_LONG, &priority, 0, N_("Send message PRIORITY"), N_("PRIORITY") }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOFlagsPoptTable, 0, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOpenFlagsTable, 0, N_("Open(2) flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, @@ -722,7 +722,7 @@ int ac = argvCount(av);; int ec = 0; - _rpmmsqOFlags = rpmioOFlags; + _rpmmsqOFlags = rpmioOpenFlags; if (qname == NULL) qname = xstrdup("rpm"); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tzstd.c ============================================================================ $ cvs diff -u -r1.1.2.5 -r1.1.2.6 tzstd.c --- rpm/rpmio/tzstd.c 3 Jun 2017 09:02:27 -0000 1.1.2.5 +++ rpm/rpmio/tzstd.c 9 Jun 2017 04:39:11 -0000 1.1.2.6 @@ -170,7 +170,7 @@ { "write", 'W', POPT_ARG_VAL, &climode, 'W', NULL, NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOFlagsPoptTable, 0, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioOpenFlagsTable, 0, N_("Open(2) flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0, @@ -198,7 +198,7 @@ const char * ifn = rpmGetPath(av[0], NULL); const char * ofn = rpmGetPath(av[0], ".zst", NULL); - _rpmzstdOFlags = rpmioOFlags; + _rpmzstdOFlags = rpmioOpenFlags; rpmzstd zstd = NULL; SPEW("*** O_TMPFILE: %#o\n", O_TMPFILE); SPEW("*** OMask: %#o\n", _rpmioOMask); @@ . patch -p0 <<'@@ .' Index: rpm/rpmqv.c ============================================================================ $ cvs diff -u -r1.167.4.14 -r1.167.4.15 rpmqv.c --- rpm/rpmqv.c 17 May 2017 17:55:39 -0000 1.167.4.14 +++ rpm/rpmqv.c 9 Jun 2017 04:39:10 -0000 1.167.4.15 @@ -187,8 +187,8 @@ #endif /* IAM_RPMQV */ #ifdef IAM_RPMQV - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, - N_("File tree walk options (with --ftswalk):"), + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("File tree walk flags (with --ftswalk):"), NULL }, #endif /* IAM_RPMQV */ @@ . patch -p0 <<'@@ .' Index: rpm/tools/roto.c ============================================================================ $ cvs diff -u -r1.1.2.10 -r1.1.2.11 roto.c --- rpm/tools/roto.c 16 May 2017 21:22:05 -0000 1.1.2.10 +++ rpm/tools/roto.c 9 Jun 2017 04:39:12 -0000 1.1.2.11 @@ -653,7 +653,7 @@ roto->paths = NULL; xx = argvAdd(&roto->paths, s); - roto->ftsoptions = rpmioFtsOpts; + roto->ftsoptions = rpmioFtsFlags; if (!(roto->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL))) roto->ftsoptions |= FTS_PHYSICAL; roto->ftsoptions |= FTS_NOCHDIR; @@ -705,7 +705,7 @@ roto->paths = NULL; xx = argvAdd(&roto->paths, s); - roto->ftsoptions = rpmioFtsOpts; + roto->ftsoptions = rpmioFtsFlags; if (!(roto->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL))) roto->ftsoptions |= FTS_PHYSICAL; roto->ftsoptions |= FTS_NOCHDIR; @@ -3801,7 +3801,7 @@ xx = chrootInit(roto); xx = chrootBuild(roto, srpm, roto->rpmbuild_timeout); elapsed = time(NULL) - start; - rpmlog(RPMLOG_INFO, "Done(%s) Config(%s) %d minutes %d seconds\n", + rpmlog(RPMLOG_INFO, "Done(%s) Config(%s) %ld minutes %ld seconds\n", srpm, roto->chroot_name, elapsed/60, elapsed%60); rpmlog(RPMLOG_INFO, "Results and/or logs in: %s\n", roto->resultdir); } @@ -3867,7 +3867,7 @@ elapsed = time(NULL) - start; /* XXX FIXME: basename */ - rpmlog(RPMLOG_INFO, "Done(%s) Config(%s) %d minutes %d seconds\n", + rpmlog(RPMLOG_INFO, "Done(%s) Config(%s) %ld minutes %ld seconds\n", basename((char *)roto->spec), roto->chroot_name, elapsed/60, elapsed%60); dn = rpmExpand(roto->resultdir, NULL); rpmlog(RPMLOG_INFO, "Results and/or logs in: %s\n", dn); @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmcache.c ============================================================================ $ cvs diff -u -r2.41.4.4 -r2.41.4.5 rpmcache.c --- rpm/tools/rpmcache.c 16 May 2017 21:22:05 -0000 2.41.4.4 +++ rpm/tools/rpmcache.c 9 Jun 2017 04:39:12 -0000 2.41.4.5 @@ -557,7 +557,7 @@ { "nocache", '\0', POPT_ARG_VAL, &noCache, -1, N_("don't update cache database, only print package paths"), NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, N_("File tree walk options:"), NULL }, @@ -630,15 +630,15 @@ gi = rpmgiNew(ts, RPMDBI_FTSWALK, NULL, 0); - if (rpmioFtsOpts == 0) - rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); + if (rpmioFtsFlags == 0) + rpmioFtsFlags = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT); if (noCache) - rpmioFtsOpts |= FTS_NOSTAT; + rpmioFtsFlags |= FTS_NOSTAT; else - rpmioFtsOpts &= ~FTS_NOSTAT; + rpmioFtsFlags &= ~FTS_NOSTAT; - xx = rpmgiSetArgs(gi, ftsSet, rpmioFtsOpts, giFlags); + xx = rpmgiSetArgs(gi, ftsSet, rpmioFtsFlags, giFlags); gi->walkPathFilter = cacheWalkPathFilter; gi->stash = cacheStashLatest; @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmdigest.c ============================================================================ $ cvs diff -u -r2.18.4.8 -r2.18.4.9 rpmdigest.c --- rpm/tools/rpmdigest.c 16 May 2017 21:22:05 -0000 2.18.4.8 +++ rpm/tools/rpmdigest.c 9 Jun 2017 04:39:12 -0000 2.18.4.9 @@ -917,7 +917,7 @@ if (dc->ofn == NULL) dc->ofn = "-"; - dc->ftsoptions = rpmioFtsOpts; + dc->ftsoptions = rpmioFtsFlags; if (!(dc->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL))) dc->ftsoptions |= FTS_PHYSICAL; dc->ftsoptions |= FTS_NOCHDIR; @@ . patch -p0 <<'@@ .' Index: rpm/tools/rpmmtree.c ============================================================================ $ cvs diff -u -r2.17.2.11 -r2.17.2.12 rpmmtree.c --- rpm/tools/rpmmtree.c 16 May 2017 21:22:05 -0000 2.17.2.11 +++ rpm/tools/rpmmtree.c 9 Jun 2017 04:39:12 -0000 2.17.2.12 @@ -3360,13 +3360,13 @@ /* XXX redundant with --logical. */ case 'L': - rpmioFtsOpts &= ~FTS_PHYSICAL; - rpmioFtsOpts |= FTS_LOGICAL; + rpmioFtsFlags &= ~FTS_PHYSICAL; + rpmioFtsFlags |= FTS_LOGICAL; break; /* XXX redundant with --physical. */ case 'P': - rpmioFtsOpts &= ~FTS_LOGICAL; - rpmioFtsOpts |= FTS_PHYSICAL; + rpmioFtsFlags &= ~FTS_LOGICAL; + rpmioFtsFlags |= FTS_PHYSICAL; break; case 'X': mtreeReadExcludes(arg); @@ -3430,11 +3430,11 @@ { "warn",'w', POPT_BIT_SET, &mtreeFlags, MTREE_FLAGS_WARN, N_("Treat missing uid/gid as warning"), NULL }, /* XXX duplicated with --xdev. */ - { "xdev",'x', POPT_BIT_SET, &rpmioFtsOpts, FTS_XDEV, + { "xdev",'x', POPT_BIT_SET, &rpmioFtsFlags, FTS_XDEV, N_("Don't cross mount points"), NULL }, - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsPoptTable, 0, - N_("Fts(3) traversal options:"), NULL }, + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioFtsFlagsTable, 0, + N_("Fts(3) traversal flags:"), NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioDigestPoptTable, 0, N_("Available digests:"), NULL }, @@ -3520,7 +3520,7 @@ * Either FTS_PHYSICAL or FTS_LOGICAL must be set. Don't follow symlinks * unless explicitly overridden with FTS_LOGICAL. */ - fts->ftsoptions = rpmioFtsOpts; + fts->ftsoptions = rpmioFtsFlags; switch (fts->ftsoptions & (FTS_LOGICAL|FTS_PHYSICAL)) { case (FTS_LOGICAL|FTS_PHYSICAL): mtree_error("-L and -P flags are mutually exclusive"); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org