diff options
author | Iikka Eklund <iikka.eklund@digia.com> | 2014-08-13 13:18:50 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@digia.com> | 2014-08-14 08:18:09 +0200 |
commit | e2877cf70548756dcd467b3c0b379501ac878e73 (patch) | |
tree | 7a3bb37c764e41eb470e13ed8797eb1653576d41 /packaging-tools/archiveresolver.py | |
parent | 47e917bc3ee4a9a8e34e12c092395b4abd5a8a4a (diff) |
Add possibility to put package templates in dedicated directory
"configurations/" directory is getting bloated. Add possibility to
rearrange pkg templates into dedicated base directory. I.e.
configurations/pkg_templates/
Current pkg templates can be moved there in follow up commit.
After this change the packaging scripts will first check the pkg
templates under the new base directory. If not found from there then
it tries to locate them directly under "configurations/".
Also clean up some related unused code.
Change-Id: Id6761cd33bd86e5a94d72964062f7b05fe3149cc
Reviewed-by: Antti Kokko <antti.kokko@digia.com>
Diffstat (limited to 'packaging-tools/archiveresolver.py')
-rw-r--r-- | packaging-tools/archiveresolver.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packaging-tools/archiveresolver.py b/packaging-tools/archiveresolver.py index 11d1a1867..19678fbe0 100644 --- a/packaging-tools/archiveresolver.py +++ b/packaging-tools/archiveresolver.py @@ -43,6 +43,7 @@ import os import sys import bldinstallercommon +import pkg_constants SERVER_NAMESPACE = 'ArchiveRemoteLocation' PACKAGE_REMOTE_LOCATION_RELEASE = 'release' @@ -141,19 +142,20 @@ class ArchiveLocationResolver: for item in self.key_substitution_list: temp = archive_uri.replace(item[0], item[1]) if temp != archive_uri: - #print 'Substituted: ' + archive_uri archive_uri = temp - #print ' into: ' + archive_uri # 1. the file exists, uri points to valid path on file system (or network share) if os.path.isfile(archive_uri): return archive_uri # 2. check if given archive_uri denotes a package under package templates directory - base_path = self.configurations_root_dir + os.sep - package_path = os.sep + package_name + os.sep + 'data' + os.sep + archive_uri + base_path = os.path.join(self.configurations_root_dir, pkg_constants.PKG_TEMPLATE_BASE_DIR_NAME) + package_path = package_name + os.sep + 'data' + os.sep + archive_uri # find the correct template subdirectory for subdir in self.pkg_templates_dir_list: - if os.path.isdir(base_path + subdir): - temp = base_path + subdir + package_path + path_temp = os.path.join(base_path, subdir) + if not os.path.isdir(path_temp): + path_temp = path_temp.replace(os.sep + pkg_constants.PKG_TEMPLATE_BASE_DIR_NAME, '') + if os.path.isdir(path_temp): + temp = os.path.join(base_path, subdir, package_path) if os.path.isfile(temp): return temp # 3. check if given URI is valid full URL |