From 4eaf2877929e4b13955698c517f996f6da8efeeb Mon Sep 17 00:00:00 2001 From: Tom Cinbis Date: Thu, 21 Mar 2019 10:52:25 +0100 Subject: [PATCH 1/7] Modified geneious download recipe to support latest version (2019) Because the download url for Geneious Prime slightly diverges from the information found in the versions.txt an additional RegexReplace Processor is required. With the modified download recipe both version (20 and 2019) can be downloaded by modifiying the input variables. --- Geneious/Geneious.download.recipe | 15 +++++++- Geneious/RegexReplace.py | 60 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 Geneious/RegexReplace.py diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index f50bcc926..0370d0fdc 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -35,6 +35,19 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion %MAJOR_VERSION% %RELEASE% %RELEASE%.*(Geneious.*mac.*dmg) + + Processor + RegexReplace + Arguments + + replace_pattern + - + source_string + %match% + replace_string + _ + + Processor URLDownloader @@ -54,7 +67,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion Arguments input_path - %pathname%/Geneious.app + %pathname%/%NAME%.app requirement identifier "com.biomatters.Geneious" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "3BTDDQD3L6" diff --git a/Geneious/RegexReplace.py b/Geneious/RegexReplace.py new file mode 100644 index 000000000..d3673c996 --- /dev/null +++ b/Geneious/RegexReplace.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +from autopkglib import Processor, ProcessorError +import re + +__all__ = ["RegexReplace"] + + +class RegexReplace(Processor): + '''Replaces all occurrences of a given pattern in the passed string.''' + + input_variables = { + 'replace_pattern': { + 'description': 'Regular expression (Python) to match against string.', + 'required': True, + }, + 'source_string': { + 'description': 'String to use for matching.', + 'required': True, + }, + 'replace_string': { + 'description': 'String to use for replacing matches.', + 'required': True, + }, + 'replace_count': { + 'description': ('Count how many occurrences should be replaced,' + 'starting from the left most match in "source_string"'), + 'required': False, + 'default': 0 + }, + 'result_output_var_name': { + 'description': ('The name of the output variable that is returned ' + 'by the replace. If not specified then a default of ' + '"replaced_string" will be used.'), + 'required': False, + 'default': 'replaced_string', + }, + } + output_variables = { + 'result_output_var_name': { + 'description': ( + 'The string with all occurrences of re_pattern replaced with' + 'replace_string. Note the actual name of variable depends on the input ' + 'variable "result_output_var_name" or is assigned a default of ' + '"replaced_string."') + } + } + + def main(self): + output_var_name = self.env['result_output_var_name'] + self.output_variables = {} + self.env[output_var_name] = re.sub(self.env['replace_pattern'], self.env['replace_string'], + self.env['source_string'], + self.env['replace_count']) + self.output_variables[output_var_name] = {'description': 'String with replacements.'} + + +if __name__ == '__main__': + PROCESSOR = RegexReplace() + PROCESSOR.execute_shell() From dadf079111998411fa8c0b4da7c1e36b43731989 Mon Sep 17 00:00:00 2001 From: Tom Cinbis Date: Mon, 8 Apr 2019 11:26:16 +0200 Subject: [PATCH 2/7] Introduced APPNAME variable to fix code signature for Geneious --- Geneious/Geneious.download.recipe | 4 +++- Geneious/Geneious.munki.recipe | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index 0370d0fdc..705625ebc 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -13,6 +13,8 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion NAME Geneious + APPNAME + Geneious MAJOR_VERSION 10 RELEASE @@ -67,7 +69,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion Arguments input_path - %pathname%/%NAME%.app + %pathname%/%APPNAME%.app requirement identifier "com.biomatters.Geneious" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "3BTDDQD3L6" diff --git a/Geneious/Geneious.munki.recipe b/Geneious/Geneious.munki.recipe index a2ea95070..c738b7300 100644 --- a/Geneious/Geneious.munki.recipe +++ b/Geneious/Geneious.munki.recipe @@ -16,6 +16,8 @@ NOTE: R6,7,8 requires Java 6. See https://support.geneious.com/entries/22070732- apps/Geneious NAME Geneious + APPNAME + Geneious MUNKI_CATEGORY Math & Science pkginfo From ea401cd0ade9c3f837baf97f354854e8847600c9 Mon Sep 17 00:00:00 2001 From: Tom Cinbis Date: Mon, 29 Apr 2019 09:04:05 +0200 Subject: [PATCH 3/7] Removed %APPNAME% variable from Geneious download and used wildcard instead --- Geneious/Geneious.download.recipe | 4 +--- Geneious/Geneious.munki.recipe | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index 705625ebc..a6173a0a4 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -13,8 +13,6 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion NAME Geneious - APPNAME - Geneious MAJOR_VERSION 10 RELEASE @@ -69,7 +67,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion Arguments input_path - %pathname%/%APPNAME%.app + %pathname%/Geneious*.app requirement identifier "com.biomatters.Geneious" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "3BTDDQD3L6" diff --git a/Geneious/Geneious.munki.recipe b/Geneious/Geneious.munki.recipe index c738b7300..a2ea95070 100644 --- a/Geneious/Geneious.munki.recipe +++ b/Geneious/Geneious.munki.recipe @@ -16,8 +16,6 @@ NOTE: R6,7,8 requires Java 6. See https://support.geneious.com/entries/22070732- apps/Geneious NAME Geneious - APPNAME - Geneious MUNKI_CATEGORY Math & Science pkginfo From 831f3bb8044dd18dbcaa7fafd7fe79f51ab6d72d Mon Sep 17 00:00:00 2001 From: Tom Cinbis Date: Mon, 1 Jul 2019 11:50:29 +0200 Subject: [PATCH 4/7] Set MAJOR_VERSION to 2019 instead of 10 --- Geneious/Geneious.download.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index a6173a0a4..52347ef02 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -14,7 +14,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion NAME Geneious MAJOR_VERSION - 10 + 2019 RELEASE release VERSIONS_URL From 2660449774c6588bee92fb5ff7290e3e5ca6ae21 Mon Sep 17 00:00:00 2001 From: Tom Cinbis Date: Mon, 1 Jul 2019 15:02:26 +0200 Subject: [PATCH 5/7] Moved RegexReplace processor to shared processors --- {Geneious => SharedProcessors}/RegexReplace.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {Geneious => SharedProcessors}/RegexReplace.py (100%) mode change 100644 => 100755 diff --git a/Geneious/RegexReplace.py b/SharedProcessors/RegexReplace.py old mode 100644 new mode 100755 similarity index 100% rename from Geneious/RegexReplace.py rename to SharedProcessors/RegexReplace.py From f459df9afd791b59c977393c47adae8e01724100 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Wed, 30 Sep 2020 15:42:51 +0200 Subject: [PATCH 6/7] change path to the Processor --- Geneious/Geneious.download.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index 52347ef02..f54560462 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -37,7 +37,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion Processor - RegexReplace + com.github.n8felton.shared/RegexReplace Arguments replace_pattern From 0f10ba5cd75dd832e4dc083a623897089f867e9d Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Wed, 30 Sep 2020 15:43:31 +0200 Subject: [PATCH 7/7] Change Major Version to 2020 --- Geneious/Geneious.download.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geneious/Geneious.download.recipe b/Geneious/Geneious.download.recipe index f54560462..615963099 100644 --- a/Geneious/Geneious.download.recipe +++ b/Geneious/Geneious.download.recipe @@ -14,7 +14,7 @@ See http://desktop-links.geneious.com/assets/installers/geneious/GeneiousVersion NAME Geneious MAJOR_VERSION - 2019 + 2020 RELEASE release VERSIONS_URL