[Rpm-maint] Patch: work around spurious tar messages

Michael Schroeder mls at suse.de
Fri Apr 9 13:28:26 UTC 2010


Gnu tar sometimes prints a "tar: Record size = 16" message, breaking
rpmbuild -ta.

--- ./build.c.orig	2010-04-07 14:56:36.000000000 +0000
+++ ./build.c	2010-04-07 14:58:52.000000000 +0000
@@ -126,7 +126,13 @@ static char * getTarSpec(const char *arg
 	if (!(fp = popen(cmd, "r"))) {
 	    rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n"));
 	} else {
-	    char *fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
+	    char *fok;
+	    for (;;) {
+		fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
+		/* tar sometimes prints "tar: Record size = 16" messages */
+		if (!fok || strncmp(fok, "tar: ", 5) != 0)
+		    break;
+	    }
 	    pclose(fp);
 	    gotspec = (fok != NULL) && isSpecFile(tmpSpecFile);
 	}


More information about the Rpm-maint mailing list