From b65e1f934c6951c5943634f38ae4098573b94b0f Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 25 Dec 2011 23:41:43 +0000 Subject: [PATCH] keyfunc.sh.in, extract-profile.in: Put profile name before the filenames. Organization: Straylight/Edgeware From: Mark Wooding 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 | 6 +++--- keyfunc.sh.in | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extract-profile.in b/extract-profile.in index 1d19fc2..c3a224b 100755 --- a/extract-profile.in +++ b/extract-profile.in @@ -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') } diff --git a/keyfunc.sh.in b/keyfunc.sh.in index ca14782..aae5598 100644 --- a/keyfunc.sh.in +++ b/keyfunc.sh.in @@ -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 -- [mdw]