Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Aug 2010 21:46:02 GMT
From:      Ivan Voras <ivoras@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 182372 for review
Message-ID:  <201008132146.o7DLk2nu072179@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@182372?ac=10

Change 182372 by ivoras@ursaminor on 2010/08/13 21:44:56

	Handle +CONTENTS manually if it isn't listed in plist

Affected files ...

.. //depot/projects/soc2010/pkg_patch/src/patch/Makefile#34 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/Notes.txt#4 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.c#24 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.h#24 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#33 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#33 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/main.c#35 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#32 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#32 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.c#17 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.h#16 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.1#6 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#32 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/support.c#31 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/updateweb.c#12 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/updateweb.h#12 edit

Differences ...

==== //depot/projects/soc2010/pkg_patch/src/patch/Makefile#34 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/Notes.txt#4 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/applypatch.c#24 (text+ko) ====

@@ -237,6 +237,7 @@
 {
 	PackingList pli;
 	char sourcef[PATH_MAX], destf[PATH_MAX];
+	Boolean copied_contents = FALSE;
 	
 	pli = pkg->head;
 	while (pli != NULL) {
@@ -253,9 +254,31 @@
 				warn("Cannot copy %s to %s", sourcef, destf);
 				return (-1);
 			}
+			if (Verbose > 1)
+				printf("Copied %s\n", pli->name);
+			if (strcmp(pli->name, "+CONTENTS") == 0)
+				copied_contents = TRUE;
 		}
 		pli = pli->next;
 	}
+	if (!copied_contents) {
+		/*
+		 * XXX: Why isn't +CONTENTS mentioned in itself? Possibly
+		 * because it would be hard to include its own md5 hash, but
+		 * the hash is optional so it would be cleaner to include it
+		 * than to handle it as a special case.
+		 */
+		snprintf(sourcef, PATH_MAX, "%s/%s", sourcedir, "+CONTENTS");
+		snprintf(destf, PATH_MAX, "%s/%s/%s", LOG_DIR, target_pkg_name,
+		    "+CONTENTS");
+		if (copy_file_absolute(sourcef, destf) != 0) {
+			warn("Cannot copy %s to %s", sourcef, destf);
+			return (-1);
+		}
+		if (Verbose > 1)
+			printf("Copied %s\n", "+CONTENTS");
+		copied_contents = TRUE;
+	}
 	return (0);
 }
 
@@ -401,8 +424,12 @@
 		} else
 			printf("Forced continue.\n");
 	}
-	if (err_count != 0)
-		errx(1, "Found %u errors. Cannot continue.", err_count);
+	if (err_count != 0) {
+		if (!Force)
+			errx(1, "Found %u errors.", err_count);
+		else
+			warnx("Found %u errors. Forcing continue.", err_count);
+	}
 	
 	baton_twirl();
 	/* Step 4 - backup the existing package */
@@ -568,6 +595,7 @@
 	} else {
 		char newpkgdir[PATH_MAX];
 		
+		/* Rename package directory */
 		snprintf(tmp, PATH_MAX, "%s/%s", LOG_DIR, pp.source);
 		snprintf(newpkgdir, PATH_MAX, "%s/%s", LOG_DIR, pp.target);
 		if (rename(tmp, newpkgdir) != 0) {

==== //depot/projects/soc2010/pkg_patch/src/patch/applypatch.h#24 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#33 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#33 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/main.c#35 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#32 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#32 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.c#17 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.h#16 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.1#6 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#32 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/support.c#31 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/updateweb.c#12 (text+ko) ====


==== //depot/projects/soc2010/pkg_patch/src/patch/updateweb.h#12 (text+ko) ====




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008132146.o7DLk2nu072179>