Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106925 - patch for dev-tex/latex2html to install.pl; better solution the problem with DESTDIR/${D} not being used everywhere duing install
Summary: patch for dev-tex/latex2html to install.pl; better solution the problem with ...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High trivial (vote)
Assignee: Text-Markup Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-22 14:04 UTC by Ed Anderson
Modified: 2006-01-26 12:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix install paths. (installpaths.patch,1.36 KB, patch)
2005-09-22 20:10 UTC, Ed Anderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Anderson 2005-09-22 14:04:08 UTC
The dev-tex/latex2html ebuild modifies {{BIN,SHLIB,LIB}DIR,TEXPATH} to get
everything installed in the sandbox properly.

	# mktexlsr is run later to avoid a sandbox violation
	sed \
		-e "/BINDIR\|LIBDIR\|SHLIBDIR\|TEXPATH/s#q'/#q'"${D}"#" \
		-e "/MKTEXLSR/s:q'.*':q'':" \
		cfgcache.pm.bak > cfgcache.pm

This messes things up though, and has to be cleaned up later:

	# clean the perl scripts up to remove references to the sandbox
	einfo "fixing sandbox references"
	einfo ${T}
	dosed "s:${T}:/tmp:g" /usr/lib/latex2html/pstoimg.pl
	dosed "s:${S}::g" /usr/lib/latex2html/latex2html.pl
	dosed "s:${T}:/tmp:g" /usr/lib/latex2html/cfgcache.pm
	dosed "s:${T}:/tmp:g" /usr/lib/latex2html/l2hconf.pm

Instead, the install script should be patched to fix the actual problem. I wrote
this patch, which needs to be applied after econf and before make install.  make
install will need to be changed to emake install.  econf should also be run with
--without-mktexlsr, instead of hacking it out of the build script.  All of the
lines I pated above can be removed.

--- latex2html-2002-2-1/config/install.pl.bak   2005-09-22 15:23:23.000000000 -0400
+++ latex2html-2002-2-1/config/install.pl       2005-09-22 15:23:52.000000000 -0400
@@ -293,13 +293,14 @@
   split(/\s+/,$cfg{'IMAGE_TYPES'}) : qw(gif);
 my $iconrx = join('|', @icon_types);

+my $destdir = ''.$ENV{'DESTDIR'};
 my $dest1 = "$cfg{'SHLIBDIR'}${dd}icons";
-if((-d $dest1 && !-w _) || (-d $cfg{'SHLIBDIR'} && !-w _)) {
+if((-d $destdir.$dest1 && !-w _) || (-d $destdir.$cfg{'SHLIBDIR'} && !-w _)) {
   print STDERR "Error: Cannot install icons in '$dest1': No write permission.\n";
   $dest1 = '';
 }
 my $dest2 = $cfg{'ICONSTORAGE'} || '';
-if(-d $dest2 && !-w $dest2) {
+if(-d $destdir.$dest2 && !-w _) {
   print STDERR "Error: Cannot install icons in '$dest2': No write permission.\n";
   $dest2 = '';
 }
@@ -371,8 +372,8 @@
 #-----------------------------------------------------------------------------
 
 if($cfg{TEXPATH}) {
-  print "\nNote: trying to install LaTeX2HTML style files in TeX directory
tree\n     ($cfg{TEXPATH})\n";
-  unless(mkpath($cfg{TEXPATH})) {
+  print "\nNote: trying to install LaTeX2HTML style files in TeX directory
tree\n     ($destdir$cfg{TEXPATH})\n";
+  unless(mkpath($destdir.$cfg{TEXPATH})) {
   #my $testpath = $cfg{TEXPATH}; # to strip (latex2)html
   #$testpath =~ s/[$dd$dd][^$dd$dd]*$//;
   #if((-d $cfg{TEXPATH} && !-w _) || (-d $testpath && !-w _)) {

Reproducible: Always
Steps to Reproduce:
Comment 1 Ed Anderson 2005-09-22 14:06:05 UTC
	cp cfgcache.pm cfgcache.pm.bak

This line would be removed too, of course, as it wouldn't modify cfgcache.pm.bak
any more. :)
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2005-09-22 14:39:46 UTC
please attach patches, do not inline
Comment 3 Ed Anderson 2005-09-22 20:10:55 UTC
Created attachment 69039 [details, diff]
patch to fix install paths.
Comment 4 Martin Ehmsen (RETIRED) gentoo-dev 2006-01-19 14:19:07 UTC
I'm no perl expert (or anything near), but as far as I can see, your patch (or at least the patch you supplied) does not do anything about the installation paths.
It does a lot of checking and stuff, but no installation paths in install.pl are altered.
I like the idea of a patch against install.pl much more than the current mess of an ebuild. But to change that we need a working patch.
Btw. if you are going to paste diff output into a patch file, then please do it properly (not breaking any lines).
Comment 5 Martin Ehmsen (RETIRED) gentoo-dev 2006-01-26 12:58:15 UTC
No reply for a week.
Feel free to reopen this bug if you can supply a working patch.