mirror of
				https://github.com/CumulusNetworks/ifupdown2.git
				synced 2024-05-06 15:54:50 +00:00 
			
		
		
		
	debian: removing stale files
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
		
							
								
								
									
										114
									
								
								debian/python-ifupdown2.postinst
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										114
									
								
								debian/python-ifupdown2.postinst
									
									
									
									
										vendored
									
									
								
							| @@ -1,114 +0,0 @@ | ||||
| #!/bin/sh | ||||
| # postinst script for ifupdown2 | ||||
| # | ||||
| # see: dh_installdeb(1) | ||||
|  | ||||
| set -e | ||||
|  | ||||
| # summary of how this script can be called: | ||||
| #        * <postinst> `configure' <most-recently-configured-version> | ||||
| #        * <old-postinst> `abort-upgrade' <new version> | ||||
| #        * <conflictor's-postinst> `abort-remove' `in-favour' <package> | ||||
| #          <new-version> | ||||
| #        * <postinst> `abort-remove' | ||||
| #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | ||||
| #          <failed-install-package> <version> `removing' | ||||
| #          <conflicting-package> <version> | ||||
| # for details, see http://www.debian.org/doc/debian-policy/ or | ||||
| # the debian-policy package | ||||
|  | ||||
| process_udev() | ||||
| { | ||||
|     # override default udev bridge and hotplug rules because they interfere with | ||||
|     # networking init script | ||||
|     udev_user_rulesdir=/etc/udev/rules.d/ | ||||
|     udev_sys_rulesdir=/lib/udev/rules.d/ | ||||
|     if [ -e $udev_user_rulesdir ]; then | ||||
|         udev_ifupdown2_overrides="80-networking.rules | ||||
|         60-bridge-network-interface.rules" | ||||
|         for u in ${udev_ifupdown2_overrides} | ||||
|         do | ||||
|             if [ -e ${udev_sys_rulesdir}/$u -a ! -e ${udev_user_rulesdir}/$u ]; then | ||||
|                 (cd ${udev_user_rulesdir} && ln -sf /dev/null $u) | ||||
|             fi | ||||
|         done | ||||
|     fi | ||||
| } | ||||
|  | ||||
| MYNAME="${0##*/}" | ||||
|  | ||||
| report() { echo "${MYNAME}: $*" ; } | ||||
| report_warn() { report "Warning: $*" >&2 ; } | ||||
| report_err() { report "Error: $*" >&2 ; } | ||||
|  | ||||
| case "$1" in | ||||
|     configure) | ||||
|         # Create /etc/network/run | ||||
|         [ -d /run/network ] || mkdir -p /run/network | ||||
|  | ||||
|         # for backward compatibility | ||||
|         if [ ! -f /etc/network/run ]; then | ||||
|             ln -sf /run/network /etc/network/run | ||||
|         fi | ||||
|  | ||||
|         ln -sf /usr/share/python-ifupdown2/generate_interfaces.py \ | ||||
|             /usr/share/doc/python-ifupdown2/examples/generate_interfaces.py | ||||
|  | ||||
|         [ -d /etc/network/if-pre-up.d ] || mkdir -p /etc/network/if-pre-up.d | ||||
|         [ -d /etc/network/if-up.d ] || mkdir -p /etc/network/if-up.d | ||||
|         [ -d /etc/network/if-post-up.d ] || mkdir -p /etc/network/if-post-up.d | ||||
|  | ||||
|         [ -d /etc/network/if-pre-down.d ] || mkdir -p /etc/network/if-pre-down.d | ||||
|         [ -d /etc/network/if-down.d ] || mkdir -p /etc/network/if-down.d | ||||
|         [ -d /etc/network/if-post-down.d ] || mkdir -p /etc/network/if-post-down.d | ||||
|  | ||||
|  | ||||
|         # Generic stuff done on all configurations | ||||
|         if [ -f /etc/network/interfaces ] ; then | ||||
|             # TODO: This should be handled with debconf and the script | ||||
|             # could introduce the line there directly | ||||
|             if ! grep -q "^[[:space:]]*iface[[:space:]]\+lo0\?[[:space:]]\+inet[[:space:]]\+loopback\>" /etc/network/interfaces ; then | ||||
|                 report_warn "No 'iface lo' definition found in /etc/network/interfaces" | ||||
|             fi | ||||
|  | ||||
|             if ! grep -q "^[[:space:]]*\(allow-\|\)auto[[:space:]]\+\(.*[[:space:]]\+\|\)lo0\?\([[:space:]]\+\|$\)" /etc/network/interfaces ; then | ||||
|                 report_warn "No 'auto lo' statement found in /etc/network/interfaces" | ||||
|             fi | ||||
|         else  # ! -f /etc/network/interfaces | ||||
|             if [ -z "$2" ]; then | ||||
|                 echo "Creating /etc/network/interfaces." | ||||
|                 echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces | ||||
|                 echo "auto lo" >> /etc/network/interfaces | ||||
|                     echo "iface lo inet loopback" >> /etc/network/interfaces | ||||
|             else | ||||
|                     report_warn "/etc/network/interfaces does not exist" | ||||
|             fi | ||||
|         fi | ||||
|  | ||||
|         [ -e /sbin/ifup ] || ln -sf /sbin/ifupdown /sbin/ifup | ||||
|         [ -e /sbin/ifdown ] || ln -sf /sbin/ifupdown /sbin/ifdown | ||||
|         [ -e /sbin/ifquery ] || ln -sf /sbin/ifupdown /sbin/ifquery | ||||
|         [ -e /sbin/ifreload ] || ln -sf /sbin/ifupdown /sbin/ifreload | ||||
|  | ||||
|         (cd /usr/share/man/man8/ && ln -sf /usr/share/man/man8/ifup.8.gz ifdown.8.gz) | ||||
|  | ||||
|         mkdir -p /etc/network/interfaces.d/ | ||||
|         process_udev | ||||
|         update-rc.d networking start 40 S . start 35 0 6 . >/dev/null | ||||
|         ;; | ||||
|  | ||||
|     abort-upgrade|abort-remove|abort-deconfigure) | ||||
|         ;; | ||||
|  | ||||
|     *) | ||||
|         echo "postinst called with unknown argument \`$1'" >&2 | ||||
|         exit 1 | ||||
|         ;; | ||||
| esac | ||||
|  | ||||
| # dh_installdeb will replace this with shell code automatically | ||||
| # generated by other debhelper scripts. | ||||
|  | ||||
| #DEBHELPER# | ||||
|  | ||||
| exit 0 | ||||
							
								
								
									
										71
									
								
								debian/python-ifupdown2.postrm
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										71
									
								
								debian/python-ifupdown2.postrm
									
									
									
									
										vendored
									
									
								
							| @@ -1,71 +0,0 @@ | ||||
