chiark / gitweb /
keyfunc.sh.in, extract-profile.in: Put profile name before the filenames.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 25 Dec 2011 23:41:43 +0000 (23:41 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 26 Dec 2011 00:08:44 +0000 (00:08 +0000)
This is the way it was originally, but that version wasn't checked in.
I had some crazy idea that this ordering made interfacing to userv
easier, but it doesn't.

extract-profile.in
keyfunc.sh.in

index 1d19fc24e5bd0b0366e4779e8d619b72c7d7e7fc..c3a224b09bfbe60ea8f73ae30ae9466ac89e892b 100755 (executable)
@@ -403,7 +403,7 @@ def parse(filename, d):
 ### Main program.
 
 OP = O.OptionParser(
-  usage = '%prog FILE|DIRECTORY ... SECTION',
+  usage = '%prog SECTION FILE|DIRECTORY ...',
   version = '%%prog, version %s' % VERSION,
   description = '''\
 Parse the configurations FILE and DIRECTORY contents, and output the named
@@ -417,8 +417,8 @@ def main(args):
     opts, args = OP.parse_args(args[1:])
     if len(args) < 2:
       OP.error('not enough positional parameters')
-    files = args[:-1]
-    sect = args[-1]
+    sect = args[0]
+    files = args[1:]
 
     ## Read in the inputs.
     d = { '@GLOBAL': Section('@GLOBAL') }
index ca14782840dfd64d8a238b955e156db95620fc3a..aae5598877dd90272cea7a87a32ff2928e1d1cfb 100644 (file)
@@ -163,7 +163,7 @@ getsysprofile () {
   profile=$1
   ## Write the named system PROFILE to standard output.
 
-  $bindir/extract-profile $ETC/profile.d/ "$profile"
+  $bindir/extract-profile "$profile" $ETC/profile.d/
 }
 
 setprops () {
@@ -353,7 +353,7 @@ read_profile () {
       userv "$user" cryptop-profile "$label" >$tmp/profile
       ;;
     nil)
-      $bindir/extract-profile $ETC/profile.d/ "$label" >$tmp/profile
+      $bindir/extract-profile "$label" $ETC/profile.d/ >$tmp/profile
       ;;
   esac