~ubuntu-branches/debian/wheezy/autofs/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/064_support_options_on_nis_maps

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-03-08 01:36:09 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080308013609-cvs4f2ecoyoism02
Tags: 4.1.4+debian-2.1
* Non-maintainer upload.
* High-urgency upload for RC bugfix.
* Add -DLDAP_DEPRECATED to CFLAGS, to fix compatibility with OpenLDAP
  2.4 on 64-bit architectures.  Closes: #463419.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- autofs-4.1.4.orig/samples/rc.autofs.in      2005-06-10 00:19:26.000000000 +0200
2
 
+++ autofs-4.1.4/samples/rc.autofs.in   2005-06-10 00:26:29.000000000 +0200
3
 
@@ -129,7 +129,17 @@
4
 
     else
5
 
         map="$1"
6
 
     fi
7
 
-    /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
8
 
+
9
 
+    # Append the map's options at the _start_ if there are any options already
10
 
+    # (ie. myopt -> $2,myopt), otherwise just append them at the end.
11
 
+    if [ -z "$2" ]; then
12
 
+        /usr/bin/ypcat -k "$map" 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
13
 
+    else
14
 
+        /usr/bin/ypcat -k "$map" 2> /dev/null |
15
 
+        sed -e '/^#/d' -e '/^$/d' \
16
 
+            -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]\+-\([^ \t]\+\)/\1 \2 $2,\3/" \
17
 
+            -e "s/^[ \t]*\([^ \t]\+\)[ \t]\+\([^ \t]\+\)[ \t]*$/\1 \2 $2/"
18
 
+    fi    
19
 
 }
20
 
 
21
 
 function getfilemounts()
22
 
@@ -141,10 +151,11 @@
23
 
             if [ "`echo $auto_master_in | grep '^+'`" = "" ]; then
24
 
                 echo $auto_master_in
25
 
             else
26
 
-                for nismap in `cat /etc/auto.master | grep '^\+' |
27
 
-                        sed -e '/^#/d' -e '/^$/d'`; do
28
 
-                    catnismap `echo "$nismap" | sed -e 's/^\+//'`
29
 
-                done
30
 
+                cat /etc/auto.master | grep '^\+' | sed -e '/^#/d' -e '/^$/d' | (
31
 
+                    while read map options; do
32
 
+                        catnismap `echo "$map" | sed -e 's/^\+//'` $options
33
 
+                    done
34
 
+                )
35
 
             fi
36
 
         done
37
 
         )