Page MenuHomeFreeBSD

D57230.id178540.diff
No OneTemporary

D57230.id178540.diff

diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile
--- a/usr.bin/xinstall/Makefile
+++ b/usr.bin/xinstall/Makefile
@@ -11,7 +11,7 @@
CFLAGS+= -I${SRCTOP}/contrib/mtree
CFLAGS+= -I${SRCTOP}/lib/libnetbsd
-LIBADD= md
+LIBADD= md util
CFLAGS+= -DWITH_MD5 -DWITH_RIPEMD160
.ifdef BOOTSTRAPPING
diff --git a/usr.bin/xinstall/install.1 b/usr.bin/xinstall/install.1
--- a/usr.bin/xinstall/install.1
+++ b/usr.bin/xinstall/install.1
@@ -33,7 +33,7 @@
.Nd install binaries
.Sh SYNOPSIS
.Nm
-.Op Fl bCcpSsUv
+.Op Fl bCcpSsUvz
.Op Fl B Ar suffix
.Op Fl D Ar destdir
.Op Fl f Ar flags
@@ -45,9 +45,10 @@
.Op Fl N Ar dbdir
.Op Fl o Ar owner
.Op Fl T Ar tags
+.Op Fl z Ar size
.Ar file1 file2
.Nm
-.Op Fl bCcpSsUv
+.Op Fl bCcpSsUvz
.Op Fl B Ar suffix
.Op Fl D Ar destdir
.Op Fl f Ar flags
@@ -59,6 +60,7 @@
.Op Fl N Ar dbdir
.Op Fl o Ar owner
.Op Fl T Ar tags
+.Op Fl z Ar size
.Ar file1 ... fileN directory
.Nm
.Fl d
@@ -264,6 +266,12 @@
.Nm
to be verbose,
showing files as they are installed or backed up.
+.It Fl z Ar size
+Updates
+.Nm Ns 's
+the maximum file size of the file to select it for comparison with
+.Fl C
+flag.
.El
.Pp
By default,
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -57,6 +57,7 @@
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
+#include <util.h>
#include <vis.h>
#include "mtree.h"
@@ -87,7 +88,7 @@
#define HAVE_STRUCT_STAT_ST_FLAGS 0
#endif
-#define MAX_CMP_SIZE (16 * 1024 * 1024)
+#define MAX_CMP_SIZE (64 * 1024 * 1024)
#define LN_ABSOLUTE 0x01
#define LN_RELATIVE 0x02
@@ -137,6 +138,7 @@
static const char *group, *owner;
static const char *suffix = BACKUP_SUFFIX;
static char *destdir, *digest, *fflags, *metafile, *tags;
+static size_t max_compare_size = MAX_CMP_SIZE;
static int compare(int, const char *, size_t, int, const char *, size_t,
char **);
@@ -168,12 +170,13 @@
u_int iflags;
char *p;
const char *to_name;
+ uint64_t num;
fset = 0;
iflags = 0;
set = NULL;
group = owner = NULL;
- while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) !=
+ while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uvz:")) !=
-1)
switch((char)ch) {
case 'B':
@@ -270,6 +273,13 @@
case 'v':
verbose = 1;
break;
+ case 'z':
+ if (expand_number(optarg, &num) != 0 || num == 0) {
+ errx(EX_USAGE, "invalid max compare filesize:"
+ " %s", optarg);
+ }
+ max_compare_size = num;
+ break;
case '?':
default:
usage();
@@ -1092,7 +1102,7 @@
do_digest = (digesttype != DIGEST_NONE && dresp != NULL &&
*dresp == NULL);
- if (from_len <= MAX_CMP_SIZE) {
+ if (from_len <= max_compare_size) {
static char *buf, *buf1, *buf2;
static size_t bufsize;
int n1, n2;

File Metadata

Mime Type
text/plain
Expires
Mon, Jul 20, 1:13 AM (16 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35258982
Default Alt Text
D57230.id178540.diff (2 KB)

Event Timeline