int mode, rc;
char * chptr;
notifyFunction fn;
+ char * printFormat = NULL;
hashesPrinted = 0;
}
if (interfaceFlags & RPMINSTALL_PERCENT)
- printf("%%f %s\n", arg);
+ printFormat = "%%f %s:%s:%s\n";
else if (isVerbose() && (interfaceFlags & RPMINSTALL_HASH)) {
chptr = strrchr(arg, '/');
if (!chptr)
else
chptr++;
- installFlags |= INSTALL_PRINTLABEL;
+ printFormat = "%-28s";
} else if (isVerbose())
printf("Installing %s\n", arg);
- rc = rpmInstallPackage(prefix, db, fd, installFlags, fn);
+ rc = rpmInstallPackage(prefix, db, fd, installFlags, fn, printFormat);
if (rc == 1) {
fprintf(stderr, "error: %s cannot be installed\n", arg);
}
/* 1 bad magic */
/* 2 error */
int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags,
- notifyFunction notify) {
+ notifyFunction notify, char * labelFormat) {
int rc, isSource;
char * name, * version, * release;
Header h, h2;
struct replacedFile * replacedList = NULL;
char * sptr, * dptr;
int length;
- char * s;
dbIndexSet matches;
int * oldVersions;
int * intptr;
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);
+ if (labelFormat) {
+ printf(labelFormat, name, version, release);
fflush(stdout);
}