PERFORCE change 179430 for review
Ivan Voras
ivoras at FreeBSD.org
Thu Jun 10 19:02:58 UTC 2010
http://p4web.freebsd.org/@@179430?ac=10
Change 179430 by ivoras at betelgeuse on 2010/06/10 19:02:06
Skeleton for applypatch function
Affected files ...
.. //depot/projects/soc2010/pkg_patch/src/patch/Makefile#11 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.c#1 add
.. //depot/projects/soc2010/pkg_patch/src/patch/applypatch.h#1 add
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#10 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#10 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/main.c#11 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#9 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#9 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#9 edit
.. //depot/projects/soc2010/pkg_patch/src/patch/support.c#8 edit
Differences ...
==== //depot/projects/soc2010/pkg_patch/src/patch/Makefile#11 (text+ko) ====
@@ -3,7 +3,7 @@
.include <bsd.own.mk>
PROG= pkg_patch
-SRCS= main.c mkpatch.c support.c hashjob.c
+SRCS= main.c applypatch.c mkpatch.c support.c hashjob.c
WARNS?= 4
WFORMAT?= 1
==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.c#10 (text+ko) ====
==== //depot/projects/soc2010/pkg_patch/src/patch/hashjob.h#10 (text+ko) ====
==== //depot/projects/soc2010/pkg_patch/src/patch/main.c#11 (text+ko) ====
@@ -32,6 +32,7 @@
#define PKG_PATCH_MAIN
#include "pkg_patch.h"
#include "mkpatch.h"
+#include "applypatch.h"
int argc;
@@ -49,7 +50,9 @@
static void
usage_short() {
- printf("usage: %s -c [-b] package_file_1 package_file_2\n", argv[0]);
+ printf("usage:\n");
+ printf("\t%s -c [-b] package_file_1 package_file_2 patch_file\n", argv[0]);
+ printf("\t%s -a patch_file\n", argv[0]);
}
@@ -59,6 +62,9 @@
while ((ch = getopt(argc, argv, "bchv")) != -1) {
switch (ch) {
+ case 'a':
+ patch_op = PP_APPLY;
+ break;
case 'b':
flag_bsdiff = 1;
break;
@@ -92,7 +98,9 @@
if (access(_PATH_RM, X_OK) != 0)
errx(1, "Cannot execute %s", _PATH_RM);
if (access(_PATH_TAR, X_OK) != 0)
- errx(1, "Cannot execute %s", _PATH_TAR);
+ errx(1, "Cannot execute %s", _PATH_TAR);
+ if (access(_PATH_BSDIFF, X_OK) != 0)
+ errx(1, "Cannot execute %s", _PATH_BSDIFF);
asprintf(&my_tmp, "%spkg_patch.%d.%d", _PATH_TMP, getpid(), time(NULL));
if (mkdir(my_tmp, 0700) != 0)
errx(1, "Cannot create working directory: %s", my_tmp);
@@ -130,6 +138,9 @@
case PP_MKPATCH:
perform_mkpatch();
break;
+ case PP_APPLY:
+ perform_applypatch();
+ break;
default:
errx(1, "This should not happen - unknown patch_op");
}
==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.c#9 (text+ko) ====
==== //depot/projects/soc2010/pkg_patch/src/patch/mkpatch.h#9 (text+ko) ====
==== //depot/projects/soc2010/pkg_patch/src/patch/pkg_patch.h#9 (text+ko) ====
@@ -30,7 +30,7 @@
#define PKGPATCH_FNAME "+PKGPATCH"
#define PKGPATCH_VERSION "1.0"
-enum PP_OP { PP_NONE, PP_MKPATCH };
+enum PP_OP { PP_NONE, PP_MKPATCH, PP_APPLY };
struct pkgxjob {
char *filename;
==== //depot/projects/soc2010/pkg_patch/src/patch/support.c#8 (text+ko) ====
More information about the p4-projects
mailing list