* [PATCH] udev-009: Allow build with empty EXTRAS
@ 2003-12-17 3:04 Adam Kropelin
2003-12-17 8:31 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Adam Kropelin @ 2003-12-17 3:04 UTC (permalink / raw)
To: greg; +Cc: linux-hotplug-devel, linux-kernel
Need to let the shell expand $EXTRAS so it can properly detect an empty
list. Without this patch, the build fails whenever $EXTRAS is empty.
--Adam
--- udev-009/Makefile Tue Dec 16 19:30:32 2003
+++ udev-009-adk/Makefile Tue Dec 16 21:47:49 2003
@@ -145,7 +145,7 @@
CFLAGS += -I$(PWD)/libsysfs
all: $(ROOT)
- @for target in $(EXTRAS) ; do \
+ @extras="$(EXTRAS)" ; for target in $$extras ; do \
echo $$target ; \
$(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
-C $$target $@ ; \
@@ -223,7 +223,7 @@
| xargs rm -f
-rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS)
$(MAKE) -C klibc clean
- @for target in $(EXTRAS) ; do \
+ @extras="$(EXTRAS)" ; for target in $$extras ; do \
echo $$target ; \
$(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
-C $$target $@ ; \
@@ -286,7 +286,7 @@
$(INSTALL_DATA) udev.permissions $(DESTDIR)$(configdir)
- rm -f $(DESTDIR)$(hotplugdir)/udev.hotplug
- ln -s $(sbindir)/$(ROOT) $(DESTDIR)$(hotplugdir)/udev.hotplug
- @for target in $(EXTRAS) ; do \
+ @extras="$(EXTRAS)" ; for target in $$extras ; do \
echo $$target ; \
$(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
-C $$target $@ ; \
@@ -303,7 +303,7 @@
- rmdir $(hotplugdir)
- rmdir $(configdir)
- rmdir $(udevdir)
- @for target in $(EXTRAS) ; do \
+ @extras="$(EXTRAS)" ; for target in $$extras ; do \
echo $$target ; \
$(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
-C $$target $@ ; \
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] udev-009: Allow build with empty EXTRAS
2003-12-17 3:04 [PATCH] udev-009: Allow build with empty EXTRAS Adam Kropelin
@ 2003-12-17 8:31 ` Greg KH
2003-12-17 16:11 ` Adam Kropelin
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-12-17 8:31 UTC (permalink / raw)
To: Adam Kropelin; +Cc: linux-hotplug-devel, linux-kernel
On Tue, Dec 16, 2003 at 10:04:06PM -0500, Adam Kropelin wrote:
> Need to let the shell expand $EXTRAS so it can properly detect an empty
> list. Without this patch, the build fails whenever $EXTRAS is empty.
$ export EXTRAS=
$ make
$ set | grep EXTRA
EXTRAS=
$
I can't duplicate this problem at all. Someone else once reported it on
the linux-hotplug-devel list, with much the same fix up patch, but later
said they couldn't reproduce it either.
What version of make are you using?
works for me :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] udev-009: Allow build with empty EXTRAS
2003-12-17 8:31 ` Greg KH
@ 2003-12-17 16:11 ` Adam Kropelin
2003-12-17 18:34 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Adam Kropelin @ 2003-12-17 16:11 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel
On Wed, Dec 17, 2003 at 12:31:00AM -0800, Greg KH wrote:
> On Tue, Dec 16, 2003 at 10:04:06PM -0500, Adam Kropelin wrote:
> > Need to let the shell expand $EXTRAS so it can properly detect an empty
> > list. Without this patch, the build fails whenever $EXTRAS is empty.
>
> $ export EXTRAS=
> $ make
> $ set | grep EXTRA
> EXTRAS=
> $
>
> I can't duplicate this problem at all. Someone else once reported it on
> the linux-hotplug-devel list, with much the same fix up patch, but later
> said they couldn't reproduce it either.
>
> What version of make are you using?
It's actually the version of bash that's important. Prior to 2.05a, bash
was unable to handle for loops with empty words lists. From the
bash-2.05a changelog:
p. `for' loops now allow empty word lists after `in', like the
latest POSIX drafts require.
So bash-2.05 dies on...
for test in ; do echo $test ; done
...while bash-2.05a accepts it just fine.
Both versions can handle this case if the shell itself does the
expansion that results in the empty list. So that's where my workaround
came from.
--Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] udev-009: Allow build with empty EXTRAS
2003-12-17 16:11 ` Adam Kropelin
@ 2003-12-17 18:34 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-12-17 18:34 UTC (permalink / raw)
To: Adam Kropelin; +Cc: linux-hotplug-devel, linux-kernel
On Wed, Dec 17, 2003 at 11:11:14AM -0500, Adam Kropelin wrote:
> On Wed, Dec 17, 2003 at 12:31:00AM -0800, Greg KH wrote:
> > On Tue, Dec 16, 2003 at 10:04:06PM -0500, Adam Kropelin wrote:
> > > Need to let the shell expand $EXTRAS so it can properly detect an empty
> > > list. Without this patch, the build fails whenever $EXTRAS is empty.
> >
> > $ export EXTRAS=
> > $ make
> > $ set | grep EXTRA
> > EXTRAS=
> > $
> >
> > I can't duplicate this problem at all. Someone else once reported it on
> > the linux-hotplug-devel list, with much the same fix up patch, but later
> > said they couldn't reproduce it either.
> >
> > What version of make are you using?
>
> It's actually the version of bash that's important. Prior to 2.05a, bash
> was unable to handle for loops with empty words lists. From the
> bash-2.05a changelog:
>
> p. `for' loops now allow empty word lists after `in', like the
> latest POSIX drafts require.
>
> So bash-2.05 dies on...
>
> for test in ; do echo $test ; done
>
> ...while bash-2.05a accepts it just fine.
>
> Both versions can handle this case if the shell itself does the
> expansion that results in the empty list. So that's where my workaround
> came from.
Ah, ok, thanks for the explaination. I've applied this patch.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-12-17 18:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-17 3:04 [PATCH] udev-009: Allow build with empty EXTRAS Adam Kropelin
2003-12-17 8:31 ` Greg KH
2003-12-17 16:11 ` Adam Kropelin
2003-12-17 18:34 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox