add base packages..
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-base / autofs / autofs-4.1.4 / 064_support_options_on_nis_maps.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 064_support_options_on_nis_maps.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
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
11 @@ -129,7 +129,17 @@
12      else
13          map="$1"
14      fi
15 -    /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
16 +
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'
21 +    else
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/"
26 +    fi    
27  }
28  
29  function getfilemounts()
30 @@ -141,10 +151,11 @@
31              if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then
32                  echo $auto_master_in
33              else
34 -                for nismap in `cat /etc/auto.master | grep '^\+' |
35 -                        sed -e '/^#/d' -e '/^$/d'`; do
36 -                    catnismap `echo "$nismap" | sed -e 's/^\+//'`
37 -                done
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
41 +                    done
42 +                )
43              fi
44          done
45          )