Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-12-18
01:23 • Closed ticket [2429444fff]: install-doc target removes all mann manual pages... artifact: 032d8b9806 user: stwo
2009-03-19
01:44 • Ticket [2429444fff]: 4 changes artifact: bfc0f3de24 user: andreas_kupries
01:43 • Open ticket [2429444fff]. artifact: fd320d4e1b user: andreas_kupries
01:42 • Closed ticket [2429444fff]. artifact: e8a61aa1a2 user: stwo
2008-12-15
04:29 • Ticket [2429444fff]: 6 changes artifact: e4916159d3 user: ferrieux
04:26 • Ticket [2429444fff]: 2 changes artifact: ace513c7d0 user: dgp
2008-12-14
21:20 • New ticket [2429444fff]. artifact: 37f157207f user: nobody

install-doc target removes all mann manual pages

Closed / Fixed2429444fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 16 years ago
Descriptionplain2008-12-14 21:20:49
When the doc directory doesn't exist in some TEA packages I've found that: sudo make install;  causes the default Makefile.in to remove all of /usr/local/man/mann.

Apparently the problem according to ferrieux is that the * expands to itself in the case of no match.

In one case it was tkpath removing my mann files, and in another case (on another machine) it was another package, though I'm not sure which yet.

A suggested solution (from ferrieux) is to check with a branch for * after the expansion was supposed to be done, if I understand correctly.
dgp Ticket [2429444fff]: 2 changes [History diff]2008-12-15 04:26:18
ferrieuxplain2008-12-15 04:29:19
Yes. To elaborate, the bug is in the install-doc target which does

  list='$(srcdir)/doc/*.n'; for i in $$list; do
  ...
  rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \

Hence if $srcdir/doc is empty of any *.n, then the 'list' var is set to a path having a literal star in its [file tail].
It gets iterated over by 'for' as a single-element list, hence 'i' gets the same value, and 'basename' still extracts the star.
This results in

  rm -f $(DESTDIR)$(mandir)/mann/*.n

which is unfortunate ;-)
As suggested on the chat with George, there are generic ways to detect no-matches in shell (like looking for the naked star).
But here it might be wiser to avoid the rm in the first place. Why is it there ? (it is followed by INSTALL_DATA which could well overwrite files)...
stwoplain2009-03-19 01:42:52
allow_comments - 1

Removed offending 'rm -f' line.
andreas_kupriesplain2009-03-19 01:43:28
allow_comments - 0

Hm. Actually I believe the INSTALLDIR can fail to write over an existing file, if the permissions make it non-writable and the 'cp' has no force option. Which may not be portable. In that case the 'rm -f' ensures that the file is gone even if non-writable, without asking, as long as we have permission to write to the directory.
andreas_kupriesplain2009-03-19 01:44:46
s/INSTALLDIR/INSTALL_DATA/
stwoplain2010-12-18 01:23:26
Re INSTALL_DATA failing:
This isn't much of a problem and shouldn't be a problem with the newer 'install-sh' and may not have even been a problem with the older 'install-sh' and there have been no complaints since the change, so I'm closing it. If it's still a problem for someone then let them speak up; better this fix than wiping directories.
Log in (anonymous is fine) to add a comment.