[gentoo-commits] proj/pax-utils:master commit in: man/

2024-08-09 Thread Sam James
commit: 101ddccc4fad47ac8bef08ff3e30cc81727f477b
Author: Mathias Krause  grsecurity  net>
AuthorDate: Tue Jul 30 21:30:25 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Aug  9 10:02:44 2024 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=101ddccc

meson: avoid using replace() to not unnecessarily bump meson >= 0.58.0

Debian bullseye ships with meson 0.56.2 which is too old to understand
replace().

Work around that with split() and string concatenation.

Signed-off-by: Mathias Krause  grsecurity.net>
Closes: https://github.com/gentoo/pax-utils/pull/16
Signed-off-by: Sam James  gentoo.org>

 man/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/meson.build b/man/meson.build
index 09ac0d5..c6982d2 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -19,7 +19,7 @@ fs = import('fs')
 out_pages = []
 generated_man_pages_exist = true
 foreach page : pages
-  man_page_name = page.replace('.docbook', '.1')
+  man_page_name = page.split('.')[0] + '.1'
   out_pages += man_page_name
   if not fs.exists(man_page_name)
   generated_man_pages_exist = false



[gentoo-commits] proj/pax-utils:master commit in: man/

2023-01-22 Thread Sam James
commit: 9fb7fc342f28f8342d8de6ca2d71b1cf2b765ae3
Author: Sam James  gentoo  org>
AuthorDate: Sun Jan 22 04:11:18 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Jan 22 04:38:42 2023 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=9fb7fc34

meson: fix installation of (pre-generated) man pages w/o xmlto

Fixes: 502631b86d63c4604b0ed78ad86a054e9726e897
Signed-off-by: Sam James  gentoo.org>

 man/meson.build | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/man/meson.build b/man/meson.build
index 130c8ec..09ac0d5 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -1,8 +1,4 @@
-xmlto = find_program('xmlto', required : get_option('build_manpages'))
-
-if not xmlto.found()
-  subdir_done()
-endif
+xmlto = find_program('xmlto', required : get_option('build_manpages'), 
disabler: true)
 
 docbook_conf = configuration_data()
 docbook_conf.set('version', meson.project_version())



[gentoo-commits] proj/pax-utils:master commit in: /, man/

2022-11-01 Thread Sam James
commit: 502631b86d63c4604b0ed78ad86a054e9726e897
Author: Sam James  gentoo  org>
AuthorDate: Wed Nov  2 00:37:57 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Nov  2 00:38:55 2022 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=502631b8

meson: include generated man pages in dist tarballs

Meson doesn't have an idiomatic way of doing this (for once!)
so we have to (per Eli Schwartz, thanks!) have:
1. a dist script which duplicates the build rule;
2. some meson.build if/else logic with fs.exists() to prefer the built manpage 
when using tarballs

Sadly, still can't easily regenerate man pages if
you apply a patch downstream though.

We use Michael Stapelberg's example from the linked bug as inspiration.

Bug: https://github.com/mesonbuild/meson/issues/2166
Reported-by: psykose  ayaya.dev>
Thanks-to: Eli Schwartz  archlinux.org>
Signed-off-by: Sam James  gentoo.org>

 man/meson.build | 37 -
 meson-build-dist-man.sh | 12 
 meson.build |  2 ++
 3 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/man/meson.build b/man/meson.build
index 2e346ec..130c8ec 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -18,20 +18,31 @@ pages = [
 'dumpelf.docbook', 'pspax.docbook', 'scanelf.docbook', 'scanmacho.docbook'
 ]
 
+fs = import('fs')
+
 out_pages = []
+generated_man_pages_exist = true
 foreach page : pages
-  out_pages += page.replace('.docbook', '.1')
+  man_page_name = page.replace('.docbook', '.1')
+  out_pages += man_page_name
+  if not fs.exists(man_page_name)
+  generated_man_pages_exist = false
+  endif
 endforeach
 
