summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-02-20 00:17:51 +0000
committerewt <devnull@localhost>1996-02-20 00:17:51 +0000
commit76dc38a451a84f5832798a06c57320b7c4a69b73 (patch)
tree7d6b11ebafc9287678c6cc2d90f847c903a681fa /lib
parentd46f2806ee40dd112869eb69e4f7f8f6d837cead (diff)
downloadrpm-76dc38a451a84f5832798a06c57320b7c4a69b73.tar.gz
rpm-76dc38a451a84f5832798a06c57320b7c4a69b73.tar.bz2
rpm-76dc38a451a84f5832798a06c57320b7c4a69b73.zip
1) added INSTALL_PRINTLABEL support
2) shouldn't update header's we've freed CVS patchset: 336 CVS date: 1996/02/20 00:17:51
Diffstat (limited to 'lib')
-rw-r--r--lib/install.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/install.c b/lib/install.c
index 270a772a4..93df59ea7 100644
--- a/lib/install.c
+++ b/lib/install.c
@@ -98,6 +98,7 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags,
struct replacedFile * replacedList = NULL;
char * sptr, * dptr;
int length;
+ char * s;
rc = pkgReadHeader(fd, &h, &isSource);
if (rc) return rc;
@@ -127,6 +128,17 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags,
getEntry(h, RPMTAG_VERSION, &type, (void **) &version, &fileCount);
getEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &fileCount);
+ if (flags & INSTALL_PRINTLABEL) {
+ s = alloca(strlen(name) + strlen(version) + strlen(release) + 3);
+ strcpy(s, name);
+ strcat(s, "-");
+ strcat(s, version);
+ strcat(s, "-");
+ strcat(s, release);
+
+ printf("%-28s", s);
+ }
+
message(MESS_DEBUG, "package: %s-%s-%s files test = %d\n",
name, version, release, flags & INSTALL_TEST);
@@ -774,6 +786,7 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset, char ** fileList,
if (secOffset != sharedList[i].secRecOffset) {
if (secOffset) {
+ freeHeader(sech);
free(secFileMd5List);
free(secFileList);
}
@@ -812,8 +825,6 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset, char ** fileList,
(void **) &secFileMd5List, &secFileCount);
getEntry(sech, RPMTAG_FILEFLAGS, &type,
(void **) &secFileFlagsList, &secFileCount);
-
- freeHeader(sech);
}
message(MESS_DEBUG, "file %s is shared\n",
@@ -896,6 +907,7 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset, char ** fileList,
}
if (secOffset) {
+ freeHeader(sech);
free(secFileMd5List);
free(secFileList);
}