Bug 93758 - distro-install-desktop-integration uses non portable rmdir and possibly erroneous presumption of INSTALLDIRNAME
Summary: distro-install-desktop-integration uses non portable rmdir and possibly erron...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other Solaris
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-29 06:42 UTC by Richard PALO
Modified: 2017-05-06 15:26 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard PALO 2015-08-29 06:42:32 UTC
here:
>124 # we do not want some stuff from the plain packages                             
>125 if test -d $DESTDIR/opt ; then                                                  
>126     rm -f $DESTDIR/opt/$INSTALLDIRNAME                                          
>127     rmdir --ignore-fail-on-non-empty $DESTDIR/opt                               
>128 fi  

I see two issues:
1) why the presumption of the subdirectory $DESTDIR/opt?
   also, $INSTALLDIRNAME should perhaps be $INSTALLDIR in this context
2) non portable use of rmdir  (gnu rmdir)
   perhaps `rmdir -p $DESTDIR/$INSTALLDIR 2>/dev/null'
   after adapting the previous lines
Comment 1 Richard PALO 2015-08-29 06:53:38 UTC
Perhaps the intent was something like:
># we do not want some stuff from the plain packages                             
>if test -d $DESTDIR/$INSTALLDIR ; then
>	rm -rf $DESTDIR/$INSTALLDIRNAME/*
>	rmdir -p $DESTDIR/$INSTALLDIRNAME 2>/dev/null
>fi
Comment 2 Richard PALO 2015-08-29 06:54:24 UTC
Oops, wrong window copied, this is what I meant:
># we do not want some stuff from the plain packages                             
>if test -d $DESTDIR/$INSTALLDIR ; then
>	rm -f $DESTDIR/$INSTALLDIR/*
>	rmdir -p $DESTDIR/$INSTALLDIR 2>/dev/null
>fi
Comment 3 Richard PALO 2015-08-29 06:55:16 UTC
(In reply to Richard PALO from comment #2)
> Oops, wrong window copied, this is what I meant:
> ># we do not want some stuff from the plain packages                             
> >if test -d $DESTDIR/$INSTALLDIR ; then
> >	rm -f $DESTDIR/$INSTALLDIR/*
> >	rmdir -p $DESTDIR/$INSTALLDIR 2>/dev/null
> >fi

but with `rm -rf'
Comment 4 Richard PALO 2015-09-15 08:31:54 UTC
apparently the comments weren't clear to me as this is a good way to remove the install files.

let's focus on issue 2) and simply correct the rmdir invocation to
>rmdir -p $DESTDIR/$INSTALLDIR 2>/dev/null

since there is also a portability issue with mktemp in the same file,
I'll post a patch to gerrit to deal with both of these.
Comment 5 Justin L 2017-05-06 15:26:33 UTC
closing: apparently this bug was resolved by Richard PALO with https://cgit.freedesktop.org/libreoffice/core/commit/?id=b147a77f2e179f474051a4e50fa7ea300cdec8ee