Re: [patch] netcfg wireless
On 01/07/2009, Otavio Salvador <otavio@ossystems.com.br> wrote:
[...]
> The patch itself looks good. I'd just inverse the logic.
>
> You've used NO_WIRELESS and I'd use WIRELESS and set it to 0 to
> disable or or similar.
Consider that NO_WIRELESS was already there.
However I modified it as you suggested in the attached version 2 of the patch.
Index: packages/netcfg/debian/changelog
===================================================================
--- packages/netcfg/debian/changelog (.../trunk) (revision 59177)
+++ packages/netcfg/debian/changelog (.../branches/d-i/kfreebsd) (revision 59190)
@@ -4,6 +4,11 @@
Thanks to Marco d'Itri for the proposed change
Closes: #533384
+ [ Luca Favatella ]
+ * If wireless is disabled, don't build and link wireless related stuff.
+ * Disable by default wireless on non-linux architectures.
+ * Inverse the logic about building without wireless support (WIRELESS=0).
+
-- Christian Perrier <bubulle@debian.org> Thu, 18 Jun 2009 06:11:33 +0200
netcfg (1.49) unstable; urgency=low
Index: packages/netcfg/Makefile
===================================================================
--- packages/netcfg/Makefile (.../trunk) (revision 59177)
+++ packages/netcfg/Makefile (.../branches/d-i/kfreebsd) (revision 59190)
@@ -1,11 +1,16 @@
CC = gcc
TARGETS ?= netcfg-static netcfg
-LDOPTS = -ldebconfclient -ldebian-installer -liw
+LDOPTS = -ldebconfclient -ldebian-installer
CFLAGS = -W -Wall -DNDEBUG
COMMON_OBJS = netcfg-common.o wireless.o
-ifeq ($(NO_WIRELESS),)
+ifneq ($(DEB_HOST_ARCH_OS),linux)
+WIRELESS = 0
+endif
+
+ifneq ($(WIRELESS),0)
+LDOPTS += -liw
CFLAGS += -DWIRELESS
endif
Index: packages/netcfg/netcfg-common.c
===================================================================
--- packages/netcfg/netcfg-common.c (.../trunk) (revision 59177)
+++ packages/netcfg/netcfg-common.c (.../branches/d-i/kfreebsd) (revision 59190)
@@ -180,6 +184,7 @@
#undef SYSCLASSNET
+#if defined(WIRELESS)
int is_raw_80211(const char *iface)
{
struct ifreq ifr;
@@ -203,6 +208,7 @@
return 0;
}
}
+#endif
int is_interface_up(char *inter)
{
@@ -263,8 +269,10 @@
continue;
if (!strncmp(ibuf, "sit", 3)) /* ignore tunnel devices */
continue;
+#if defined(WIRELESS)
if (is_raw_80211(ibuf))
continue;
+#endif
if (all || is_interface_up(ibuf) == 1) {
list = realloc(list, sizeof(char*) * (len + 1));
list[len] = strdup(ibuf);
Reply to: