File: simpler-setup-module.patch

package info (click to toggle)
fusioninventory-agent 1%3A2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,492 kB
  • sloc: perl: 120,896; xml: 9,459; sh: 760; python: 26; makefile: 13
file content (42 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: minimal setup module
 Keep setup.pm a simple as possible so it is simply updated with expected paths
 during the build stage.
Author: Guillaume Bougard <gbougard@teclib.com>
Forwarded:  not-needed
Last-Update: 2018-10-08

--- fusioninventory-agent-2.4.orig/lib/setup.pm
+++ fusioninventory-agent-2.4/lib/setup.pm
@@ -5,9 +5,6 @@ use strict;
 use warnings;
 use parent qw(Exporter);
 
-use File::Spec;
-use Cwd qw(abs_path);
-
 our @EXPORT = ('%setup');
 
 our %setup = (
@@ -16,22 +13,4 @@ our %setup = (
     vardir  => './var',
 );
 
-# Compute directly libdir from this setup file as it should be installed
-# in expected directory
-eval {
-    $setup{libdir} = abs_path(File::Spec->rel2abs('..', __FILE__))
-        unless ($setup{libdir} && File::Spec->file_name_is_absolute($setup{libdir}));
-
-    # If run from sources, we can try to rebase setup keys to absolute folders related to libdir
-    if (File::Spec->file_name_is_absolute($setup{libdir})) {
-        foreach my $key (qw(datadir vardir)) {
-            # Anyway don't update if target still absolute
-            next if ($setup{$key} && File::Spec->file_name_is_absolute($setup{$key}));
-
-            my $folder = abs_path(File::Spec->rel2abs('../'.$setup{$key}, $setup{libdir}));
-            $setup{$key} = $folder if $folder && -d $folder;
-        }
-    }
-};
-
 1;