export LDFLAGS
LTV="libtoolize (GNU libtool) 1.4.3"
-ACV="autoconf (GNU Autoconf) 2.56"
+ACV="autoconf (GNU Autoconf) 2.57"
AMV="automake (GNU automake) 1.6.3"
USAGE="
This script documents the versions of the tools I'm using to build rpm:
libtool-1.4.3
- autoconf-2.56
+ autoconf-2.57
automake-1.6.3
Simply edit this script to change the libtool/autoconf/automake versions
checked if you need to, as rpm should build (and has built) with all
export LDFLAGS
LTV="libtoolize (GNU libtool) 1.4.3"
-ACV="autoconf (GNU Autoconf) 2.56"
+ACV="autoconf (GNU Autoconf) 2.57"
AMV="automake (GNU automake) 1.6.3"
USAGE="
This script documents the versions of the tools I'm using to build rpm:
libtool-1.4.3
- autoconf-2.56
+ autoconf-2.57
automake-1.6.3
Simply edit this script to change the libtool/autoconf/automake versions
checked if you need to, as rpm should build (and has built) with all
typedef /*@abstract@*/ struct cpioSourceArchive_s {
unsigned int cpioArchiveSize;
FD_t cpioFdIn;
+/*@refcounted@*/
rpmfi cpioList;
-/*@only@*/ struct rpmlead * lead; /* XXX FIXME: exorcize lead/arch/os */
+/*@only@*/
+ struct rpmlead * lead; /* XXX FIXME: exorcize lead/arch/os */
} * CSA_t;
#ifdef __cplusplus
* return a reloaded contiguous header to the caller.
*
* @retval *hdrp header to write (final header is returned).
- * @retval *sigp signature header (or NULL)
+ * @retval *pkgidp header+payload MD5 of package (NULL to disable).
* @param fileName file name of package
* @param type RPMLEAD_SOURCE/RPMLEAD_BINARY
* @param csa
* @retval cookie generated cookie (i.e build host/time)
* @return 0 on success
*/
-int writeRPM(Header * hdrp, /*@null@*/ Header * sigp,
+int writeRPM(Header * hdrp, /*@null@*/ unsigned char ** pkgidp,
const char * fileName,
int type,
CSA_t csa,
/*@out@*/ const char ** cookie)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
- /*@modifies *hdrp, *sigp, *cookie, csa, csa->cpioArchiveSize,
+ /*@modifies *hdrp, *pkgidp, *cookie, csa, csa->cpioArchiveSize,
rpmGlobalMacroContext, fileSystem, internalState @*/;
#ifdef __cplusplus
* @todo Should directories have %doc/%config attributes? (#14531)
* @todo Remove RPMTAG_OLDFILENAMES, add dirname/basename instead.
* @param fl package file tree walk data
- * @param cpioList
+ * @retval *fip file info for package
* @param h
* @param isSrc
*/
/*@-bounds@*/
static void genCpioListAndHeader(/*@partial@*/ FileList fl,
- rpmfi * cpioList, Header h, int isSrc)
+ rpmfi * fip, Header h, int isSrc)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
- /*@modifies h, *cpioList, fl->processingFailed, fl->fileList,
+ /*@modifies h, *fip, fl->processingFailed, fl->fileList,
rpmGlobalMacroContext, fileSystem, internalState @*/
{
int _addDotSlash = !(isSrc || rpmExpandNumeric("%{_noPayloadPrefix}"));
(void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1");
}
- { int scareMem = 1;
+ { int scareMem = 0;
rpmts ts = NULL; /* XXX FIXME drill rpmts ts all the way down here */
rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem);
char * a, * d;
fi->dnl = _free(fi->dnl);
fi->bnl = _free(fi->bnl);
+ if (!scareMem) fi->dil = _free(fi->dil);
fi->dnl = xmalloc(fi->fc * sizeof(*fi->dnl) + dpathlen);
d = (char *)(fi->dnl + fi->fc);
*d = '\0';
fi->bnl = xmalloc(fi->fc * (sizeof(*fi->bnl) + sizeof(*fi->dil)));
- /*@-dependenttrans@*/ /* FIX: artifact of spoofing headerGetEntry */
- fi->dil = (int *)(fi->bnl + fi->fc);
- /*@=dependenttrans@*/
+/*@-dependenttrans@*/ /* FIX: artifact of spoofing headerGetEntry */
+ fi->dil = (!scareMem)
+ ? xcalloc(sizeof(*fi->dil), fi->fc)
+ : (int *)(fi->bnl + fi->fc);
+/*@=dependenttrans@*/
fi->apath = xmalloc(fi->fc * sizeof(*fi->apath) + apathlen);
a = (char *)(fi->apath + fi->fc);
/* Create disk directory and base name. */
fi->dil[i] = i;
- /*@-dependenttrans@*/ /* FIX: artifact of spoofing headerGetEntry */
+/*@-dependenttrans@*/ /* FIX: artifact of spoofing headerGetEntry */
fi->dnl[fi->dil[i]] = d;
- /*@=dependenttrans@*/
+/*@=dependenttrans@*/
d = stpcpy(d, flp->diskURL);
/* Make room for the dirName NUL, find start of baseName. */
}
/*@-branchstate@*/
- if (cpioList)
- *cpioList = fi;
+ if (fip)
+ *fip = fi;
else
- fi = _free(fi);
+ fi = rpmfiFree(fi);
/*@=branchstate@*/
}
}
(void) rpmlibNeedsFeature(pkg->header,
"PartialHardlinkSets", "4.0.4-1");
- genCpioListAndHeader(&fl, (rpmfi *)&pkg->cpioList, pkg->header, 0);
+ genCpioListAndHeader(&fl, &pkg->cpioList, pkg->header, 0);
if (spec->timeCheck)
timeCheck(spec->timeCheck, pkg->header);
if (! fl.processingFailed) {
if (spec->sourceHeader != NULL)
- genCpioListAndHeader(&fl, (rpmfi *)&spec->sourceCpioList,
+ genCpioListAndHeader(&fl, &spec->sourceCpioList,
spec->sourceHeader, 1);
}
}
/*@-boundswrite@*/
-int writeRPM(Header *hdrp, Header *sigp, const char *fileName, int type,
- CSA_t csa, char *passPhrase, const char **cookie)
+int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
+ int type, CSA_t csa, char *passPhrase, const char **cookie)
{
FD_t fd = NULL;
FD_t ifd = NULL;
h = headerLink(*hdrp);
*hdrp = headerFree(*hdrp);
- if (sigp)
- *sigp = NULL;
+ if (pkgidp)
+ *pkgidp = NULL;
#ifdef DYING
if (Fileno(csa->cpioFdIn) < 0) {
rpmError(RPMERR_RELOAD, _("Unable to reload signature header.\n"));
goto exit;
}
- /* Re-reference reallocated header. */
- if (sigp != NULL)
- *sigp = headerLink(sig);
/* Open the output file */
fd = Fopen(fileName, "w.ufdio");
exit:
SHA1 = _free(SHA1);
h = headerFree(h);
+
+ /* XXX Fish the pkgid out of the signature header. */
+ if (sig != NULL && pkgidp != NULL) {
+ HGE_t hge = (HGE_t)headerGetEntry;
+ unsigned char * md5 = NULL;
+ rpmTagType type;
+ int_32 c;
+ int xx;
+ xx = hge(sig, RPMSIGTAG_MD5, &type, (void **)&md5, &c);
+ if (type == RPM_BIN_TYPE && md5 != NULL && c == 16)
+ *pkgidp = md5;
+ }
+
sig = rpmFreeSignature(sig);
if (ifd) {
(void) Fclose(ifd);
/*@-type@*/ /* LCL: function typedefs */
csa->cpioFdIn = fdNew("init (packageBinaries)");
/*@-assignexpose -newreftrans@*/
-/*@i@*/ csa->cpioList = pkg->cpioList;
+ csa->cpioList = rpmfiLink(pkg->cpioList, "packageBinaries");
/*@=assignexpose =newreftrans@*/
rc = writeRPM(&pkg->header, NULL, fn, RPMLEAD_BINARY,
csa, spec->passPhrase, NULL);
+
+ csa->cpioList = rpmfiFree(pkg->cpioList);
csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageBinaries)");
/*@=type@*/
fn = _free(fn);
/* XXX this should be %_srpmdir */
{ const char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL);
- Header sig;
memset(csa, 0, sizeof(*csa));
csa->cpioArchiveSize = 0;
/*@-type@*/ /* LCL: function typedefs */
csa->cpioFdIn = fdNew("init (packageSources)");
/*@-assignexpose -newreftrans@*/
-/*@i@*/ csa->cpioList = spec->sourceCpioList;
+ csa->cpioList = rpmfiLink(spec->sourceCpioList, "packageSources");
/*@=assignexpose =newreftrans@*/
- sig = NULL;
- rc = writeRPM(&spec->sourceHeader, &sig, fn, RPMLEAD_SOURCE,
+ spec->sourcePkgId = NULL;
+ rc = writeRPM(&spec->sourceHeader, &spec->sourcePkgId, fn, RPMLEAD_SOURCE,
csa, spec->passPhrase, &(spec->cookie));
- if (rc == 0 && sig != NULL) {
- HGE_t hge = (HGE_t)headerGetEntryMinMemory;
- const unsigned char * md5 = NULL;
- rpmTagType type;
- int_32 c;
- int xx;
- xx = hge(sig, RPMSIGTAG_MD5, &type, (void **)&md5, &c);
- if (type == RPM_BIN_TYPE && md5 != NULL && c == 16)
- spec->sourcePkgId = memcpy(xmalloc(16), md5, 16);;
- sig = headerFree(sig);
- }
+
+ csa->cpioList = rpmfiFree(spec->sourceCpioList);
csa->cpioFdIn = fdFree(csa->cpioFdIn, "init (packageSources)");
/*@=type@*/
fn = _free(fn);
/*@only@*/
const char * sourceRpmName;
/*@only@*/
- const unsigned char * sourcePkgId;
+ unsigned char * sourcePkgId;
/*@refcounted@*/
Header sourceHeader;
rpmfi sourceCpioList;
export LDFLAGS
LTV="libtoolize (GNU libtool) 1.4.3"
-ACV="autoconf (GNU Autoconf) 2.56"
+ACV="autoconf (GNU Autoconf) 2.57"
AMV="automake (GNU automake) 1.6.3"
USAGE="
This script documents the versions of the tools I'm using to build rpm:
libtool-1.4.3
- autoconf-2.56
+ autoconf-2.57
automake-1.6.3
Simply edit this script to change the libtool/autoconf/automake versions
checked if you need to, as rpm should build (and has built) with all