9front - general discussion about 9front
 help / color / mirror / Atom feed
From: james palmer <james@biobuf.link>
To: 9front@9front.org
Subject: [9front] [patch] vac: add -t flag to exclude temporary files and directories.
Date: Sun, 23 May 2021 18:00:52 +0100
Message-ID: <351C814BD375BCF2BBFA80797EB1BADC@biobuf.link> (raw)

i heard that the cwfs dump excludes temporary files,
and i wanted this with my hjfs + venti setup so i added the feature.

here's the patch:

# HG changeset patch
# User james palmer <foura@biobuf.link>
# Date 1621788211 -3600
# Branch foura
# Node ID 7c017169db5a3e9f4c02446958fe161006b8e443
# Parent  53bcdc0d2e7b9eb9e541d0a1746fc8a3478acb72
vac: add -t flag to exclude temporary files and directories

diff -r 53bcdc0d2e7b -r 7c017169db5a sys/man/1/vac
--- a/sys/man/1/vac	Sun May 23 16:37:54 2021 +0100
+++ b/sys/man/1/vac	Sun May 23 17:43:31 2021 +0100
@@ -4,7 +4,7 @@
 .SH SYNOPSIS
 .B vac
 [
-.B -mqsv
+.B -mqstv
 ] [
 .B -a
 .I vacfile
@@ -166,6 +166,9 @@
 .B -s
 Print out various statistics on standard error.
 .TP
+.B -t
+Exclude files and directories with the temporary flag set.
+.TP
 .B -v
 Produce more verbose output on standard error, including the name of the files added to the archive
 and the vac archives that are expanded and merged.
diff -r 53bcdc0d2e7b -r 7c017169db5a sys/src/cmd/vac/vac.c
--- a/sys/src/cmd/vac/vac.c	Sun May 23 16:37:54 2021 +0100
+++ b/sys/src/cmd/vac/vac.c	Sun May 23 17:43:31 2021 +0100
@@ -8,7 +8,7 @@
 void
 usage(void)
 {
-	fprint(2, "vac [-imqsv] [-a archive.vac] [-b bsize] [-d old.vac] [-e exclude] [-f new.vac] [-i name] [-h host] [-x excludefile] file...\n");
+	fprint(2, "vac [-imqstv] [-a archive.vac] [-b bsize] [-d old.vac] [-e exclude] [-f new.vac] [-i name] [-h host] [-x excludefile] file...\n");
 	threadexitsall("usage");
 }
 
@@ -29,6 +29,7 @@
 int qdiff;
 int merge;
 int verbose;
+int notmp;
 char *host;
 VtConn *z;
 VacFs *fs;
@@ -109,6 +110,9 @@
 	case 's':
 		printstats++;
 		break;
+	case 't':
+		notmp++;
+		break;
 	case 'v':
 		verbose++;
 		break;
@@ -422,7 +426,7 @@
 	VacFile *f, *fdiff;
 	VtEntry e;
 
-	if(!includefile(name)){
+	if(!includefile(name) || (notmp && (d->qid.type&QTTMP))) {
 		warn("excluding %s%s", name, (d->mode&DMDIR) ? "/" : "");
 		return;
 	}


                 reply	other threads:[~2021-05-24  6:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=351C814BD375BCF2BBFA80797EB1BADC@biobuf.link \
    --to=james@biobuf.link \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git