summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6213e3d)
+chiark-utils (4.1.14) unstable; urgency=low
+
+ * summer has new -x (one file system) option.
+ * summer produces better output with -f when scandir fails.
+ * chiark-backup's snaprsync uses summer -x.
+ * chiark-backup suggests chiark-cprogs with summer with -x.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Sun, 18 Feb 2007 13:02:21 +0000
+
chiark-utils (4.1.13) unstable; urgency=low
* New `nosnap' no-op snap kind.
test -d $localarea || x mkdir $localarea
ournode=`uname -n`
rsumsfile=for-$ournode.sums
test -d $localarea || x mkdir $localarea
ournode=`uname -n`
rsumsfile=for-$ournode.sums
-summer="$summer -ACDbtqf"
+summer="$summer -ACDbtqfx"
#define CSUMXL 32
static int quiet=0, hidectime=0, hideatime=0;
#define CSUMXL 32
static int quiet=0, hidectime=0, hideatime=0;
-static int hidedirsize=0, hidelinkmtime=0;
+static int hidedirsize=0, hidelinkmtime=0, onefilesystem=0;
static int filenamefieldsep=' ';
static FILE *errfile;
static int filenamefieldsep=' ';
static FILE *errfile;
+#define nodeflag_fsvalid 1u
+
static void malloc_fail(void) { perror("summer: alloc failed"); exit(12); }
static void *mmalloc(size_t sz) {
static void malloc_fail(void) { perror("summer: alloc failed"); exit(12); }
static void *mmalloc(size_t sz) {
return b->dev - a->dev;
}
return b->dev - a->dev;
}
-static void recurse(const char *path);
+static void recurse(const char *path, unsigned nodeflags, dev_t fs);
-static void node(const char *path) {
+static void node(const char *path, unsigned nodeflags, dev_t fs) {
char linktarg[MAXFN+1];
struct hardlink *foundhl;
const struct stat *stab;
struct stat stabuf;
char linktarg[MAXFN+1];
struct hardlink *foundhl;
const struct stat *stab;
struct stat stabuf;
r= lstat(path, &stabuf);
stab= r ? 0 : &stabuf;
r= lstat(path, &stabuf);
stab= r ? 0 : &stabuf;
+ if (stab) {
+ if ((nodeflags & nodeflag_fsvalid) && stab->st_dev != fs)
+ mountpoint= 1;
+ fs= stab->st_dev;
+ nodeflags |= nodeflag_fsvalid;
+ }
+
if (!stab) problem_e(path,CSUMXL,"inaccessible");
else if (foundhl) csum_str("hardlink");
else if (S_ISREG(stab->st_mode)) csum_file(path);
if (!stab) problem_e(path,CSUMXL,"inaccessible");
else if (foundhl) csum_str("hardlink");
else if (S_ISREG(stab->st_mode)) csum_file(path);
- else if (S_ISDIR(stab->st_mode)) csum_str("dir");
else if (S_ISCHR(stab->st_mode)) csum_dev('c',stab);
else if (S_ISBLK(stab->st_mode)) csum_dev('b',stab);
else if (S_ISFIFO(stab->st_mode)) csum_str("pipe");
else if (S_ISLNK(stab->st_mode)) csum_str("symlink");
else if (S_ISSOCK(stab->st_mode)) csum_str("sock");
else if (S_ISCHR(stab->st_mode)) csum_dev('c',stab);
else if (S_ISBLK(stab->st_mode)) csum_dev('b',stab);
else if (S_ISFIFO(stab->st_mode)) csum_str("pipe");
else if (S_ISLNK(stab->st_mode)) csum_str("symlink");
else if (S_ISSOCK(stab->st_mode)) csum_str("sock");
+ else if (S_ISDIR(stab->st_mode)) csum_str(mountpoint ? "mountpoint" : "dir");
else problem(path,CSUMXL,"badobj: 0x%lx", (unsigned long)stab->st_mode);
if (stab && S_ISLNK(stab->st_mode)) {
else problem(path,CSUMXL,"badobj: 0x%lx", (unsigned long)stab->st_mode);
if (stab && S_ISLNK(stab->st_mode)) {
if (ferror(stdout)) { perror("summer: stdout"); exit(12); }
if (ferror(stdout)) { perror("summer: stdout"); exit(12); }
- if (stab && S_ISDIR(stab->st_mode))
- recurse(path);
+ if (stab && S_ISDIR(stab->st_mode) && !(mountpoint && onefilesystem))
+ recurse(path, nodeflags, fs);
}
static void process(const char *startpoint) {
if (!quiet)
fprintf(stderr,"summer: processing: %s\n",startpoint);
}
static void process(const char *startpoint) {
if (!quiet)
fprintf(stderr,"summer: processing: %s\n",startpoint);
tdestroy(hardlinks,free);
hardlinks= 0;
}
tdestroy(hardlinks,free);
hardlinks= 0;
}
return strcmp((*a)->d_name, (*b)->d_name);
}
return strcmp((*a)->d_name, (*b)->d_name);
}
-static void recurse(const char *path_or_buf) {
+static void recurse(const char *path_or_buf, unsigned nodeflags, dev_t fs) {
static char *buf;
static int buf_allocd;
static char *buf;
static int buf_allocd;
buf[pathl]= '/';
pathl++;
if (nentries < 0) {
buf[pathl]= '/';
pathl++;
if (nentries < 0) {
- strcpy(buf+pathl,"\\?"); errno= esave;
- problem_e(buf,-1,"scandir failed");
+ buf[pathl]= 0; errno= esave;
+ problem_e(buf,CSUMXL+72,"scandir failed");
+ fn_escaped(stdout,buf); putchar('\n');
return;
}
for (i=0, de=namelist; i<nentries; i++, de++) {
strcpy(buf+pathl, (*de)->d_name);
return;
}
for (i=0, de=namelist; i<nentries; i++, de++) {
strcpy(buf+pathl, (*de)->d_name);
+ node(buf, nodeflags, fs);
free(*de);
}
free(namelist);
free(*de);
}
free(namelist);
case 'b':
hidelinkmtime= 1;
break;
case 'b':
hidelinkmtime= 1;
break;
+ case 'x':
+ onefilesystem= 1;
+ break;
case 'C':
hidectime= 1;
break;
case 'C':
hidectime= 1;
break;
+chiark-utils (4.1.14) unstable; urgency=low
+
+ * summer has new -x (one file system) option.
+ * summer produces better output with -f when scandir fails.
+ * chiark-backup's snaprsync uses summer -x.
+ * chiark-backup suggests chiark-cprogs with summer with -x.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk> Sun, 18 Feb 2007 13:02:21 +0000
+
chiark-utils (4.1.13) unstable; urgency=low
* New `nosnap' no-op snap kind.
chiark-utils (4.1.13) unstable; urgency=low
* New `nosnap' no-op snap kind.
Priority: extra
Architecture: all
Depends: chiark-rwbuffer
Priority: extra
Architecture: all
Depends: chiark-rwbuffer
+Suggests: chiark-cprogs (>= 4.1.14)
Description: backup system for small systems and networks
These are the backup scripts used by chiark.greenend.org.uk and other
systems belonging to the Sinister Greenend Organisation. Features:
Description: backup system for small systems and networks
These are the backup scripts used by chiark.greenend.org.uk and other
systems belonging to the Sinister Greenend Organisation. Features: