job000018 | InstallInto dependency and chmod problems (rmg 3/20/2002:) | From: "EXT-Good...son, Stephen" <stephen.goodson@boeing.com> | To: "'rmg@perforce.com'" <rmg@perforce.com> | Subject: Jam bug in InstallInto | Date: Tue, 19 Mar 2002 21:04:41 -0800 | MIME-Version: 1.0 | X-Mailer: Internet Mail Service (5.5.2650.21) | Content-Type: text/plain; | charset="ISO-8859-1" | | Hi, | | I'm not a perforce user (yet), so I hope it's ok if I send you a bug fix | directly rather than into the public depot. | | There are two problems with the InstallInto rule when it is invoked | with multiple targets. | - The DEPENDS rule makes all installed targets depend on all sources. Each | installed target should depend only on the corresponding source target. | - Because Chmod is invoked on all targets at once, the single Chmod action | can occur before all of the individual Install actions have occurred, | which causes it to fail. | The fix is to move both inside the for loop. | | Another change I've made is to use $(INSTALL_GRIST) instead of the | hard-coded "install". It was necessary for our project, and seems to | be in the spirit of jam, so I hope you'll consider that change too. I | don't think it should affect any existing Jamfiles, unless someone happened | to use the INSTALL_GRIST variable for something else. This change | would need to be made elsewhere in Jambase too. | | Steve | | | +INSTALL_GRIST = installed ; | + | rule InstallInto | { | local i t ; | | - t = $(>:G=installed) ; | + t = $(>:G=$(INSTALL_GRIST)) ; | | DEPENDS install : $(t) ; | - DEPENDS $(t) : $(>) ; | SEARCH on $(>) = $(SEARCH_SOURCE) ; | MakeLocate $(t) : $(<) ; | | # Arrange for jam uninstall | | Clean uninstall : $(t) ; | | for i in $(>) | { | - Install $(i:G=installed) : $(i) ; | + DEPENDS $(i:G=$(INSTALL_GRIST)) : $(i) ; | + Install $(i:G=$(INSTALL_GRIST)) : $(i) ; | + Chmod $(i:G=$(INSTALL_GRIST)) ; | } | | - Chmod $(t) ; | - | if $(UNIX) | { | if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; } | if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; } | } | } | | « | |
Add Job |