/[smecontribs]/rpms/smeserver-durep/contribs10/smeserver-durep-1.5.0-Add-creatlinks-to-alter-link-to-wrapper.patch
ViewVC logotype

Contents of /rpms/smeserver-durep/contribs10/smeserver-durep-1.5.0-Add-creatlinks-to-alter-link-to-wrapper.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Oct 23 11:45:25 2020 UTC (4 years ago) by brianr
Branch: MAIN
CVS Tags: smeserver-durep-1_5_0-17_el7_sme, smeserver-durep-1_5_0-9_el7_sme, smeserver-durep-1_5_0-11_el7_sme, smeserver-durep-1_5_0-14_el7_sme, smeserver-durep-1_5_0-13_el7_sme, smeserver-durep-1_5_0-16_el7_sme, smeserver-durep-1_5_0-10_el7_sme, smeserver-durep-1_5_0-7_el7_sme, smeserver-durep-1_5_0-5_el7_sme, smeserver-durep-1_5_0-15_el7_sme, smeserver-durep-1_5_0-6_el7_sme, smeserver-durep-1_5_0-12_el7_sme, smeserver-durep-1_5_0-8_el7_sme, HEAD
* Fri Oct 23 2020 Brian Read <brianr@bjsystems.co.uk> 1.5.0-5.sme
- Initial import to SME10 tree [SME: 10893]
- Add in link to wrapper in createlinks

1 diff -urN smeserver-durep-1.5.0.old/createlinks smeserver-durep-1.5.0/createlinks
2 --- smeserver-durep-1.5.0.old/createlinks 1970-01-01 01:00:00.000000000 +0100
3 +++ smeserver-durep-1.5.0/createlinks 2020-10-23 12:03:51.203051620 +0100
4 @@ -0,0 +1,61 @@
5 +#!/usr/bin/perl -w
6 +# This script creates the symlinks needed by this RPM
7 +# Specific support exists to create symlinks within e-smith web "panels"
8 +# and for links from named "events" directories into the "actions" directory
9 +
10 +sub panel_link
11 +{
12 + my ($function, $panel) = @_;
13 +
14 + unlink "root/etc/e-smith/web/panels/$panel/cgi-bin/$function";
15 + symlink("../../../functions/$function",
16 + "root/etc/e-smith/web/panels/$panel/cgi-bin/$function")
17 + or die "Can't symlink to root/etc/e-smith/web/panels/$panel".
18 + "/cgi-bin/$function: $!";
19 +}
20 +
21 +sub safe_symlink {
22 + my ($from, $to) = @_;
23 + use File::Basename;
24 + use File::Path;
25 + mkpath(dirname($to));
26 + unlink($to);
27 + symlink($from, $to) or die "Can't create symlink from $from to $to: $!";
28 +}
29 +
30 +sub event_link
31 +{
32 + my ($action, $event, $level) = @_;
33 +
34 + unlink "root/etc/e-smith/events/${event}/S${level}${action}";
35 + symlink("../actions/${action}",
36 + "root/etc/e-smith/events/${event}/S${level}${action}")
37 + or die "Can't symlink to " .
38 + "root/etc/e-smith/events/${event}/S${level}${action}: $!";
39 +}
40 +
41 +#--------------------------------------------------
42 +# functions for manager panel
43 +#--------------------------------------------------
44 +my $panel = "manager";
45 +
46 +#panel_link("function1", $panel);
47 +#panel_link("function2", $panel);
48 +
49 +#--------------------------------------------------
50 +# actions for console-save event:
51 +#--------------------------------------------------
52 +$event = "console-save";
53 +
54 +#event_link("action1", $event, "55");
55 +#event_link("action2", $event, "60");
56 +
57 +#--------------------------------------------------
58 +# actions for domain-create event:
59 +#--------------------------------------------------
60 +$event = "domain-create";
61 +
62 +#event_link("action1", $event, "55");
63 +#event_link("action2", $event, "90");
64 +
65 +safe_symlink("/etc/e-smith/web/functions/wrapper","root/etc/e-smith/web/panels/manager/cgi-bin/durep");

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed