Author: waldi Date: Thu Mar 13 11:36:01 2008 New Revision: 10832 Log: bin/process.py: Redefine arguments more logical.
Modified: people/waldi/utils/kconfigeditor2/bin/process.py Modified: people/waldi/utils/kconfigeditor2/bin/process.py ============================================================================== --- people/waldi/utils/kconfigeditor2/bin/process.py (original) +++ people/waldi/utils/kconfigeditor2/bin/process.py Thu Mar 13 11:36:01 2008 @@ -1,17 +1,19 @@ +#!/usr/bin/python + import optparse, os, sys -def main(linux_root, package_root, config_output): +def main(package, source, config_output): from kconfigeditor.kconfig.menu.all import All from kconfigeditor.kconfig.package.files import Files - package = Files(package_root) + package = Files(package) arches = {} for i in package.kernelarch.values(): if i is not None: arches[i] = 1 arches = arches.keys() - menu = All(linux_root, arches) + menu = All(source, arches) files = {} for key, filelist in package.iteritems(): @@ -32,17 +34,17 @@ sys.path.append(os.path.join(sys.path[0], '../lib')) options = optparse.OptionParser( - usage = "%prog [OPTION]... LINUX_ROOT" - ) - options.add_option( - "-p", "--package", - dest = "package", - help = "location of linux-2.6 package [default: LINUX_ROOT]" + usage = "%prog [OPTION]... PACKAGE" ) options.add_option( "-c", "--config-output", dest = "config_output", - help = "output directory for config [default: {LINUX_ROOT,PACKAGE}/debian/config]" + help = "output directory for config [default: PACKAGE/debian/config]" + ) + options.add_option( + "-s", "--source", + dest = "source", + help = "location of linux source [default: PACKAGE]" ) opts, args = options.parse_args() @@ -52,11 +54,11 @@ elif len(args) < 1: options.error("Too less arguments") - linux_root = args[0] - package_root = opts.package or linux_root + package = args[0] + source = opts.source or package config_output = opts.config_output or os.path.join(package_root, 'debian/config') - sys.path.append(os.path.join(package_root, "debian/lib/python")) + sys.path.append(os.path.join(package, "debian/lib/python")) - main(linux_root, package_root, config_output) + main(package, source, config_output) _______________________________________________ Kernel-svn-changes mailing list Kernel-svn-changes@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes