From 83162901d4b291d514c9ef833980d3919f3ea9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 7 Sep 2013 12:52:42 +0000 Subject: [PATCH] Catch up with trunk git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/branches/nooath@736 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- TODO | 5 ++++ misc/gendoc.pl | 14 +++++----- mkpkgng.in | 69 ++++++++++++++++++++++++++++++++++---------------- 3 files changed, 59 insertions(+), 29 deletions(-) diff --git a/TODO b/TODO index 70a9917..2b7b276 100644 --- a/TODO +++ b/TODO @@ -9,4 +9,9 @@ Before the next release: - Add loop detection to openpam_load_chain(). + - Look into the possibility of implementing a version of (or a + wrapper for) openpam_log() which respects the PAM_SILENT flag and + the no_warn module option. This would eliminate the need for + FreeBSD's _pam_verbose_error(). + $Id$ diff --git a/misc/gendoc.pl b/misc/gendoc.pl index c4481d6..c6eb4da 100644 --- a/misc/gendoc.pl +++ b/misc/gendoc.pl @@ -265,7 +265,7 @@ sub parse_source($) { $man .= ".Bl -tag -width 18n\n"; $intaglist = 1; } - s/^\.It [=;]([A-Za-z][A-Za-z_]+)$/.It Dv $1/gs; + s/^\.It [=;]([A-Za-z][0-9A-Za-z_]+)$/.It Dv $1/gs; $man .= "$_\n"; next; } elsif (($inlist || $intaglist) && m/^\S/) { @@ -293,16 +293,16 @@ sub parse_source($) { s/\s*=($func)\b\s*/\n.Fn $1\n/gs; s/\s*=($argnames)\b\s*/\n.Fa $1\n/gs; s/\s*=(struct \w+(?: \*)?)\b\s*/\n.Vt $1\n/gs; - s/\s*:([a-z_]+)\b\s*/\n.Va $1\n/gs; - s/\s*;([a-z_]+)\b\s*/\n.Dv $1\n/gs; - s/\s*=!([a-z_]+)\b\s*/\n.Xr $1 3\n/gs; - while (s/\s*=([a-z_]+)\b\s*/\n.Xr $1 3\n/s) { + s/\s*:([a-z][0-9a-z_]+)\b\s*/\n.Va $1\n/gs; + s/\s*;([a-z][0-9a-z_]+)\b\s*/\n.Dv $1\n/gs; + s/\s*=!([a-z][0-9a-z_]+)\b\s*/\n.Xr $1 3\n/gs; + while (s/\s*=([a-z][0-9a-z_]+)\b\s*/\n.Xr $1 3\n/s) { ++$xref{3}->{$1}; } s/\s*\"(?=\w)/\n.Do\n/gs; s/\"(?!\w)\s*/\n.Dc\n/gs; - s/\s*=([A-Z][A-Z_]+)\b\s*(?![\.,:;])/\n.Dv $1\n/gs; - s/\s*=([A-Z][A-Z_]+)\b([\.,:;]+)\s*/\n.Dv $1 $2\n/gs; + s/\s*=([A-Z][0-9A-Z_]+)\b\s*(?![\.,:;])/\n.Dv $1\n/gs; + s/\s*=([A-Z][0-9A-Z_]+)\b([\.,:;]+)\s*/\n.Dv $1 $2\n/gs; s/\s*{([A-Z][a-z] .*?)}\s*/\n.$1\n/gs; $man .= "$_\n"; } diff --git a/mkpkgng.in b/mkpkgng.in index 6f7fa43..6b18c3f 100644 --- a/mkpkgng.in +++ b/mkpkgng.in @@ -1,4 +1,31 @@ #!/bin/sh +#- +# Copyright (c) 2013 Dag-Erling Smørgrav +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. # # $Id$ # @@ -42,7 +69,7 @@ cd "$srcdir" # # Determine pkgng version and ABI # -pkgver=$(pkg query %v pkg) +pkgver=$(pkg -vv | awk '$1 == "Version:" { print $2 }') [ -n "$pkgver" ] || error "Unable to determine pkgng version." pkgabi=$(pkg -vv | awk '$1 == "ABI:" { print $2 }') [ -n "$pkgabi" ] || error "Unable to determine package ABI." @@ -73,28 +100,29 @@ make="$make --no-print-directory --quiet V=0" # # Create temporary directory # -info "Creating temporary directory." +info "Creating the temporary directory." tmproot=$(mktemp -d "${TMPDIR:-/tmp}/$package-$version.XXXXXX") -[ -n "$tmproot" -a -d "$tmproot" ] || error "unable to create temporary directory" +[ -n "$tmproot" -a -d "$tmproot" ] || \ + error "Unable to create the temporary directory." trap "exit 1" INT -trap "info Deleting temporary directory. ; rm -rf '$tmproot'" EXIT +trap "info Deleting the temporary directory. ; rm -rf '$tmproot'" EXIT set -e # # Install into tmproot # -info "Installing into temporary directory." +info "Installing into the temporary directory." $make install DESTDIR="$tmproot" # # Generate stub manifest # -info "Generating stub manifest." +info "Generating the stub manifest." manifest="$tmproot/+MANIFEST" cat >"$manifest" <>"$manifest" -# As of pkg 1.1.4, the shlib detection logic in "pkg create" only -# works when tmproot == "/", so instead of creating a package directly -# from the contents of $tmproot, we have to install to / and package -# that. -info "Packaging." -if [ "$pkgver" \< "1.1.5" ] ; then - info "pkg 1.1.4 or older detected." - yesno "We must now install to /. Proceed?" || error "Chicken." - $make install - pkg create -m "$tmproot" -o "$builddir" -else - pkg create -r "$tmproot" -m "$tmproot" -o "$builddir" -fi +# +# Create the package +# +info "Creating the package." +pkg create -r "$tmproot" -m "$tmproot" -o "$builddir" -echo "Package created for $package-$version." +# +# Done +# +info "Package created for $package-$version."