summaryrefslogtreecommitdiff
path: root/build/pack.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-04-07 19:52:42 +0000
committerjbj <devnull@localhost>2002-04-07 19:52:42 +0000
commitffdfd1056e25d18f95776fbff43fceca864be95f (patch)
tree56e72d723560122b38d8a2eb3a00e147ae0440e0 /build/pack.c
parent6e2d56377d4ac91f44918e58918d777540f6565c (diff)
downloadrpm-ffdfd1056e25d18f95776fbff43fceca864be95f.tar.gz
rpm-ffdfd1056e25d18f95776fbff43fceca864be95f.tar.bz2
rpm-ffdfd1056e25d18f95776fbff43fceca864be95f.zip
- speedup large queries by ~50%.
- revert to presentation ordering Yet Again (#62158). - non-glibc: on upgrade, mergesort is much faster than quicksort. CVS patchset: 5377 CVS date: 2002/04/07 19:52:42
Diffstat (limited to 'build/pack.c')
-rw-r--r--build/pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/build/pack.c b/build/pack.c
index 8fb2f1007..c130e0a19 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -398,7 +398,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type,
{
FD_t fd = NULL;
FD_t ifd = NULL;
- int count, sigtype;
+ int_32 count, sigtag;
const char * sigtarget;
const char * rpmio_flags = NULL;
const char * sha1 = NULL;
@@ -524,14 +524,14 @@ int writeRPM(Header *hdrp, const char *fileName, int type,
}
(void) Fflush(fd);
- if (Fseek(fd, sizeof(header_magic), SEEK_SET) == -1) {
+ if (Fseek(fd, 0, SEEK_SET) == -1) {
rc = RPMERR_FSEEK;
rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
sigtarget, Fstrerror(fd));
}
fdInitDigest(fd, PGPHASHALGO_SHA1, 0);
- if (headerWrite(fd, h, HEADER_MAGIC_NO)) {
+ if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write final header\n"));
}
@@ -552,9 +552,9 @@ int writeRPM(Header *hdrp, const char *fileName, int type,
(void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase);
(void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase);
- if ((sigtype = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) {
- rpmMessage(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtype);
- (void) rpmAddSignature(sig, sigtarget, sigtype, passPhrase);
+ if ((sigtag = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) {
+ rpmMessage(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtag);
+ (void) rpmAddSignature(sig, sigtarget, sigtag, passPhrase);
}
if (sha1) {