1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 064_support_options_on_nis_maps.dpatch
8 diff -Naur .B/samples/rc.autofs.in .A/samples/rc.autofs.in
9 --- .B/samples/rc.autofs.in 2005-04-11 11:30:54.000000000 +0000
10 +++ .A/samples/rc.autofs.in 2007-01-07 21:36:35.000000000 +0000
15 - /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
17 + # Append the map's options at the _start_ if there are any options already
18 + # (ie. myopt -> $2,myopt), otherwise just append them at the end.
19 + if [ -z "$2" ]; then
20 + /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
22 + /usr/bin/ypcat -k "$map" 2> /dev/null |
23 + sed -e '/^#/d' -e '/^$/d' \
24 + -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]\+-\([^ \t]\+\)/\1 \2 $2,\3/" \
25 + -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]*$/\1 \2 $2/"
29 function getfilemounts()
31 if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then
34 - for nismap in `cat /etc/auto.master | grep '^\+' |
35 - sed -e '/^#/d' -e '/^$/d'`; do
36 - catnismap `echo "$nismap" | sed -e 's/^\+//'`
38 + cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | (
39 + while read map options; do
40 + catnismap `echo "$map" | sed -e 's/^\+//'` $options