From b6d96250cd16b98b56ebc474aafa8696a2663b6f Mon Sep 17 00:00:00 2001 From: Gerardo Porras Date: Wed, 20 Feb 2013 14:13:58 -0800 Subject: [PATCH] getting the sorted + more logic in the patch function from stable/folsom --- anvil/components/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/anvil/components/__init__.py b/anvil/components/__init__.py index d0b09161..68d7eef6 100644 --- a/anvil/components/__init__.py +++ b/anvil/components/__init__.py @@ -130,7 +130,16 @@ class PkgInstallComponent(component.Component): def patch(self, section): what_patches = self.get_option('patches', section) (_from_uri, target_dir) = self._get_download_location() - patcher.apply_patches(what_patches, target_dir) + if not what_patches: + what_patches = [] + canon_what_patches = [] + for path in what_patches: + if sh.isdir(path): + canon_what_patches.extend(sorted(sh.listdir(path, files_only=True))) + elif sh.isfile(path): + canon_what_patches.append(path) + if canon_what_patches: + patcher.apply_patches(canon_what_patches, target_dir) def config_params(self, config_fn): mp = dict(self.params)