-custom_target('docbook_to_man',
-  command : [
-xmlto, '-x', files('custom.xsl'), '--skip-validation',
-'-o', meson.current_build_dir(), 'man', book
-  ],
-  input : [
-'pax-utils.docbook.in', 'custom.xsl', 'fragment/reftail',
-  ] + pages,
-  output : out_pages,
-  install : true,
-  install_dir : get_option('mandir') / 'man1'
-)
+if generated_man_pages_exist
+  install_man(out_pages)
+else
+  custom_target('docbook_to_man',
+command : [
+  xmlto, '-x', files('custom.xsl'), '--skip-validation',
+  '-o', meson.current_build_dir(), 'man', book
+],
+input : [
+  'pax-utils.docbook.in', 'custom.xsl', 'fragment/reftail',
+] + pages,
+output : out_pages,
+install : true,
+install_dir : get_option('mandir') / 'man1'
+  )
+endif

diff --git a/meson-build-dist-man.sh b/meson-build-dist-man.sh
new file mode 100755
index 000..699a380
--- /dev/null
+++ b/meson-build-dist-man.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This script should be invoked by meson itself (via 'meson dist')
+# See https://github.com/mesonbuild/meson/issues/2166 and more specifically,
+# https://github.com/mesonbuild/meson/issues/2166#issuecomment-629696911.
+set -eu
+
+cd "${MESON_DIST_ROOT}"
+mkdir build
+meson setup build -Dbuild_manpages=enabled
+meson compile -C build
+cp build/man/* man/
+rm -rf build

diff --git a/meson.build b/meson.build
index 0ee2630..0054ba4 100644
--- a/meson.build
+++ b/meson.build
@@ -138,6 +138,8 @@ install_data('symtree.sh',
 
 subdir('man')
 
+meson.add_dist_script('meson-build-dist-man.sh')
+
 do_tests = get_option('tests')
 if do_tests
   subdir('tests/lddtree')



[gentoo-commits] proj/pax-utils:master commit in: man/

2022-09-07 Thread Mike Gilbert
commit: 2d981305b117b669c60bede076557c2d765cf198
Author: Mike Gilbert  gentoo  org>
AuthorDate: Thu Sep  8 00:13:00 2022 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Thu Sep  8 00:17:00 2022 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=2d981305

man: reorder xmlto arguments

Bug: https://bugs.gentoo.org/869110
Thanks-to: Fabian Groffen  gentoo.org>
Signed-off-by: Mike Gilbert  gentoo.org>

 man/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/meson.build b/man/meson.build
index fc8d183..2e346ec 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -25,8 +25,8 @@ endforeach
 
 custom_target('docbook_to_man',
   command : [
-xmlto, 'man', '-x', files('custom.xsl'), '--skip-validation', book,
-'-o', meson.current_build_dir()
+xmlto, '-x', files('custom.xsl'), '--skip-validation',
+'-o', meson.current_build_dir(), 'man', book
   ],
   input : [
 'pax-utils.docbook.in', 'custom.xsl', 'fragment/reftail',



[gentoo-commits] proj/pax-utils:master commit in: /, man/fragment/

2021-04-16 Thread Mike Frysinger
commit: 5f494f3f79c4669bf6a3c217e9233b4a0a672244
Author: Mike Frysinger  gentoo  org>
AuthorDate: Sat Apr 17 03:50:19 2021 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Sat Apr 17 04:24:04 2021 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=5f494f3f

refresh http:// URIs

Signed-off-by: Mike Frysinger  gentoo.org>

 README.md| 16 
 TODO |  2 +-
 elf.h|  2 +-
 macho.h  |  3 ++-
 man/fragment/reftail |  4 ++--
 paxinc.h |  2 +-
 6 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index fa0f0f8..7e6dc99 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ You don't need PaX to use the pax-utils. Infact the only 
thing they
 really have in common is that pax-utils was initially written to aid in
 deploying PaX systems so it includes support for PT_PAX_FLAGS and the
 deprecated but still in use EI_PAX flags. For more information about PaX
-see the homepage at http://pax.grsecurity.net/
+see the homepage at https://pax.grsecurity.net/
 
 ## Links
 
@@ -49,25 +49,25 @@ If you include pax-utils in your distro, feel free to send 
an update for this.
  * Maintainer: ludwig.nus...@suse.de
 
 # Ubuntu
- * http://packages.ubuntu.com/edgy/devel/pax-utils
+ * https://packages.ubuntu.com/hirsute/pax-utils
  * Maintainer: john.r.mo...@gmail.com
 
 # Debian
- * http://packages.debian.org/unstable/misc/pax-utils
- * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=388200
+ * https://packages.debian.org/unstable/misc/pax-utils
+ * https://bugs.debian.org/388200
  * Maintainer: rde...@simphalempin.com
 
 # FreeBSD
- * 
http://portsmon.freebsd.org/portoverview.py?category=sysutils&portname=pax-utils
- * http://www.freshports.org/sysutils/pax-utils/
+ * 
https://portsmon.freebsd.org/portoverview.py?category=sysutils&portname=pax-utils
+ * https://www.freshports.org/sysutils/pax-utils/
  * http://archive.netbsd.se/?ml=freebsd-cvs-all&a=2006-08&m=2311441
  * Maintainer: s...@freebsd.org
 
 # OpenEmedded
- * 
http://www.openembedded.org/filebrowser/org.openembedded.dev/packages/pax-utils
+ * 
https://www.openembedded.org/filebrowser/org.openembedded.dev/packages/pax-utils
 
 # Crux
- * http://magog.se/crux/pax-utils/Pkgfile
+ * https://magog.se/crux/pax-utils/Pkgfile
  * Maintainer: matt...@hedenskog.se
 
 # Fedora

diff --git a/TODO b/TODO
index 3c9968c..613bfb6 100644
--- a/TODO
+++ b/TODO
@@ -22,7 +22,7 @@ no hits as all of our symbol comparisons ignore the 
versioning info.
 allow digging into ARM_ATTRIBUTES (.ARM.attributes) sections
- need info on the section layout
- figure out how to integrate cleanly (target-independent driller)
-   http://sourceware.org/binutils/docs/as/GNU-Object-Attributes.html
+   https://sourceware.org/binutils/docs/as/GNU-Object-Attributes.html
 
 scanelf should look at the dynamic table for rpath/needed/soname entries 
instead
 of requiring section headers and looking up by section names.  need to 
implement

diff --git a/elf.h b/elf.h
index 3627066..51962c9 100644
--- a/elf.h
+++ b/elf.h
@@ -14,7 +14,7 @@
 
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
-   .  */
+   .  */
 
 #ifndef _ELF_H
 #define_ELF_H 1

