diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-09-06 23:28:00 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-09-09 22:09:01 +0200 |
commit | 96d98bc617b5fbfac785205c73cfc4d94d29c08f (patch) | |
tree | 7638f382ad72a8862d86354ddb671824d3f673c7 /solenv | |
parent | 2e47462d076364725875e770a91a7bb6bbbec2c1 (diff) |
installer: fix handling of symbolic links in filelists so EPM is happy
also, chmodding symlinks rarely does something useful
Change-Id: Icdeb62728c3c0684d40d3a2c4d3bcb87b21bfb5a
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/installer.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/installer/filelists.pm | 36 | ||||
-rw-r--r-- | solenv/bin/modules/installer/scriptitems.pm | 6 | ||||
-rw-r--r-- | solenv/bin/modules/installer/simplepackage.pm | 5 |
4 files changed, 38 insertions, 11 deletions
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index ed54ce827cce..f88402bdfb1d 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -621,7 +621,7 @@ sub run { installer::logger::print_message( "... analyzing files with flag FILELIST ...\n" ); - $filesinproductlanguageresolvedarrayref = installer::filelists::resolve_filelist_flag($filesinproductlanguageresolvedarrayref, $ENV{'INSTDIR'}); + ($filesinproductlanguageresolvedarrayref, $unixlinksinproductarrayref) = installer::filelists::resolve_filelist_flag($filesinproductlanguageresolvedarrayref, $unixlinksinproductarrayref, $ENV{'INSTDIR'}); # packed files sometimes contain a "$" in their name: HighlightText$1.class. For epm the "$" has to be quoted by "$$" diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm index a8937755b706..8c0231a0d843 100644 --- a/solenv/bin/modules/installer/filelists.pm +++ b/solenv/bin/modules/installer/filelists.pm @@ -17,7 +17,7 @@ use installer::pathanalyzer; sub resolve_filelist_flag { - my ($files, $outdir) = @_; + my ($files, $links, $outdir) = @_; my @newfiles = (); foreach my $file (@{$files}) @@ -47,13 +47,22 @@ sub resolve_filelist_flag foreach my $path (@{$filelist}) { + my $is_symlink = 0; + if ((index $path, $outdir) != 0) { installer::logger::print_error("file '$path' is not in '$outdir'"); } - if (!-e $path) + if (-l $path) + { + $is_symlink = 1; + } + else { - installer::logger::print_error("file '$path' does not exist"); + if (!-e $path) + { + installer::logger::print_error("file '$path' does not exist"); + } } my $subpath = substr $path, ((length $outdir) + 1); # drop separator too @@ -66,13 +75,24 @@ sub resolve_filelist_flag $newfile{'filelistname'} = $file->{'Name'}; $newfile{'filelistpath'} = $file->{'sourcepath'}; - if ($use_internal_rights) + if ($is_symlink) { - my $st = stat($path); - $newfile{'UnixRights'} = sprintf("%o", $st->mode & 0777); + # FIXME: for symlinks destination is mangled later in + # get_Destination_Directory_For_Item_From_Directorylist + $newfile{'DoNotMessWithSymlinks'} = 1; + $newfile{'Target'} = readlink($path); + push @links, \%newfile; } + else + { + if ($use_internal_rights) + { + my $st = stat($path); + $newfile{'UnixRights'} = sprintf("%o", $st->mode & 0777); + } - push @newfiles, \%newfile; + push @newfiles, \%newfile; + } } } else @@ -86,7 +106,7 @@ sub resolve_filelist_flag } } - return \@newfiles; + return (\@newfiles, \@links); } sub read_filelist diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index b22391d086f2..71f974ee1bf5 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -869,7 +869,11 @@ sub get_Destination_Directory_For_Item_From_Directorylist # this is used f my $destfilename; - if ((!( $ispredefinedprogdir )) && (!( $ispredefinedconfigdir ))) + if ($oneitem->{'DoNotMessWithSymlinks'}) + { + $destfilename = $oneitem->{'Name'}; + } + elsif ((!( $ispredefinedprogdir )) && (!( $ispredefinedconfigdir ))) { my $directorynameref = get_Directoryname_From_Directorygid($dirsarrayref, $searchdirgid, $onelanguage, $oneitemgid); $destfilename = $$directorynameref . $installer::globals::separator . $oneitemname; diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index 5f9433fd0aaa..71e10d44e372 100644 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -611,7 +611,10 @@ sub create_simple_package # see issue 102274 if ( $onefile->{'UnixRights'} ) { - chmod oct($onefile->{'UnixRights'}), $destination; + if ( ! -l $destination ) # that would be rather pointless + { + chmod oct($onefile->{'UnixRights'}), $destination; + } } } } |