removed _noDirTokens (producing legacy filelist format)

Some code (e.g. apt/genpkglist) explicitly relies on the fact that
header file list is represented with baseNames+dirNames+dirIndexes
arrays.  Thus, generating legacy headers might have issues, and should
be disabled.
This commit is contained in:
Alexey Tourbin 2008-08-20 11:34:12 +04:00
parent 2c81cc39eb
commit 23317f11b7
9 changed files with 3 additions and 59 deletions

View File

@ -29,10 +29,6 @@
#define MAXDOCDIR 1024
/*@-redecl@*/
extern int _noDirTokens;
/*@=redecl@*/
/**
*/
typedef enum specdFlags_e {
@ -1290,14 +1286,8 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl,
if (_addDotSlash)
(void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1");
/* Choose how filenames are represented. */
if (_noDirTokens)
expandFilelist(h);
else {
compressFilelist(h);
/* Binary packages with dirNames cannot be installed by legacy rpm. */
(void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1");
}
compressFilelist(h);
(void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1");
{ TFI_t fi = xcalloc(1, sizeof(*fi));
char * a, * d;

View File

@ -14,10 +14,6 @@
#include "rpmlead.h"
#include "debug.h"
/*@-redecl@*/
extern int _noDirTokens;
/*@=redecl@*/
/*@access StringBuf @*/ /* compared with NULL */
/*@access TFI_t @*/ /* compared with NULL */
/*@access Header @*/ /* compared with NULL */
@ -379,7 +375,7 @@ static int rpmLeadVersion(void)
}
rpmlead_version = rpmpkg_version / 10000;
if (_noDirTokens || (rpmlead_version < 3 || rpmlead_version > 4))
if (rpmlead_version < 3 || rpmlead_version > 4)
rpmlead_version = 3;
return rpmlead_version;
}

View File

@ -50,9 +50,6 @@ char *_rpm_nosource;
char *_rpm_nopatch;
/*@-redecl@*/
/*@unchecked@*/
extern int _noDirTokens;
/*@unchecked@*/
extern int _fsm_debug;
/*@=redecl@*/
@ -211,8 +208,6 @@ struct poptOption rpmBuildPoptTable[] = {
N_("override build root"), "DIRECTORY" },
{ "clean", '\0', 0, 0, POPT_RMBUILD,
N_("remove build tree when done"), NULL},
{ "dirtokens", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_noDirTokens, 0,
N_("generate headers compatible with rpm4 packaging"), NULL},
{ "force", '\0', POPT_ARGFLAG_DOC_HIDDEN, &force, POPT_FORCE,
N_("ignore ExcludeArch: directives from spec file"), NULL},
{ "fsmdebug", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN), &_fsm_debug, -1,
@ -221,9 +216,6 @@ struct poptOption rpmBuildPoptTable[] = {
N_("do not execute any stages of the build"), NULL },
{ "nodeps", '\0', 0, &noDeps, POPT_NODEPS,
N_("do not verify build dependencies"), NULL },
{ "nodirtokens", '\0', POPT_ARG_VAL, &_noDirTokens, 1,
N_("generate package header(s) compatible with (legacy) rpm[23] packaging"),
NULL},
{ "nolang", '\0', POPT_ARGFLAG_DOC_HIDDEN, &noLang, POPT_NOLANG,
N_("do not accept i18N msgstr's from specfile"), NULL},
{ "nopatch", '\0', POPT_ARG_STRING, &_rpm_nopatch, 0,

View File

@ -1445,7 +1445,6 @@ assert(psm->mi == NULL);
#endif
memset(&lead, 0, sizeof(lead));
/* XXX Set package version conditioned on noDirTokens. */
lead.major = 3;
lead.minor = 0;
lead.type = RPMLEAD_BINARY;

View File

@ -9,14 +9,6 @@
#include "rpmurl.h"
#include "rpmmacro.h"
/** \ingroup rpmcli
* Should version 3 packages be produced?
*/
/*@-redecl@*/
/*@unchecked@*/
extern int _noDirTokens;
/*@=redecl@*/
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -234,11 +234,6 @@ exit:
return rc;
}
/*@-exportheadervar@*/
/*@unchecked@*/
int _noDirTokens = 0;
/*@=exportheadervar@*/
/*@-boundsread@*/
static int dncmp(const void * a, const void * b)
/*@*/

View File

@ -11,10 +11,6 @@
struct rpmDatabaseArguments_s rpmDBArgs;
/*@-redecl@*/
extern int _noDirTokens;
/*@=redecl@*/
/**
*/
struct poptOption rpmDatabasePoptTable[] = {
@ -25,11 +21,6 @@ struct poptOption rpmDatabasePoptTable[] = {
NULL},
{ "verifydb", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmDBArgs.verify, 1,
N_("verify database files"), NULL},
{ "nodirtokens", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_noDirTokens, 1,
N_("generate headers compatible with (legacy) rpm[23] packaging"),
NULL},
{ "dirtokens", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_noDirTokens, 0,
N_("generate headers compatible with rpm4 packaging"), NULL},
POPT_TABLEEND
};

View File

@ -45,9 +45,6 @@ extern void regfree (/*@only@*/ regex_t *preg)
static int _debug = 0;
#define INLINE
/*@-redecl@*/
extern int _noDirTokens;
/*@=redecl@*/
/*@unchecked@*/
static int _rebuildinprogress = 0;
/*@unchecked@*/
@ -1493,9 +1490,6 @@ static int dbiUpdateRecord(dbiIndex dbi, DBC * dbcursor, int offset, Header h)
unsigned int pflags = 0; /* dbiPut() flags */
int xx;
if (_noDirTokens)
expandFilelist(h);
uhlen = headerSizeof(h, HEADER_MAGIC_NO);
uh = headerUnload(h);
if (uh) {
@ -2671,9 +2665,6 @@ int rpmdbAdd(rpmdb db, int iid, Header h)
xx = hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count);
if (_noDirTokens)
expandFilelist(h);
(void) blockSignals(db, &signalMask);
{

View File

@ -922,8 +922,6 @@ int main(int argc, const char ** argv)
(void) close(p[1]);
}
_noDirTokens = rpmExpandNumeric("%{?_noDirTokens}");
switch (bigMode) {
#ifdef IAM_RPMDB
case MODE_INITDB: