From c422ecb4fff2cfbf220173d0fad8d6d74a732c16 Mon Sep 17 00:00:00 2001 From: "G.raud" Date: Fri, 29 Dec 2017 19:19:48 +0100 Subject: [PATCH] archives2git: --keep-tempdir: new option --- archives2git | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archives2git b/archives2git index f445509..e1b4edc 100755 --- a/archives2git +++ b/archives2git @@ -102,6 +102,7 @@ tag tag the commits with the default tagname tagname= tag the commits with the name printed by the given sh code command= sh code to eval after having commited and tagged debug enable the verbose printing of what is done +keep-tempdir do not delete the temporary extraction dirs h,help print a usage message and exit helpm print the manual and exit man view the manual in the pager and exit @@ -148,6 +149,7 @@ FILTERHEAD= # line separated arguments TAG= TAGDEF='printf version/; get_version "$archname"' COMMAND= +KEEP_TEMPDIR= # config (file, environment, command line) if [ -n "${ARCHIVES2GIT_ENV+set}" ] then @@ -211,6 +213,8 @@ do shift; COMMAND=$1 ;; --debug) set -x ;; + --keep-tempdir) + KEEP_TEMPDIR=yes ;; --helpm) help_message exit ;; @@ -233,7 +237,7 @@ done # setup NL=' ' -trap 'rm -rf "$TMPDIR"' EXIT INT QUIT TERM +[ -z "$KEEP_TEMPDIR" ] && trap 'rm -rf "$TMPDIR"' EXIT INT QUIT TERM TMPDIR=$(mktemp -d) || { echo >&2 "$PROGRAM_NAME: error: cannot create a temporary directory" -- 2.11.4.GIT