From fa196d247ff6a6b5653169ea5c856b07aadb2808 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Aug 2018 20:24:43 -0700 Subject: [PATCH] Add the ability to move certain files to dev This is useful when the package includes executables used for development but not for other cases. Signed-off-by: Thiago Macieira --- autospec/config.py | 9 +++++++-- autospec/files.py | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autospec/config.py b/autospec/config.py index fe5a04b..80bcbf1 100644 --- a/autospec/config.py +++ b/autospec/config.py @@ -696,12 +696,17 @@ def parse_config_files(path, bump, filemanager, version): content = read_conf_file(os.path.join(path, "extras")) for extra in content: - print("extras for: %s." % extra) + print("extras for : %s." % extra) filemanager.extras += content + content = read_conf_file(os.path.join(path, "dev_extras")) + for extra in content: + print("dev for : %s." % extra) + filemanager.dev_extras += content + content = read_conf_file(os.path.join(path, "setuid")) for suid in content: - print("setuid for: %s." % suid) + print("setuid for : %s." % suid) filemanager.setuid += content content = read_conf_file(os.path.join(path, "attrs")) diff --git a/autospec/files.py b/autospec/files.py index 5866fb3..a38accd 100644 --- a/autospec/files.py +++ b/autospec/files.py @@ -39,6 +39,7 @@ class FileManager(object): self.files_blacklist = set() self.excludes = [] self.extras = [] + self.dev_extras = [] self.setuid = [] self.attrs = {} self.locales = [] @@ -189,6 +190,9 @@ class FileManager(object): if filename in self.extras: self.push_package_file(filename, "extras") self.excludes.append(filename) + if filename in self.dev_extras: + self.push_package_file(filename, "dev") + self.excludes.append(filename) if filename in self.setuid: newfn = "%attr(4755, root, root) " + filename