diff --git a/macho.h b/macho.h
index 79da151..c4929c8 100644
--- a/macho.h
+++ b/macho.h
@@ -9,7 +9,8 @@
 #include 
 
 /*
- * 
http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
+ * https://nicolascormier.com/documentation/macosx-programming/MachORuntime.pdf
+ * 
https://web.archive.org/web/20090404123504/http://developer.apple.com/DOCUMENTATION/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
  */
 
 #define CPU_ARCH_ABI64  0x0100  /* 64 bit */

diff --git a/man/fragment/reftail b/man/fragment/reftail
index 3acd009..c722421 100644
--- a/man/fragment/reftail
+++ b/man/fragment/reftail
@@ -1,6 +1,6 @@
 
  HOMEPAGE
- http://hardened.gentoo.org/pax-utils.xml
+ 
https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities
 
 
 
@@ -9,7 +9,7 @@
   Please include as much information as possible (using any available
   debugging options) and send bug reports to the maintainers (see the
   AUTHORS section).  Please
-  use the Gentoo bugzilla at http://bugs.gentoo.org/ if
+  use the Gentoo bugzilla at https://bugs.gentoo.org/ if
   possible.
  
 

diff --git a/paxinc.h b/paxinc.h
index 620ad68..aaff2e5 100644
--- a/paxinc.h
+++ b/paxinc.h
@@ -108,7 +108,7 @@ const char *strfileperms(const char *fname);
 #define PTR_ALIGN_DOWN(base, size) 
((__typeof__(base))ALIGN_DOWN((uintptr_t)(base), (size)))
 #define PTR_ALIGN_UP(base, size)   ((__typeof__(base))ALIGN_UP  
((uintptr_t)(base), (size)))
 
-/* Support for libFuzzer: http://llvm.org/docs/LibFuzzer.html */
+/* Support for libFuzze

[gentoo-commits] proj/pax-utils:master commit in: /, man/

2020-10-03 Thread Sergei Trofimovich
commit: 61f27d670b1d0c07e50ead2d317abe05d0196ab0
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Sat Oct  3 19:53:40 2020 +
Commit: Sergei Trofimovich  gentoo  org>
CommitDate: Sat Oct  3 19:53:40 2020 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=61f27d67

scanelg: add --ldcache= option to ease testing

Signed-off-by: Sergei Trofimovich  gentoo.org>

 man/scanelf.docbook | 7 +++
 paxldso.c   | 4 +++-
 paxldso.h   | 3 +++
 scanelf.c   | 3 +++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/man/scanelf.docbook b/man/scanelf.docbook
index d9032a9..22503b2 100644
--- a/man/scanelf.docbook
+++ b/man/scanelf.docbook
@@ -214,6 +214,13 @@
 listing ELFs.

   
+  
+   --ldcache PATH
+   
+Use specified path instead of /etc/ld.so.cache. Generally paired with
+options like -L or -n.
+   
+  
  
 
 

diff --git a/paxldso.c b/paxldso.c
index 0cb7b01..2d8ddea 100644
--- a/paxldso.c
+++ b/paxldso.c
@@ -156,7 +156,7 @@ char *ldso_cache_lookup_lib(elfobj *elf, const char *fname)
 
if (ldcache == NULL) {
int fd;
-   const char *cachefile = root_rel_path("/etc/ld.so.cache");
+   const char *cachefile = root_rel_path(ldcache_path);
struct stat st;
 
if (fstatat(root_fd, cachefile, &st, 0))
@@ -369,3 +369,5 @@ void paxldso_cleanup(void)
ldso_config_cleanup();
 }
 #endif
+
+const char * ldcache_path = "/etc/ld.so.cache";

diff --git a/paxldso.h b/paxldso.h
index 16cbbac..fb7d938 100644
--- a/paxldso.h
+++ b/paxldso.h
@@ -66,4 +66,7 @@ extern void paxldso_cleanup(void);
 # define paxldso_cleanup()
 #endif
 
+/* Path to ld.so.cache. Usually overridden for tests. */
+extern const char * ldcache_path;
+
 #endif

