From a6a743c1cd9e257f3a506e54bddef5b462ed986b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Tue, 2 Apr 2013 10:34:55 -0300 Subject: Several fixes --- lib/thandy/ThpHelper.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/thandy/ThpHelper.py') diff --git a/lib/thandy/ThpHelper.py b/lib/thandy/ThpHelper.py index 44ccb23..be82447 100644 --- a/lib/thandy/ThpHelper.py +++ b/lib/thandy/ThpHelper.py @@ -9,7 +9,7 @@ thp_template = Template("""format_version = 1 package_name = "$thp_name" package_version = "$version" package_version_tuple = [$version_list] -files = [ +files = [ $files ] @@ -20,7 +20,7 @@ platform = { "os" : "$os", "arch" : "$arch" } require_features = [ "pythonscripts" ] require_packages = [] -scripts = { "python2" : +scripts = { "python2" : [ $scripts ] } """) @@ -41,14 +41,16 @@ def usage(): def get_files(top, configs): ready = [] raw = [] + for root, dirs, files in os.walk(top): for f in files: is_config = "False" - f_value = "/".join([root, f]).replace(top, "") + f_value = os.path.join(root, f).replace(top, "") if f_value in configs: is_config = "True" + print f_value, os.path.join(root, f).replace(top, "") ready.append("(\"%s\", %s)," % (f_value, is_config)) - raw.append("/".join([root, f]).replace(top, "")) + raw.append(os.path.join(root, f).replace(top, "")) return ready, raw def thpconfig(args): @@ -87,7 +89,7 @@ def thpconfig(args): configs = [] if len(config_file_list) != 0: configs = open(config_file_list, "r").read().split("\n") - + files, raw = get_files(scan_dir, configs) mapping["files"] = "\n".join(files) -- cgit v1.2.3