Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/openresolv/dist Sync
details: https://anonhg.NetBSD.org/src/rev/99f8c3839cc7
branches: trunk
changeset: 461925:99f8c3839cc7
user: roy <roy%NetBSD.org@localhost>
date: Wed Jul 17 18:31:43 2019 +0000
description:
Sync
diffstat:
external/bsd/openresolv/dist/Makefile | 10 +-
external/bsd/openresolv/dist/README | 11 ---
external/bsd/openresolv/dist/libc.in | 12 +--
external/bsd/openresolv/dist/pdnsd.in | 10 +-
external/bsd/openresolv/dist/resolvconf.in | 93 +++++++++++++++++------------
5 files changed, 69 insertions(+), 67 deletions(-)
diffs (truncated from 389 to 300 lines):
diff -r 80e70520e6f6 -r 99f8c3839cc7 external/bsd/openresolv/dist/Makefile
--- a/external/bsd/openresolv/dist/Makefile Wed Jul 17 18:24:23 2019 +0000
+++ b/external/bsd/openresolv/dist/Makefile Wed Jul 17 18:31:43 2019 +0000
@@ -79,11 +79,6 @@
install: proginstall maninstall
-import:
- rm -rf /tmp/${DISTPREFIX}
- ${INSTALL} -d /tmp/${DISTPREFIX}
- cp README ${SRCS} /tmp/${DISTPREFIX}
-
dist-git:
git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
@@ -103,3 +98,8 @@
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
chmod 644 ${DISTINFOSIGN}
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
+
+import: dist
+ rm -rf /tmp/${DISTPREFIX}
+ ${INSTALL} -d /tmp/${DISTPREFIX}
+ tar xvJpf ${DISTFILE} -C /tmp
diff -r 80e70520e6f6 -r 99f8c3839cc7 external/bsd/openresolv/dist/README
--- a/external/bsd/openresolv/dist/README Wed Jul 17 18:24:23 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-openresolv is a resolvconf implementation which manages resolv.conf
-You can find the latest version at http://roy.marples.name/projects/openresolv
-It is written and maintained by Roy Marples <roy%marples.name@localhost>
-
-This resolvconf implementation, along with its subscribers, work with a
-POSIX compliant shell and userland utilities. It is designed to work without
-tools such as sed as it *has* to work without /usr being available.
-
-On systems where resolvconf is expected to be used before /var/run is available
-for writing, you can configure openresolv to write somewhere else, like say a
-ramdisk.
diff -r 80e70520e6f6 -r 99f8c3839cc7 external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in Wed Jul 17 18:24:23 2019 +0000
+++ b/external/bsd/openresolv/dist/libc.in Wed Jul 17 18:31:43 2019 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2007-2016 Roy Marples
+# Copyright (c) 2007-2019 Roy Marples
# All rights reserved
# libc subscriber for resolvconf
@@ -36,9 +36,9 @@
# sed may not be available, and this is faster on small files
key_get_value()
{
- local key="$1" x= line=
+ key="$1"
+ shift
- shift
if [ $# -eq 0 ]; then
while read -r line; do
case "$line" in
@@ -58,8 +58,6 @@
keys_remove()
{
- local key x line found
-
while read -r line; do
found=false
for key do
@@ -79,7 +77,7 @@
if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then
. "$SYSCONFDIR"/resolvconf.conf
elif [ -d "$SYSCONFDIR"/resolvconf ]; then
- SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d"
+ SYSCONFDIR="$SYSCONFDIR/resolvconf"
base="$SYSCONFDIR/resolv.conf.d/base"
if [ -f "$base" ]; then
prepend_nameservers="$(key_get_value "nameserver " "$base")"
@@ -112,7 +110,7 @@
uniqify()
{
- local result=
+ result=
while [ -n "$1" ]; do
case " $result " in
*" $1 "*);;
diff -r 80e70520e6f6 -r 99f8c3839cc7 external/bsd/openresolv/dist/pdnsd.in
--- a/external/bsd/openresolv/dist/pdnsd.in Wed Jul 17 18:24:23 2019 +0000
+++ b/external/bsd/openresolv/dist/pdnsd.in Wed Jul 17 18:31:43 2019 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2010-2013 Roy Marples
+# Copyright (c) 2010-2018 Roy Marples
# All rights reserved
# pdnsd subscriber for resolvconf
@@ -41,14 +41,16 @@
# but sed may not always be available at the time.
remove_markers()
{
- local m1="$1" m2="$2" x= line= in_marker=0
+ m1="$1"
+ m2="$2"
+ in_marker=0
shift; shift
if type sed >/dev/null 2>&1; then
sed "/^$m1/,/^$m2/d" $@
else
- for x; do
- while read -r line; do
+ for x do
+ while read line; do
case "$line" in
"$m1"*) in_marker=1;;
"$m2"*) in_marker=0;;
diff -r 80e70520e6f6 -r 99f8c3839cc7 external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in Wed Jul 17 18:24:23 2019 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in Wed Jul 17 18:31:43 2019 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2007-2016 Roy Marples
+# Copyright (c) 2007-2019 Roy Marples
# All rights reserved
# Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
RESOLVCONF="$0"
-OPENRESOLV_VERSION="3.9.0"
+OPENRESOLV_VERSION="3.9.1"
SYSCONFDIR=@SYSCONFDIR@
LIBEXECDIR=@LIBEXECDIR@
VARDIR=@VARDIR@
@@ -125,21 +125,22 @@
# If you think otherwise, capture a DNS trace and you'll see libc
# will strip it regardless.
# This also solves setting up duplicate zones in our subscribers.
-strip_trailing_dots()
+# Also strip any comments denoted by #.
+resolv_strip()
{
- local n= d=
-
- for n; do
- printf "$d%s" "${n%.}"
- d=" "
+ space=
+ for word; do
+ case "$word" in
+ \#*) break;;
+ esac
+ printf "%s%s" "$space${word%.}"
+ space=" "
done
printf "\n"
}
private_iface()
{
- local p
-
# Allow expansion
cd "$IFACEDIR"
@@ -168,12 +169,15 @@
# for domain name servers, search name servers and global nameservers
parse_resolv()
{
- local line= ns= ds= search= d= n= newns=
- local new=true iface= private=false p= domain= l= islocal=
-
+ domain=
+ new=true
newns=
+ ns=
+ private=false
+ search=
while read -r line; do
+ stripped_line="$(resolv_strip ${line#* })"
case "$line" in
"# resolv.conf from "*)
if ${new}; then
@@ -189,25 +193,28 @@
"nameserver "*)
islocal=false
for l in $local_nameservers; do
- case "${line#* }" in
+ case "$stripped_line" in
$l)
islocal=true
- echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\""
break
;;
esac
done
- $islocal || ns="$ns${line#* } "
+ if $islocal; then
+ echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS $stripped_line\""
+ else
+ ns="$ns$stripped_line "
+ fi
;;
"domain "*)
- search="$(strip_trailing_dots ${line#* })"
+ search="$stripped_line"
if [ -z "$domain" ]; then
domain="$search"
echo "DOMAIN=\"$domain\""
fi
;;
"search "*)
- search="$(strip_trailing_dots ${line#* })"
+ search="$stripped_line"
;;
*)
[ -n "$line" ] && continue
@@ -236,7 +243,7 @@
uniqify()
{
- local result=
+ result=
while [ -n "$1" ]; do
case " $result " in
*" $1 "*);;
@@ -249,8 +256,8 @@
dirname()
{
- local dir= OIFS="$IFS"
- local IFS=/
+ OIFS="$IFS"
+ IFS=/
set -- $@
IFS="$OIFS"
if [ -n "$1" ]; then
@@ -267,7 +274,7 @@
config_mkdirs()
{
- local e=0 f d
+ e=0
for f; do
[ -n "$f" ] || continue
d="$(dirname "$f")"
@@ -295,7 +302,7 @@
# Detect the running init system.
# As systemd and OpenRC can be installed on top of legacy init
# systems we try to detect them first.
- local status="@STATUSARG@"
+ status="@STATUSARG@"
: ${status:=status}
if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then
RESTARTCMD='
@@ -309,8 +316,9 @@
then
/usr/bin/systemctl restart $1.service
fi'
- elif [ -x /sbin/rc-service ] && [ -s /libexec/rc/init.d/softlevel ] ||
- [ -s /run/openrc/softlevel ]
+ elif [ -x /sbin/rc-service ] &&
+ { [ -s /libexec/rc/init.d/softlevel ] ||
+ [ -s /run/openrc/softlevel ]; }
then
RESTARTCMD='/sbin/rc-service -i $1 -- -Ds restart'
elif [ -x /usr/sbin/invoke-rc.d ]; then
@@ -385,7 +393,7 @@
echo_resolv()
{
- local line= OIFS="$IFS"
+ OIFS="$IFS"
[ -n "$1" ] && [ -f "$IFACEDIR/$1" ] || return 1
echo "# resolv.conf from $1"
@@ -407,11 +415,16 @@
{
[ -d "$IFACEDIR" ] || return 0
- local report=false list= retval=0 cmd="$1" excl=
+ cmd="$1"
shift
+ excl=false
+ list=
+ report=false
+ retval=0
case "$IF_EXCLUSIVE" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+ excl=true
if [ -d "$EXCLUSIVEDIR" ]; then
cd "$EXCLUSIVEDIR"
for i in *; do
@@ -421,7 +434,6 @@
fi
Home |
Main Index |
Thread Index |
Old Index