diff --git a/scanelf.c b/scanelf.c
index c2bda35..50497b2 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -1832,6 +1832,7 @@ static void scanelf_envpath(void)
 static struct option const long_opts[] = {
{"path",  no_argument, NULL, 'p'},
{"ldpath",no_argument, NULL, 'l'},
+   {"ldcache",a_argument, NULL, 130},
{"use-ldpath",no_argument, NULL, 129},
{"root",   a_argument, NULL, 128},
{"recursive", no_argument, NULL, 'R'},
@@ -1877,6 +1878,7 @@ static struct option const long_opts[] = {
 static const char * const opts_help[] = {
"Scan all directories in PATH environment",
"Scan all directories in /etc/ld.so.conf",
+   "Use alternate ld.so.cache specified in ",
"Use ld.so.conf to show full path (use with -r/-n)",
"Root directory (use with -l or -p)",
"Scan directories recursively",
@@ -2120,6 +2122,7 @@ static int parseargs(int argc, char *argv[])
err("Could not open root: %s", optarg);
break;
case 129: load_cache_config = use_ldpath = 1; break;
+   case 130: ldcache_path = optarg; break;
case ':':
err("Option '%c' is missing parameter", optopt);
case '?':



[gentoo-commits] proj/pax-utils:master commit in: man/

2016-05-31 Thread Mike Frysinger
commit: c1f19095df0c1e6e3e31dc44f3e5ad02c35bb32e
Author: Mike Frysinger  gentoo  org>
AuthorDate: Tue May 31 22:26:21 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue May 31 22:26:21 2016 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=c1f19095

man: drop redundant id sections

These aren't needed to format the man output correctly, and newer
libxml2 complains about their duplicate ids, so punt them.

 man/dumpelf.docbook   |  8 
 man/pspax.docbook |  8 
 man/scanelf.docbook   | 10 +-
 man/scanmacho.docbook | 10 +-
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/man/dumpelf.docbook b/man/dumpelf.docbook
index a5074fb..15f5b61 100644
--- a/man/dumpelf.docbook
+++ b/man/dumpelf.docbook
@@ -7,12 +7,12 @@
  &project;
 
 
-
+
  dumpelf
  dump internal ELF structure
 
 
-
+
  
   dumpelf
   
@@ -24,7 +24,7 @@
  
 
 
-
+
  DESCRIPTION
  
   dumpelf is a user-space utility to dump all of the 
internal
@@ -33,7 +33,7 @@
  
 
 
-
+
  OPTIONS
  
   

diff --git a/man/pspax.docbook b/man/pspax.docbook
index 90e46bf..3604fdd 100644
--- a/man/pspax.docbook
+++ b/man/pspax.docbook
@@ -7,12 +7,12 @@
  &project;
 
 
-
+
  pspax
  list ELF/PaX information about running processes
 
 
-
+
  
   pspax
   
@@ -24,7 +24,7 @@
  
 
 
-
+
  DESCRIPTION
  
   pspax is a user-space utility that scans the proc
@@ -34,7 +34,7 @@
  
 
 
-
+
  OPTIONS
  
   

diff --git a/man/scanelf.docbook b/man/scanelf.docbook
index e6b34ee..d9032a9 100644
--- a/man/scanelf.docbook
+++ b/man/scanelf.docbook
@@ -7,12 +7,12 @@
  &project;
 
 
-
+
  scanelf
  user-space utility to scan ELF files
 
 
-
+
  
   scanelf
   
@@ -26,7 +26,7 @@
  
 
 
-
+
  DESCRIPTION
  
   scanelf is a user-space utility to quickly scan given
@@ -35,7 +35,7 @@
  
 
 
-
+
  OPTIONS
  
   
@@ -217,7 +217,7 @@
  
 
 
-
+
  FORMAT
  
   The format string is much like a printf string in that it is a literal string

diff --git a/man/scanmacho.docbook b/man/scanmacho.docbook
index 6d895e2..6a6b5ef 100644
--- a/man/scanmacho.docbook
+++ b/man/scanmacho.docbook
@@ -7,12 +7,12 @@
  &project;
 
 
-
+
  scanmacho
  user-space utility to scan Mach-O files
 
 
-
+
  
   scanmacho
   
@@ -26,7 +26,7 @@
  
 
 
-
+
  DESCRIPTION
  
   scanmacho is a user-space utility to quickly scan given
@@ -42,7 +42,7 @@
  
 
 
-
+
  OPTIONS
  
   
@@ -153,7 +153,7 @@
  
 
 
-
+
  FORMAT
  
   The format string is much like a printf string in that it is a literal string



[gentoo-commits] proj/pax-utils:master commit in: man/, /, tests/source/

2015-12-16 Thread Mike Frysinger
commit: 35525e096061c33b9c10cfb2b0312846b4b0b9fe
Author: Mike Frysinger  gentoo  org>
AuthorDate: Wed Dec 16 23:32:47 2015 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Wed Dec 16 23:32:47 2015 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=35525e09

use `sed -E -i.tmp` everywhere

POSIX is adding the -E flag to enable ERE behavior, and GNU/sed already
supports this, as do various BSD systems (including OS X).

While GNU makes the suffix to -i optional, POSIX/etc... do not, so make
sure we always specify it.

 Makefile   | 3 ++-
 lddtree.sh | 2 +-
 man/Makefile   | 3 ++-
 tests/source/space | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 26cc9d4..b3782a6 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,8 @@ GEN_MARK_END   = \# @@@ GEN END @@@ \#
 EXTRA_DIST = $(shell git ls-files)
 autotools-update:
$(MAKE) -C man -j
-   sed -i '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am
+   sed -i.tmp '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am
+   @rm -f Makefile.am.tmp
( \
echo "$(GEN_MARK_START)"; \
printf 'dist_man_MANS +='; \

diff --git a/lddtree.sh b/lddtree.sh
index 8e6501f..96163e3 100755
--- a/lddtree.sh
+++ b/lddtree.sh
@@ -42,7 +42,7 @@ elf_specs() {
# LINUX and GNU are the same thing, as are NONE and SYSV, so normalize
# GNU & LINUX to NONE. #442024 #464380
scanelf -BF '#F%a %M %D %I' "$1" | \
-   sed -r 's: (LINUX|GNU)$: NONE:'
+   sed -E 's: (LINUX|GNU)$: NONE:'
 }
 
 lib_paths_fallback="${ROOT}lib* ${ROOT}usr/lib* ${ROOT}usr/local/lib*"

diff --git a/man/Makefile b/man/Makefile
index 5332962..6f1f185 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -4,7 +4,8 @@ XMLTO_FLAGS_man = -x custom.xsl --skip-validation
 man pdf txt xhtml xhtml-nochunks:
@xmlto $@ $(XMLTO_FLAGS_$@) pax-utils.docbook || echo "If this failed, 
you probably need to emerge ~app-text/docbook-xml-dtd-4.4 app-text/xmlto 
dev-tex/xmltex"
@# scanelf.1 has funky indented lists ... hack it back
-   @sed -i 's:^[.]TP 4:.TP 2:' scanelf.1
+   @sed -i.tmp 's:^[.]TP 4:.TP 2:' scanelf.1
+   @rm scanelf.1.tmp
 clean distclean:
rm -f *.1 *.html
 

diff --git a/tests/source/space b/tests/source/space
index 530c273..9626c0c 100755
--- a/tests/source/space
+++ b/tests/source/space
@@ -11,7 +11,7 @@ if [ $# != 1 ] ; then
EOF
 fi
 
-sed -r '/[[:space:]]+$/s:[[:space:]]+$::' "$i" | \
+sed -E '/[[:space:]]+$/s:[[:space:]]+$::' "$i" | \
awk '{
if (NF == 0) {
while (NF == 0)



[gentoo-commits] proj/pax-utils:master commit in: man/, /

2015-08-18 Thread Mike Frysinger
commit: 99f303d1e9dec2b8d31d99c361572b91d67f9156
Author: Mike Frysinger  gentoo  org>
AuthorDate: Tue Aug 18 16:32:07 2015 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Tue Aug 18 16:32:07 2015 +
URL:https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=99f303d1

build: refresh autotool regen logic for git

 Makefile| 34 ++
 Makefile.am | 49 ++---
 make-tarball.sh |  2 +-
 man/.cvsignore  |  1 -
 4 files changed, 65 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile
index 4b0f862..ba3b6a2 100644
--- a/Makefile
+++ b/Makefile
@@ -152,23 +152,25 @@ check test:
 # All logic related to autotools is below here
 #
 GEN_MARK_START = \# @@@ GEN START @@@ \#
-GEN_MARK_END   = \# @@@ GEN START @@@ \#
-EXTRA_DIST = \
-   $(shell find -type f)
-MAKE_MULTI_LINES = $(patsubst %,\n\t%,$(sort $(1)))
-# 2nd level of indirection here is so the $(find) doesn't pick up
-# files in EXTRA_DIST that get cleaned up ...
-autotools-update: clean
-   $(MAKE) _autotools-update
-_autotools-update:
+GEN_MARK_END   = \# @@@ GEN END @@@ \#
+EXTRA_DIST = $(shell git ls-files)
+autotools-update:
+   $(MAKE) -C man -j
sed -i '/^$(GEN_MARK_START)$$/,/^$(GEN_MARK_END)$$/d' Makefile.am
-   printf '%s\ndist_man_MANS += %b\nEXTRA_DIST += %b\n%s\n' \
-   "$(GEN_MARK_START)" \
-   "$(call MAKE_MULTI_LINES,$(wildcard man/*.1))" \
-   "$(call MAKE_MULTI_LINES,$(EXTRA_DIST))" \
-   "$(GEN_MARK_END)" \
-   >> Makefile.am
-autotools: autotools-update
+   ( \
+   echo "$(GEN_MARK_START)"; \
+   printf 'dist_man_MANS +='; \
+   printf ' \\\n\t%s' $(wildcard man/*.1); \
+   echo; \
+   printf 'EXTRA_DIST +='; \
+   printf ' \\\n\t%s' $(EXTRA_DIST); \
+   echo; \
+   echo "$(GEN_MARK_END)"; \
+   ) >> Makefile.am
+autotools:
+ifeq ($(SKIP_AUTOTOOLS_UPDATE),)
+   $(MAKE) autotools-update
+endif
./autogen.sh --from=make
 
 .PHONY: autotools autotools-update _autotools-update

diff --git a/Makefile.am b/Makefile.am
index 57aecfa..5db3f75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,8 +42,49 @@ dist_man_MANS =
 EXTRA_DIST = autotools/m4/gnulib-cache.m4
 
 # @@@ GEN START @@@ #
-dist_man_MANS += 
+dist_man_MANS += \
+   man/dumpelf.1 \
+   man/pspax.1 \
+   man/scanmacho.1 \
+   man/scanelf.1
 EXTRA_DIST += \
+   .depend \
+   .gitignore \
+   BUGS \
+   COPYING \
+   Makefile \
+   Makefile.am \
+   README \
+   TODO \
+   autogen.sh \
+   configure.ac \
+   dumpelf.c \
+   elf.h \
+   lddtree.py \
+   lddtree.sh \
+   macho.h \
+   make-tarball.sh \
+   man/Makefile \
+   man/custom.xsl \
+   man/dumpelf.docbook \
+   man/fragment/date \
+   man/fragment/reftail \
+   man/fragment/version \
+   man/pax-utils.docbook \
+   man/pspax.docbook \
+   man/scanelf.docbook \
+   man/scanmacho.docbook \
+   paxelf.c \
+   paxelf.h \
+   paxinc.c \
+   paxinc.h \
+   paxmacho.c \
+   paxmacho.h \
+   porting.h \
+   pspax.c \
+   scanelf.c \
+   scanmacho.c \
+   symtree.sh \
tests/Makefile \
tests/lddtree/Makefile \
tests/lddtree/dotest.cmp \
@@ -56,5 +97,7 @@ EXTRA_DIST += \
tests/scanelf/scanelf.simple.good \
tests/source/Makefile \
tests/source/dotest \
-   tests/source/space
-# @@@ GEN START @@@ #
+   tests/source/space \
+   xfuncs.c \
+   xfuncs.h
+# @@@ GEN END @@@ #

diff --git a/make-tarball.sh b/make-tarball.sh
index e99c44d..04f778d 100755
--- a/make-tarball.sh
+++ b/make-tarball.sh
@@ -49,7 +49,7 @@ make -C man
 einfo "Building autotools ..."
 sed -i "/^AC_INIT/s:git:${ver}:" configure.ac
 sed -i "1iPV := ${ver}" Makefile
-LC_ALL=C ${MAKE} -s autotools >/dev/null
+SKIP_AUTOTOOLS_UPDATE=true LC_ALL=C ${MAKE} -s autotools >/dev/null
 rm -rf autom4te.cache
 
 popd >/dev/null

diff --git a/man/.cvsignore b/man/.cvsignore
deleted file mode 100644
index f7e585b..000
--- a/man/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.1