diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2018-02-12 12:35:47 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-02-18 02:23:19 +0100 |
commit | bcc5790554f02d65b03eebcc47fb8859fcf44643 (patch) | |
tree | f46fee86652882c0cd3882c79e0a4b5afbbb2b25 /solenv/bin/modules | |
parent | 10496770a6c4ba870787f20a4f0948c30e3d59cd (diff) |
tdf#115554: Use 'fakeroot' to build Debian packages
The command to create Debian packages must be run
as root or faked to be run as root.
The 'fakeroot' makes sure the command is run in an environment
faking root privileges for file manipulation.
This makes sure that file ownerships and permissions inside the
created deb packages are correct.
Using fakeroot instead of the custom "libgetuid" makes it
unnecessary to care about internals of the underlying tools
(like tar) and changes in those by ourselves.
Change-Id: I2cbb203ab84f740377e535c1051c2b879779b164
Reviewed-on: https://gerrit.libreoffice.org/49597
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'solenv/bin/modules')
-rw-r--r-- | solenv/bin/modules/installer/epmfile.pm | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm index eabab4cd05ae..bc6a76ccf44d 100644 --- a/solenv/bin/modules/installer/epmfile.pm +++ b/solenv/bin/modules/installer/epmfile.pm @@ -789,17 +789,6 @@ sub set_patch_state } ################################################# -# LD_PRELOAD string for Debian packages -################################################# - -sub get_ld_preload_string -{ - my $getuidlibrary = $ENV{'WORKDIR'} . '/LinkTarget/Library/libgetuid.so'; - if ( ! -e $getuidlibrary ) { installer::exiter::exit_program("File $getuidlibrary does not exist!", "get_ld_preload_string"); } - return 'LD_PRELOAD=' . $getuidlibrary; -} - -################################################# # Calling epm to create the installation sets ################################################# @@ -818,11 +807,11 @@ sub call_epm my $outdirstring = ""; if ( $installer::globals::epmoutpath ne "" ) { $outdirstring = " --output-dir $installer::globals::epmoutpath"; } - # Debian package build needs a LD_PRELOAD for correct rights + # Debian package build needs to be run with fakeroot for correct ownerships/permissions - my $ldpreloadstring = ""; + my $fakerootstring = ""; - if ( $installer::globals::debian ) { $ldpreloadstring = get_ld_preload_string($includepatharrayref) . " "; } + if ( $installer::globals::debian ) { $fakerootstring = "fakeroot "; } my $extraflags = ""; if ($ENV{'EPM_FLAGS'}) { $extraflags = $ENV{'EPM_FLAGS'}; } @@ -832,7 +821,7 @@ sub call_epm my $verboseflag = "-v"; if ( ! $installer::globals::quiet ) { $verboseflag = "-v2"; }; - my $systemcall = $ldpreloadstring . $epmname . " -f " . $packageformat . " " . $extraflags . " " . $localpackagename . " " . $epmlistfilename . $outdirstring . " " . $verboseflag . " " . " 2\>\&1 |"; + my $systemcall = $fakerootstring . $epmname . " -f " . $packageformat . " " . $extraflags . " " . $localpackagename . " " . $epmlistfilename . $outdirstring . " " . $verboseflag . " " . " 2\>\&1 |"; installer::logger::print_message( "... $systemcall ...\n" ); |