[opensuse-packaging] "cd" commands for generating Makefiles render them invalid
Hi, from time to time, some of my rpmbuilds bail out during "make" run, which boil down to Makefiles created on the fly with commands containing "cd", because that echos the new path into the generated Makefile, rendering it invalid. E.g.: (excerpt from hylafax/man/Makefile.in) cman.apps/Makefile: ${DEPTH}/defs cman.apps ${MANCAPP} ${RM} -f cman.apps/Makefile (${ECHO} '#!smake'; \ ${ECHO} 'DEPTH=../..'; \ ${ECHO} '@MAKEINCLUDE@ @MAKELQUOTE@$${DEPTH}/defs@MAKERQUOTE@';\ ${ECHO} 'install:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${INSTALL} -m 444 -root $${INSTALLROOT} -F $${MAN}/$${MANAPPS} \ -idb $${PRODUCT}.man.client -src' "$$i" '-O' "$$f"; \ done); \ ${ECHO}; \ ${ECHO} 'uninstall:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${RM} -f $${MAN}/$${MANAPPS}/'"$$f"; \ done) \ )>cman.apps/Makefile Since similar sequences can be found in the other packages as well. I wonder, why I suffer from this occasionally, but most of you seemingly not. Before I start digging into the bash source, I thought, I try to get some expert advice. Does that issue rings a bell for anybody? TIA, Pete [openSUSE 10.2, bash environment tweaked, but it's still bash] --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi Hans-Peter, Le vendredi 14 décembre 2007, Hans-Peter Jansen a écrit :
Hi,
from time to time, some of my rpmbuilds bail out during "make" run, which boil down to Makefiles created on the fly with commands containing "cd", because that echos the new path into the generated Makefile, rendering it invalid.
E.g.: (excerpt from hylafax/man/Makefile.in)
cman.apps/Makefile: ${DEPTH}/defs cman.apps ${MANCAPP} ${RM} -f cman.apps/Makefile (${ECHO} '#!smake'; \ ${ECHO} 'DEPTH=../..'; \ ${ECHO} '@MAKEINCLUDE@ @MAKELQUOTE@$${DEPTH}/defs@MAKERQUOTE@';\ ${ECHO} 'install:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${INSTALL} -m 444 -root $${INSTALLROOT} -F $${MAN}/$${MANAPPS} \ -idb $${PRODUCT}.man.client -src' "$$i" '-O' "$$f"; \ done); \ ${ECHO}; \ ${ECHO} 'uninstall:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${RM} -f $${MAN}/$${MANAPPS}/'"$$f"; \ done) \ )>cman.apps/Makefile
Since similar sequences can be found in the other packages as well. I wonder, why I suffer from this occasionally, but most of you seemingly not. Before I start digging into the bash source, I thought, I try to get some expert advice.
Does that issue rings a bell for anybody?
"cd" doesn't echo anything by itself. Do you have an alias that does it for you maybe? -- Jean Delvare Suse L3 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi Jean, thanks for your answer, comments inlined below. Am Freitag, 14. Dezember 2007 schrieb Jean Delvare:
Hi Hans-Peter,
Le vendredi 14 décembre 2007, Hans-Peter Jansen a écrit :
Hi,
from time to time, some of my rpmbuilds bail out during "make" run, which boil down to Makefiles created on the fly with commands containing "cd", because that echos the new path into the generated Makefile, rendering it invalid.
E.g.: (excerpt from hylafax/man/Makefile.in)
cman.apps/Makefile: ${DEPTH}/defs cman.apps ${MANCAPP} ${RM} -f cman.apps/Makefile (${ECHO} '#!smake'; \ ${ECHO} 'DEPTH=../..'; \ ${ECHO} '@MAKEINCLUDE@ @MAKELQUOTE@$${DEPTH}/defs@MAKERQUOTE@';\ ${ECHO} 'install:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${INSTALL} -m 444 -root $${INSTALLROOT} -F $${MAN}/$${MANAPPS} \ -idb $${PRODUCT}.man.client -src' "$$i" '-O' "$$f"; \ done); \ ${ECHO}; \ ${ECHO} 'uninstall:'; \ (cd cman.apps; for i in *.1; do \ f=${MANCAPPNAME}; \ ${ECHO} ' $${RM} -f $${MAN}/$${MANAPPS}/'"$$f"; \ done) \ )>cman.apps/Makefile
Since similar sequences can be found in the other packages as well. I wonder, why I suffer from this occasionally, but most of you seemingly not. Before I start digging into the bash source, I thought, I try to get some expert advice.
Does that issue rings a bell for anybody?
"cd" doesn't echo anything by itself. Do you have an alias that does it for you maybe?
Unfortunately not: ~> alias cd bash: alias: cd: not found ~> env | grep CD CDPATH=.:~:/usr:/mnt That was the culprit. Unsetting it did the trick. Will take the minor loss in convenience by jettisoning it. Such a strong side effect should be documented in bash man file, or even better, fixed in code, me thinks. Pete --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le vendredi 14 décembre 2007, Hans-Peter Jansen a écrit :
Am Freitag, 14. Dezember 2007 schrieb Jean Delvare:
"cd" doesn't echo anything by itself. Do you have an alias that does it for you maybe?
Unfortunately not:
~> alias cd bash: alias: cd: not found
~> env | grep CD CDPATH=.:~:/usr:/mnt
That was the culprit. Unsetting it did the trick. Will take the minor loss in convenience by jettisoning it.
Ah, I didn't know about this mechanism, thanks for the info ;)
Such a strong side effect should be documented in bash man file, or even better, fixed in code, me thinks.
Well, it works as designed as far as I can tell, so there's probably not much to fix at the bash level. The code that generates the Makefiles could be easily fixed though, by either unsetting CDPATH or redirecting the output of cd to /dev/null. -- Jean Delvare Suse L3 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Fri, Dec 14, 2007 at 02:18:17PM +0100, Jean Delvare wrote:
Le vendredi 14 décembre 2007, Hans-Peter Jansen a écrit :
Such a strong side effect should be documented in bash man file, or even better, fixed in code, me thinks.
Well, it works as designed as far as I can tell, so there's probably not much to fix at the bash level. The code that generates the Makefiles could be easily fixed though, by either unsetting CDPATH or redirecting the output of cd to /dev/null.
Yes, for example "configure" generated by autoconf unsets CDPATH. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Freitag, 14. Dezember 2007 schrieb Martin Vidner:
On Fri, Dec 14, 2007 at 02:18:17PM +0100, Jean Delvare wrote:
Le vendredi 14 décembre 2007, Hans-Peter Jansen a écrit :
Such a strong side effect should be documented in bash man file, or even better, fixed in code, me thinks.
Well, it works as designed as far as I can tell, so there's probably not much to fix at the bash level. The code that generates the Makefiles could be easily fixed though, by either unsetting CDPATH or redirecting the output of cd to /dev/null.
Yes, for example "configure" generated by autoconf unsets CDPATH.
Thus, it looks like a more famous problem then I thought, it would. How about unsetting it somewhere inside rpmbuild. It doesn't supply a sensible feature for package builds anyway, but more potential for strange effects.. Pete --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 2007-12-14 13:58:17 +0100, Hans-Peter Jansen wrote:
~> env | grep CD CDPATH=.:~:/usr:/mnt
That was the culprit. Unsetting it did the trick. Will take the minor loss in convenience by jettisoning it.
build inside a chroot. that variable should be unset inside. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hans-Peter Jansen wrote:
~> env | grep CD CDPATH=.:~:/usr:/mnt
That was the culprit. Unsetting it did the trick. Will take the minor loss in convenience by jettisoning it.
Such a strong side effect should be documented in bash man file
It's already there: cd [-L|-P] [dir] ... If a non- empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (5)
-
Hans-Peter Jansen
-
Jean Delvare
-
Marcus Rueckert
-
Martin Vidner
-
Michal Marek