| #!/bin/sh | ||||
| # postrm script for ifupdown2 | ||||
| # | ||||
| # see: dh_installdeb(1) | ||||
|  | ||||
| set -e | ||||
|  | ||||
| # summary of how this script can be called: | ||||
| #        * <postrm> `remove' | ||||
| #        * <postrm> `purge' | ||||
| #        * <old-postrm> `upgrade' <new-version> | ||||
| #        * <new-postrm> `failed-upgrade' <old-version> | ||||
| #        * <new-postrm> `abort-install' | ||||
| #        * <new-postrm> `abort-install' <old-version> | ||||
| #        * <new-postrm> `abort-upgrade' <old-version> | ||||
| #        * <disappearer's-postrm> `disappear' <overwriter> | ||||
| #          <overwriter-version> | ||||
| # for details, see http://www.debian.org/doc/debian-policy/ or | ||||
| # the debian-policy package | ||||
|  | ||||
| process_udev() | ||||
| { | ||||
|     udevlink=$(readlink /etc/udev/rules.d/80-networking.rules 2>/dev/null || true) | ||||
|     [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/80-networking.rules | ||||
|     udevlink=$(readlink /etc/udev/rules.d/60-bridge-network-interface.rules 2>/dev/null || true) | ||||
|     [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/60-bridge-network-interface.rules | ||||
| } | ||||
|  | ||||
| postrm_remove() | ||||
| { | ||||
| 	rm -f /sbin/ifup /sbin/ifdown /sbin/ifquery | ||||
|     process_udev | ||||
| 	update-rc.d networking remove >/dev/null | ||||
| } | ||||
|  | ||||
| # Note: We don't remove /etc/network/interfaces | ||||
| postrm_purge() | ||||
| { | ||||
| 	rm -f /var/tmp/network/ifstatenew | ||||
| 	if [ -L /etc/network/run ] ; then | ||||
| 		rm -f /etc/network/run | ||||
| 	elif [ -d /etc/network/run ] ; then | ||||
| 		rmdir --ignore-fail-on-non-empty /etc/network/run | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| case "$1" in | ||||
| 	purge) | ||||
| 		postrm_purge | ||||
| 	;; | ||||
|  | ||||
| 	remove) | ||||
| 		postrm_remove | ||||
| 	;; | ||||
|  | ||||
|  | ||||
| 	upgrade|disappear|failed-upgrade|abort-install|abort-upgrade) | ||||
| 	;; | ||||
|  | ||||
| 	*) | ||||
| 		echo "postrm called with unknown argument \`$1'" >&2 | ||||
| 		exit 1 | ||||
| 	;; | ||||
| esac | ||||
|  | ||||
| # dh_installdeb will replace this with shell code automatically | ||||
| # generated by other debhelper scripts. | ||||
|  | ||||
| #DEBHELPER# | ||||
|  | ||||
| exit 0 | ||||
							
								
								
									
										56
									
								
								debian/python-ifupdown2.preinst
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										56
									
								
								debian/python-ifupdown2.preinst
									
									
									
									
										vendored
									
									
								
							| @@ -1,56 +0,0 @@ | ||||
