From 8a013f1f16fd4730c24839127afdf46f96a45b0b Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 10 Oct 2011 11:30:17 +0200 Subject: Allow regexp for version in .appup In order to avoid duplication of upgrade instructions in .appup files, we now allow regular expressions to specify the UpFrom and DownTo versions. To be considered a regular expression, the version identifier must be specified as a binary, e.g. <<"2\\.1\\.[0-9]+">> will match versions 2.1.x, where x is any number. --- .../d_regexp_appup/lib/fe-2.1.1/ebin/fe.app | 8 +++++++ .../d_regexp_appup/lib/fe-2.1/ebin/fe.app | 8 +++++++ .../d_regexp_appup/lib/fe-3.1/ebin/fe.app | 7 ++++++ .../d_regexp_appup/lib/fe-3.1/ebin/fe.appup | 28 ++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app create mode 100644 lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app create mode 100644 lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app create mode 100644 lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup (limited to 'lib/sasl/test/systools_SUITE_data') diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app new file mode 100644 index 0000000000..c7ba1dfe91 --- /dev/null +++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app @@ -0,0 +1,8 @@ +{application, fe, + [{description, "ERICSSON NR FOR FE"}, + {vsn, "2.1.1"}, + {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]}, + {registered, []}, + {applications, []}, + {env, []}, + {start, {fe2, start, []}}]}. diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app new file mode 100644 index 0000000000..47ea248720 --- /dev/null +++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app @@ -0,0 +1,8 @@ +{application, fe, + [{description, "ERICSSON NR FOR FE"}, + {vsn, "2.1"}, + {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]}, + {registered, []}, + {applications, []}, + {env, []}, + {start, {fe2, start, []}}]}. diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app new file mode 100644 index 0000000000..0696e2494c --- /dev/null +++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app @@ -0,0 +1,7 @@ +{application, fe, + [{description, "ERICSSON NR FOR FE"}, + {vsn, "3.1"}, + {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]}, + {registered, []}, + {applications, []}, + {mod, {fe1, []}}]}. diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup new file mode 100644 index 0000000000..53d54735e5 --- /dev/null +++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.appup @@ -0,0 +1,28 @@ +%% -*- erlang -*- +%% Release upgrade script for fe (front end) +%% + +{ + "3.1", + %% Upgrade from: + [ + {<<"2\\.[0-9]+">>, % matches 2.X in full length and 2.X.Y... only partly + [{update, fe1, soft, soft_purge, soft_purge, []}, + {update, fe2, soft, soft_purge, soft_purge, [fe1]}, + {update, fe3, {advanced, extra}, soft_purge, soft_purge, [fe1, fe2]} + ]}, + {<<"2(\\.[0-9]+)+">>, % matches 2.X.Y... in full length + [{update, fe1, soft, soft_purge, soft_purge, []}, + {update, fe2, soft, soft_purge, soft_purge, [fe1]}, + {update, fe3, {advanced, extra}, soft_purge, soft_purge,[fe1, fe2]}, + restart_new_emulator]} + ], + + %% Downgrade to: + [ + {<<"2\\.[0-9]+">>, % matches 2.X in full length and 2.X.Y... only partly + [{update, fe2, soft, soft_purge, soft_purge, []}, + {update, fe3, {advanced, extra}, soft_purge, soft_purge, [fe2]} + ]} + ] +}. -- cgit v1.2.3