Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2010 19:06:42 GMT
From:      Ivan Voras <ivoras@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 180559 for review
Message-ID:  <201007061906.o66J6gDc051868@repoman.freebsd.org>

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

Change 180559 by ivoras@betelgeuse on 2010/07/06 19:06:35

	Write PKGPATCGINDEX, a log of available patches, for the mass
	package creation feature. It will be used later to determine
	if there are packages to be patched.

Affected files ...

.. //depot/projects/soc2010/pkg_patch/src/patch/Makefile#21 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.c#11 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.h#11 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#20 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#20 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/main.c#21 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#19 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#19 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.c#4 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatchdir.h#3 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#19 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/support.c#18 edit

Differences ...

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


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


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


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


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


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


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


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


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

@@ -37,11 +37,12 @@
 void
 perform_mkpatchdir(char *dir_old, char *dir_new, char *dir_patch)
 {
-	char dold[PATH_MAX], dnew[PATH_MAX], dpatch[PATH_MAX];
+	char dold[PATH_MAX], dnew[PATH_MAX], dpatch[PATH_MAX], flog[PATH_MAX];
 	char basename[PATH_MAX], version1[20], version2[20], suff[20];
 	struct filelist_head fl_old, fl_new;
 	struct pkgjoinlist_head pkglist; 
 	struct pkgjoinlist *pl;
+	FILE *fpl;
 	
 	if (realpath(dir_old, dold) == NULL)
 		err(1, "Error resolving path: %s", dir_old);
@@ -63,6 +64,11 @@
 	if (access(dpatch, W_OK) != 0)
 		err(1, "Access error writing directory: %s", dpatch);
 	
+	snprintf(flog, PATH_MAX, "%s/%s", dpatch, PKGPATCHINDEX_FNAME);
+	fpl = fopen(flog, "a+");
+	if (fpl == NULL)
+		err(1, "Cannot open patch log file: %s", flog);
+	
 	SLIST_INIT(&fl_old);
 	SLIST_INIT(&fl_new);
 	SLIST_INIT(&pkglist);
@@ -83,7 +89,7 @@
 		parse_package_name(pl->name2, NULL, version2, suff);
 		snprintf(pname, PATH_MAX, "%s-%s-%s%s", basename, version1, 
 		    version2, suff);
-		if (Verbose > 1)
+		if (Verbose)
 			printf("%s -> %s via %s\n", pl->name1, pl->name2, pname);
 		snprintf(pold, PATH_MAX, "%s/%s", dold, pl->name1);
 		snprintf(pnew, PATH_MAX, "%s/%s", dnew, pl->name2);
@@ -91,7 +97,12 @@
 		if (Verbose > 2)
 			printf("\t(%s -> %s via %s)\n", pold, pnew, ppatch);
 		perform_mkpatch(pold, pnew, ppatch);
+		fprintf(fpl, "@havepatch %s-%s %s-%s %s\n", basename, version1,
+		    basename, version2, pname);
 	}
 	
+	fclose(fpl);
+	filelist_free(&fl_old);
+	filelist_free(&fl_new);
 	pkgjoinlist_free(&pkglist);
 }

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


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

@@ -47,6 +47,8 @@
 #define PKGPATCH_VERSION_MAJOR	1
 #define PKGPATCH_VERSION_MINOR	0
 
+#define PKGPATCHINDEX_FNAME	"PKGPATCHINDEX"
+
 #define	PKGPATCH_BACKUP_DIR_ENV		"PKG_BACKUPDIR"
 #define PKGPATCH_BACKUP_DIR_DEFAULT	"/var/backups/pkg"
 #define PKGPATCH_BACKUP_DIR		(getenv(PKGPATCH_BACKUP_DIR_ENV) ? \

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




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