1. Bryan O'Sullivan
  2. netplug


Bryan O'Sullivan  committed 9b7bc56

Reconstruct Mercurial 1.2.9 from an old snapshot.

Yes, I lost the original repo.

  • Participants
  • Parent commits 4fe8f40
  • Branches default
  • Tags 1.2.9

Comments (0)

Files changed (6)

File Makefile

View file
  • Ignore whitespace
 	-DNP_SCRIPT_DIR='"$(scriptdir)"' -ggdb3 -O3 -DNP_VERSION='"$(version)"'
 netplugd: config.o netlink.o lib.o if_info.o main.o
-	$(CC) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^
 	install -d $(install_opts) -m 755 $(bindir) $(etcdir) $(scriptdir) \
 hg_root := $(shell hg root)
 tar_root := netplug-$(version)
 tar_file := $(hg_root)/$(tar_root).tar.bz2
-files := $(shell hg locate '')
+files := $(shell hg manifest)
 tarball: $(tar_file)
 $(tar_file): $(files)
-	hg archive -X '.hg*' -t tbz2 $(tar_file)
-.FORCE: rpm
-rpm: $(tar_file)
-	mkdir -p rpm/{BUILD,RPMS/{i386,x86_64},SOURCES,SPECS,SRPMS}
-	rpmbuild --define '_topdir $(shell pwd)/rpm' -ta $(tar_file)
-	mv rpm/*/*.rpm rpm
-	mv rpm/*/*/*.rpm rpm
-fedora: $(tar_file)
-	rpmbuild --define 'release 0.fdr.1' -ta $(tar_file)
+	mkdir -p $(hg_root)/$(tar_root)
+	echo $(files) | tr ' ' '\n' | \
+	  xargs -i cp -a --parents {} $(hg_root)/$(tar_root)
+	tar -C $(hg_root) -c -f - $(tar_root) | bzip2 -9 > $(tar_file)
+	rm -rf $(hg_root)/$(tar_root)
 	-rm -f netplugd *.o *.tar.bz2


View file
  • Ignore whitespace
+Changes from 1.2.8 to 1.2.9
+* Numerous minor, but long-delayed, documentation and build changes.
+* Removed balky code from RPM spec file that attempted to modify
+  network interface configurations.
+Changes from 1.2.7 to 1.2.8
+* Fixed longstanding bug in writing out pid file.
+* Synced with downstream changes from Fedora Core 3.


View file
  • Ignore whitespace
 fix bugs, add documentation, and so on, are all welcome, as are
 suggestions for improvements.
-If you use the Mercurial distributed SCM, you can generate patches
-against http://hg.serpentine.com/netplug/netplug which is the main
-netplug repository.  Otherwise, "diff -u" style patches are fine.
+If you use BitKeeper, you can generate patches against
+http://laptop.bkbits.net/netplug which is the main netplug
+repository.  Otherwise, "diff -u" style patches are fine.

File main.c

View file
  • Ignore whitespace
 #include "netplug.h"
-/* Support old kernels without wireless */
-#endif /* IFLA_WIRELESS */
 int use_syslog;
 static char *pid_file;
     parse_rtattrs(attrs, IFLA_MAX, IFLA_RTA(info), len);
-    /* Ignore wireless messages */
-    if (attrs[IFLA_WIRELESS] != NULL
-		    && hdr->nlmsg_type == RTM_NEWLINK
-		    && info->ifi_change == 0) {
-	    do_log(LOG_DEBUG, "Ignoring wireless netlink message");
-	    return 0;
-    }	    
     if (attrs[IFLA_IFNAME] == NULL) {
         do_log(LOG_ERR, "No interface name");
         return -1;
     char *name = RTA_DATA(attrs[IFLA_IFNAME]);
     if (!if_match(name)) {
-        do_log(LOG_DEBUG, "%s: ignoring event", name);
+        do_log(LOG_INFO, "%s: ignoring event", name);
         return 0;

File man/man8/netplugd.8

View file
  • Ignore whitespace
 .It Fl c Ar config_file
 Specify the name of a file from which to read patterns that describe
-the interfaces to manage.  The config file format is one pattern per
-line, with white space, empty lines, and comments starting with a
-.Li #
-character ignored.  You can provide this option multiple times to read
+the interfaces to manage.  You can provide this option multiple times to read
 from more than one file.  If you do not provide this option at all,
 will attempt to read from a default config file.  If you do not want
 .Bl -tag -width Ds
 .It Pa /etc/netplug/netplugd.conf
 Default config file to read, if none is specified on the command line.
+The config file format is one pattern per line, with white space,
+empty lines, and comments starting with a
+.Li #
+character ignored.  Patterns are standard shell-style glob patterns,
+e.g. "eth[0-9]".
 .It Pa /etc/netplug.d/netplug
 The "policy" program (typically a shell script) that

File netplug.spec

View file
  • Ignore whitespace
-%define version 1.2.8
+%define version 1.2.9
 %define release 1
 %define sysconfig %{_sysconfdir}/sysconfig/network-scripts
 /sbin/chkconfig --add netplugd
-for cfg in %{sysconfig}/ifcfg-eth*; do
-    if echo "$cfg" | grep -q pre-netplug; then
-	continue
-    fi
-    if [ -f "$cfg.pre-netplug" ]; then
-	continue
-    fi
-    sed -e 's/^ONBOOT=yes/ONBOOT=no/' "$cfg" > "$cfg.new.$$"
-    if cmp -s "$cfg" "$cfg.new.$$"; then
-	true
-    else
-	cp "$cfg" "$cfg.pre-netplug"
-	cp "$cfg.new.$$" "$cfg"
-	ifname=`echo "$cfg" | sed 's!^.*/ifcfg-\(.*\)$!\1!'`
-	echo "Updated $ifname to be managed by netplug"
-    fi
-    rm "$cfg.new.$$"
 /sbin/chkconfig --del netplugd
-for precfg in %{sysconfig}/*.pre-netplug; do
-    if [ ! -f "$precfg" ]; then
-	continue
-    fi
-    cfg=`echo "$precfg" | sed -e 's!\.pre-netplug$!!'`
-    sed -e 's/^ONBOOT=no/ONBOOT=yes/' "$cfg" > "$cfg.new.$$"
-    if cmp -s "$cfg" "$cfg.new.$$"; then
-	true
-    else
-	cp "$cfg.new.$$" "$cfg"
-        ifname=`echo "$cfg" | sed -e 's!^.*/ifcfg-\(.*\)$!\1!'`
-	echo "Restored $ifname to be brought up at boot time"
-    fi
-    rm "$cfg.new.$$" "$cfg.pre-netplug"
 * Tue Aug 26 2003 Bryan O'Sullivan <bos@serpentine.com> - 
 - Initial build.