summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-30 20:19:24 -0500
committermidipix <writeonce@midipix.org>2020-05-23 05:59:01 +0000
commit23fa887f1584afb60aeb38288bb74837e4f067db (patch)
treeb81afb06de734339762bd1797569c6865f8bdf86 /src/driver
parent54c29f3214d9ad43bd0eeab1ff025af8bfbf1309 (diff)
downloadtpax-23fa887f1584afb60aeb38288bb74837e4f067db.tar.bz2
tpax-23fa887f1584afb60aeb38288bb74837e4f067db.tar.xz
driver: implemented directory archive member recursion logic.
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/tpax_amain.c3
-rw-r--r--src/driver/tpax_driver_ctx.c22
2 files changed, 20 insertions, 5 deletions
diff --git a/src/driver/tpax_amain.c b/src/driver/tpax_amain.c
index f71f16c..84b15f4 100644
--- a/src/driver/tpax_amain.c
+++ b/src/driver/tpax_amain.c
@@ -12,7 +12,8 @@
#ifndef TPAX_DRIVER_FLAGS
#define TPAX_DRIVER_FLAGS TPAX_DRIVER_VERBOSITY_ERRORS \
- | TPAX_DRIVER_VERBOSITY_USAGE
+ | TPAX_DRIVER_VERBOSITY_USAGE \
+ | TPAX_DRIVER_DIR_MEMBER_RECURSE
#endif
static const char vermsg[] = "%s%s%s (https://git.foss21.org/tpax): "
diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c
index 81c4e34..d8e2de8 100644
--- a/src/driver/tpax_driver_ctx.c
+++ b/src/driver/tpax_driver_ctx.c
@@ -83,10 +83,10 @@ static int tpax_driver_usage(
snprintf(header,sizeof(header),
"%s — topological pax implementation\n\n"
"Synopsis:\n"
- " %s\n"
- " %s -r\n"
- " %s -w [−x format] [-b blocksize]\n"
- " %s -r -w\n\n"
+ " %s [-d]\n"
+ " %s -r [-d]\n"
+ " %s -w [−x format] [-b blocksize] [-d]\n"
+ " %s -r -w [-d]\n\n"
"Options:\n",
program,program,program,program,program);
@@ -395,6 +395,14 @@ int tpax_get_driver_ctx(
program,entry->arg,
optv,meta);
break;
+
+ case TAG_RECURSE:
+ cctx.drvflags |= TPAX_DRIVER_DIR_MEMBER_RECURSE;
+ break;
+
+ case TAG_NORECURSE:
+ cctx.drvflags &= ~(uintptr_t)TPAX_DRIVER_DIR_MEMBER_RECURSE;
+ break;
}
} else {
operand = entry;
@@ -500,6 +508,12 @@ int tpax_get_driver_ctx(
break;
}
+ /* not implemented features */
+ if (cctx.drvflags & TPAX_DRIVER_EXEC_MODE_MASK)
+ if (cctx.drvflags & TPAX_DRIVER_DIR_MEMBER_RECURSE)
+ return tpax_driver_error_not_implemented(
+ fdctx->fderr,program,"directory recursion",meta);
+
/* driver ctx */
if (!(ctx = tpax_driver_ctx_alloc(meta,fdctx,&cctx,nunits))) {
if (cctx.drvflags & TPAX_DRIVER_EXEC_MODE_COPY)