| #!/bin/sh | ||||
| # preinst script for newpkg | ||||
| # | ||||
| # see: dh_installdeb(1) | ||||
|  | ||||
| set -e | ||||
|  | ||||
| # summary of how this script can be called: | ||||
| #        * <new-preinst> `install' | ||||
| #        * <new-preinst> `install' <old-version> | ||||
| #        * <new-preinst> `upgrade' <old-version> | ||||
| #        * <old-preinst> `abort-upgrade' <new-version> | ||||
| # for details, see http://www.debian.org/doc/debian-policy/ or | ||||
| # the debian-policy package | ||||
|  | ||||
| preinst_upgrade() | ||||
| { | ||||
| 	local oldver="$1" | ||||
| 	local udev_user_rulesdir="/etc/udev/rules.d" | ||||
|  | ||||
| 	# we have to fixup the filesystem here as previous packages of | ||||
| 	# ifupdown2 introduced a bug in the postrm script that require | ||||
| 	# these files to exist, otherwise the postrm script will always | ||||
| 	# fail. | ||||
| 	local badver="0.1-cl2.5+2" | ||||
| 	if dpkg --compare-versions "${oldver}" "lt" "${badver}"; then | ||||
| 		local files="${udev_user_rulesdir}/80-networking.rules | ||||
| 			${udev_user_rulesdir}/60-bridge-network-interface.rules" | ||||
| 		for f in ${files}; do | ||||
| 			echo "touching udev rule: ${f}" | ||||
| 			test ! -e "${f}" && ln -s /dev/null "${f}" || \ | ||||
| 				/bin/echo -e "\tudev rule exists leaving" | ||||
| 		done | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| case "$1" in | ||||
| 	install|upgrade) | ||||
| 		preinst_upgrade "$2" | ||||
| 	;; | ||||
|  | ||||
| 	abort-upgrade) | ||||
| 	;; | ||||
|  | ||||
| 	*) | ||||
| 		echo "preinst called with unknown argument \`$1'" >&2 | ||||
| 		exit 1 | ||||
| 	;; | ||||
| esac | ||||
|  | ||||
| # dh_installdeb will replace this with shell code automatically | ||||
| # generated by other debhelper scripts. | ||||
|  | ||||
| #DEBHELPER# | ||||
|  | ||||
| exit 0 | ||||
		Reference in New Issue
	
	Block a user