diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-04-02 10:34:55 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-04-02 10:34:55 -0300 |
commit | a6a743c1cd9e257f3a506e54bddef5b462ed986b (patch) | |
tree | fbb045606bb8fe94c8dc03065fbcb284668651c8 /lib/thandy/ThpHelper.py | |
parent | 0a33d2412ffd7942dd57ebd7c6f91dbdf2b7f1bb (diff) |
Several fixes
Diffstat (limited to 'lib/thandy/ThpHelper.py')
-rw-r--r-- | lib/thandy/ThpHelper.py | 12 |
1 files changed, 7 insertions, 5 deletions
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) |