Re: GNU sharutils generated archive license

Bruce Korb <[email protected]> Sun, 13 Aug 2017 11:12:56 -0700
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
On 08/06/17 17:25, Bruce Korb wrote:
> On 07/11/17 14:07, Paul Eggert wrote:
>> * Eventually './bootstrap' failed with the following diagnostics at the
>> end. At this point I got lost and gave up.

The version under GIT should now bootstrap for you.

    git.savannah.gnu.org/srv/git/sharutils.git

The patches with respect to the current release are attached.
I'd like to include any proposed licensing changes.
0001-implement-uuencode-mode-option.patch (text/x-patch, 6 KB)
From ed9336d864d845621e8988fd46f9064701a97540 Mon Sep 17 00:00:00 2001
From: Bruce Korb <[email protected]>
Date: Sat, 30 May 2015 09:46:31 -0700
Subject: [PATCH 1/4] implement uuencode mode option

Instead of deriving it from the source file or the current umask.
* src/uuencode-opts.def (mode): new option
* src/uuencode.c (process_opts): handle the code
  (encode): add warning when stdin and stderr are terminals
  print a warning message (a prompt to start typing input).
  Better than just hanging there leaving a puzzled user.
* src/Makefile.am: add a rule for re-creating help text
---
 src/Makefile.am            | 11 +++++++++++
 src/uuencode-full-help.txt | 17 +++++++++++++----
 src/uuencode-opts.def      | 23 +++++++++++++++++++++++
 src/uuencode.c             | 36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 83 insertions(+), 4 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 85c86fd..5c92ee2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -143,4 +143,15 @@ help-text : mk-help.sh $(bin_PROGRAMS)
 	touch $@
 	$(SHELL) mk-help.sh $@ $(bin_PROGRAMS)
 
+$(usage_texts) :
+	@set -x ; for f in $(usage_texts) ; \
+	do test -f $(srcdir)/$$f && continue ; \
+	   g=$${f%%-*} ; test -x $(builddir)/$$g || { \
+	      cd $(builddir) ; $(MAKE) $$g ; } ; \
+	   case "$$f" in \
+	   *-short-* ) $(builddir)/$$g --bogus 2>&1 | sed 1d > $(srcdir)/$$f ;; \
+	   *-full-* )  $(builddir)/$$g --help > $(srcdir)/$$f ;; \
+	   esac ; \
+	done
+
 ## src/Makefile.am ends here
diff --git a/src/uuencode-full-help.txt b/src/uuencode-full-help.txt
index dc8f69b..caffdbc 100644
--- a/src/uuencode-full-help.txt
+++ b/src/uuencode-full-help.txt
@@ -3,13 +3,15 @@ Usage:  uuencode [ -<flag> | --<name> ]... [<in-file>] <output-name>
 
    -m, --base64               convert using base64
    -e, --encode-file-name     encode the output file name
+   -p, --mode=PERMS           file mode permissions
+				- is a set membership option
    -v, --version[=MODE]       output version information and exit
    -h, --help                 display extended usage information and exit
    -!, --more-help            extended usage information passed thru pager
-   -R, --save-opts[=FILE]     save the option state to a config file FILE
-   -r, --load-opts=FILE       load options from the config file FILE
-                                - disabled with '--no-load-opts'
-                                - may appear multiple times
+   -R, --save-opts[=FILE]     save the option state to a config file
+   -r, --load-opts=FILE       load options from a config file
+				- disabled as '--no-load-opts'
+				- may appear multiple times
 
 Options are specified by doubled hyphens and their name or by a single
 hyphen and the flag character.
@@ -17,6 +19,13 @@ hyphen and the flag character.
 The following option preset mechanisms are supported:
  - reading file $HOME/.sharrc
 
+The valid "mode" option keywords are:
+  xoth woth roth xgrp wgrp rgrp xusr wusr rusr rwxo rwxg rwxu xall wall rall
+  or an integer mask with any of the lower 9 bits set
+or you may use a numeric representation.  Preceding these with a '!'
+will clear the bits, specifying 'none' will clear all bits, and 'all'
+will set them all.  Multiple entries may be passed as an option
+argument list.
 'uuencode' is used to create an ASCII representation of a file that can be
 sent over channels that may otherwise corrupt the data.  Specifically,
 email cannot handle binary data and will often even insert a character when
diff --git a/src/uuencode-opts.def b/src/uuencode-opts.def
index be139ad..77edeef 100644
--- a/src/uuencode-opts.def
+++ b/src/uuencode-opts.def
@@ -68,6 +68,29 @@ flag = {
 	_EODoc_;
 };
 
+flag = {
+    name        = mode;
+    value       = p;
+    descrip     = 'file mode permissions';
+    arg-name    = perm-name;
+    arg-type    = set;
+    keyword     = xoth, woth, roth, xgrp, wgrp, rgrp, xusr, wusr, rusr,
+                  rwxo, rwxg, rwxu, xall, wall, rall;
+
+    doc = <<- _EODoc_
+	By default, the output mode is set by the mode of the input file, or
+	(if the input is standard input) defaults to the current umask.
+	This option specifies the mode.  The bit names match the bit names in @file{stat(2)},
+	extended by @code{?all} codes for setting read/write/execute bits for all categories.
+	So to specify that everyone can read and the owner can write:
+	@example
+	@file{uuencode} @samp{-prall,wusr}
+	@end example
+	@noindent
+        or, equivalently, @samp{-p 0644}.  NOTE: The number does @i{not} default to octal.
+	_EODoc_;
+};
+
 doc-section = {
     ds-type = STANDARDS;
     ds-format = texi;
diff --git a/src/uuencode.c b/src/uuencode.c
index c651798..2b5c5de 100644
--- a/src/uuencode.c
+++ b/src/uuencode.c
@@ -147,6 +147,9 @@ encode (void)
 {
   int finishing = 0;
 
+  if (isatty (STDIN_FILENO) && isatty (STDERR_FILENO))
+    fputs (_("Please start typing your input file...\n"), stderr);
+
   do
     {
       unsigned char buf[45];
@@ -248,6 +251,39 @@ process_opts (int argc, char ** argv, int * mode)
       USAGE (UUENCODE_EXIT_USAGE_ERROR);
     }
 
+  if (HAVE_OPT(MODE))
+    {
+#     define FLAG_OKAY(_f)  ((S_I##_f) == (MODE_##_f))
+      enum { ModeFlagValueCheck = 1 /
+             (FLAG_OKAY(RUSR) && FLAG_OKAY(WUSR) && FLAG_OKAY(XUSR) &&
+              FLAG_OKAY(RGRP) && FLAG_OKAY(WGRP) && FLAG_OKAY(XGRP) &&
+              FLAG_OKAY(ROTH) && FLAG_OKAY(WOTH) && FLAG_OKAY(XOTH)) };
+#     undef FLAG_OKAY
+      int m = OPT_VALUE_MODE;
+      if ((m & ~0777) != 0) {
+        if (m & MODE_RWXO)
+          m |= MODE_XOTH | MODE_WOTH | MODE_ROTH;
+
+        if (m & MODE_RWXG)
+          m |= MODE_XGRP | MODE_WGRP | MODE_RGRP;
+
+        if (m & MODE_RWXU)
+          m |= MODE_XUSR | MODE_WUSR | MODE_RUSR;
+
+        if (m & MODE_XALL)
+          m |= MODE_XOTH | MODE_XGRP | MODE_XUSR;
+
+        if (m & MODE_WALL)
+          m |= MODE_WOTH | MODE_WGRP | MODE_WUSR;
+
+        if (m & MODE_RALL)
+          m |= MODE_ROTH | MODE_RGRP | MODE_RUSR;
+
+        m &= 0777;
+      }
+      *mode = m;
+    }
+
   if (HAVE_OPT(ENCODE_FILE_NAME))
     {
       size_t nmlen = strlen (output_name);
-- 
2.12.0
0004-let-gnulib-tool-be-verbose.patch (text/x-patch, 1.4 KB)
From e9737ab56bb40be902c15d9aad2f0a0bc3973cbf Mon Sep 17 00:00:00 2001
From: Bruce Korb <[email protected]>
Date: Sun, 6 Aug 2017 17:50:10 -0700
Subject: [PATCH 4/4] let gnulib-tool be verbose

---
 bootstrap | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/bootstrap b/bootstrap
index ca3ba05..163812e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -30,7 +30,7 @@ declare -r prog=$(basename $0 .sh)
 declare -r progpid=$$
 declare -r progdir=$(cd $(dirname $0) >/dev/null && pwd -P)
 declare -r program=$progdir/$(basename $0)
-declare -r progsrc=$(echo $progdir | sed s/-bld//)
+declare -r progsrc=${progdir%-bld}
 
 unset CDPATH
 
@@ -53,9 +53,14 @@ fini() {
 }
 
 init() {
-    case $(set -o) in
+    sets=$(set -o)
+    case "$sets" in
     (*posix*) set -o posix ;;
     esac
+    case "$sets" in
+    (*xtrace*on*) xtrace_active=true ;;
+    ( * )         xtrace_active=false ;;
+    esac
 
     trap 'die early death' 0
     set -e
@@ -285,11 +290,10 @@ run_gnulib_tool() {
 	xstrtoimax
 "
 
-    echo  ${gltool} --import  ... >&2
-    {
-      ${gltool} --import ${gnulib_libs} 2>&1
-    } | sed '1,/^You may need to add #include/d' | \
-      tee import-log.txt
+    ${gltool} --import ${gnulib_libs} 2>&1 | tee glt-log.txt
+
+    sed '1,/^You may need to add #include/d' glt-log.txt > import-log.txt
+    rm -f glt-log.txt
 
     autopoint=$(command -v autopoint)
     ${autopoint} --version | head -n2 >&2
-- 
2.12.0
0002-s-subsquent-subsequent.patch (text/x-patch, 1.7 KB)
From 6d2bdb4287f800c7b5b10d54fbc7f083ae3b726b Mon Sep 17 00:00:00 2001
From: Bruce Korb <[email protected]>
Date: Fri, 17 Feb 2017 15:40:34 -0800
Subject: [PATCH 2/4] s/subsquent/subsequent/

---
 src/uudecode-full-help.txt | 2 +-
 src/uudecode-opts.def      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/uudecode-full-help.txt b/src/uudecode-full-help.txt
index cf98d2d..50872a3 100644
--- a/src/uudecode-full-help.txt
+++ b/src/uudecode-full-help.txt
@@ -26,7 +26,7 @@ file, but may be overridden with the '-o' option.  It will have the mode of
 the original file, except that setuid and execute bits are not retained.  If
 the output file is specified to be '/dev/stdout' or '-', the result will be
 written to standard output.  If there are multiple input files and the
-second or subsquent file specifies standard output, the decoded data will
+second or subsequent file specifies standard output, the decoded data will
 be written to the same file as the previous output.  Don't do that.
 
 'uudecode' ignores any leading and trailing lines.  It looks for a line
diff --git a/src/uudecode-opts.def b/src/uudecode-opts.def
index e536f11..878c85c 100644
--- a/src/uudecode-opts.def
+++ b/src/uudecode-opts.def
@@ -34,7 +34,7 @@ detail = <<- _EODetail_
 	execute bits are not retained.  If the output file is specified to
 	be @file{/dev/stdout} or @file{-}, the result will be written to
 	standard output. If there are multiple input files and the second or
-	subsquent file specifies standard output, the decoded data will be
+	subsequent file specifies standard output, the decoded data will be
 	written to the same file as the previous output.  Don't do that.
 
 	@file{uudecode} ignores any leading and trailing lines.  It looks
-- 
2.12.0
0003-adjust-bootstrap.patch (text/x-patch, 486.4 KB) - not displayed