Very true! I completely agree with you.
I've attached the patch with the changes (both for the "rm -rf ..." of the LVM_DIR and the lvm links creation) made from the cvs source.
dann frazier wrote:
On Mon, 2005-01-17 at 15:05 -0800, [EMAIL PROTECTED] wrote:
@@ -488,6 +491,19 @@
ifdef MKXFS_BINARY
install -m 755 --strip $(MKXFS_BINARY) $(BOEL_BINARIES_DIR)/sbin/
endif
+ #
+ # 2005-01-12 Andrea Righi
+ # + install -m 755 --strip $(LVM_BINARY) $(BOEL_BINARIES_DIR)/sbin/
+ #
+ # Create LVM symlinks to lvm binary
+ #
+ @( \
+ for v in `cat $(SRC_DIR)/$(LVM_DIR)/tools/.commands`; do \
+ cd $(BOEL_BINARIES_DIR)/sbin; \
+ ln -s -f lvm $$v; \
+ done; \
+ )
Thanks Andrea - a few comments...
The cd dir definition is static - why cd there N times when once will
do? Also, if the cd fails then this command will go right along
creating symlinks in $PWD - the semicolon hides the error from make.
And why hide the output w/ the @ modifier? If there's a problem it'd be good to see what was executing at the time. And finally, why do it in a separate subshell (the parens)?
Something like the following looks better to me:
cd $(BOEL_BINARIES)/sbin && for ...; do \
ln -s -f ...; \
done
It still hides ln error codes from make - it might even be better to do something like the following:
$(foreach, binary,$(shell cat $(SRC_DIR)/$(LVM_DIR)/tools/.commands),ln -sf lvm $(binary) && ) && /bin/true
(examples here aren't tested, just for illustration purposes)
-- Andrea Righi System Management Group - CINECA - http://www.cineca.it Via Magnanelli 6/3 40033 Casalecchio di Reno (BO) - Italy e-mail: [EMAIL PROTECTED]
--- Makefile~ 2005-01-18 16:07:09.042341896 +0100 +++ Makefile 2005-01-18 16:07:57.666949832 +0100 @@ -492,18 +492,13 @@ install -m 755 --strip $(MKXFS_BINARY) $(BOEL_BINARIES_DIR)/sbin/ endif # - # 2005-01-12 Andrea Righi + # 2005-01-18 Andrea Righi # install -m 755 --strip $(LVM_BINARY) $(BOEL_BINARIES_DIR)/sbin/ # # Create LVM symlinks to lvm binary # - @( \ - for v in `cat $(SRC_DIR)/$(LVM_DIR)/tools/.commands`; do \ - cd $(BOEL_BINARIES_DIR)/sbin; \ - ln -s -f lvm $$v; \ - done; \ - ) + cd $(BOEL_BINARIES_DIR)/sbin && $(foreach binary,$(shell cat $(SRC_DIR)/$(LVM_DIR)/tools/.commands),ln -s -f lvm $(binary) && ) /bin/true mkdir -m 755 -p $(BOEL_BINARIES_DIR)/lib test ! -d /lib64 || mkdir -m 755 -p $(BOEL_BINARIES_DIR)/lib64 --- make.d/lvm.rul~ 2005-01-18 00:02:05.000000000 +0100 +++ make.d/lvm.rul 2005-01-18 16:58:04.264877472 +0100 @@ -7,16 +7,17 @@ LVM_VERSION := 2.2.00.32 LVM_DIR := LVM$(LVM_VERSION) LVM_TARBALL := LVM2.2.00.32.tgz -LVM_URL := ftp://sources.redhat.com/pub/lvm2/$(LVM_TARBALL) +LVM_URL := ftp://sources.redhat.com/pub/lvm2/old/$(LVM_TARBALL) LVM_BINARY := $(SRC_DIR)/$(LVM_DIR)/tools/lvm PHONY += lvm lvm: $(LVM_BINARY) $(LVM_BINARY): $(SRC_DIR)/$(LVM_TARBALL) - [ -d $(SRC_DIR)/$(LVM_DIR) ] || ( cd $(SRC_DIR) && tar -xvzf $(LVM_TARBALL) ) - @cd $(SRC_DIR)/$(LVM_DIR) && \ + rm -rf $(SRC_DIR)/$(LVM_DIR) + cd $(SRC_DIR) && tar -xvzf $(LVM_TARBALL) + cd $(SRC_DIR)/$(LVM_DIR) && \ ./configure --prefix=/usr --disable-nls --with-optimisation=-Os - @$(MAKE) -C $(SRC_DIR)/$(LVM_DIR) + $(MAKE) -C $(SRC_DIR)/$(LVM_DIR) $(SRC_DIR)/$(LVM_TARBALL): [ -d $(SRC_DIR) ] || mkdir -p $(SRC_DIR)