Fix incorrect install location of networking default file
Ticket: none
Reviewed By: roopa,satish
Testing Done: built, installed, verified correct location
The install file resulted in creating /etc/default/networking/ as a
directory and installing the networking.default file in it. Rename
networking.default to networking, and change the install file.
Normally dh_installinit handles all this, but since the package is
ifupdown2, and the file is networking, that doesn't happen.
Also, because we had created a directory with the name of what we want
to install as a file, we need to remove it if it exists. This addition
of a preinst file should not go upstream, and should be removed in a few
weeks when everybody has re-installed enough.
2016-02-19 13:14:55 -08:00
|
|
|
#! /bin/sh
|
2016-11-01 19:40:00 +01:00
|
|
|
|
|
|
|
MYNAME="${0##*/}"
|
|
|
|
|
|
|
|
report() { echo "${MYNAME}: $*" ; }
|
|
|
|
report_err() { report "Error: $*" >&2 ; }
|
|
|
|
|
|
|
|
preinst_divert()
|
|
|
|
{
|
|
|
|
diversions=$(dpkg-divert --list | grep "$1" | grep -v 'by ifupdown2$' | wc -l 2> /dev/null)
|
|
|
|
if [ $diversions -gt 0 ] ;
|
|
|
|
then
|
|
|
|
report_err "existing diversion for $1"
|
|
|
|
else
|
|
|
|
if [ -f $1 ];
|
|
|
|
then
|
|
|
|
dpkg-divert --add --package ifupdown2 --rename --divert "$1.disabled" "$1"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
Fix incorrect install location of networking default file
Ticket: none
Reviewed By: roopa,satish
Testing Done: built, installed, verified correct location
The install file resulted in creating /etc/default/networking/ as a
directory and installing the networking.default file in it. Rename
networking.default to networking, and change the install file.
Normally dh_installinit handles all this, but since the package is
ifupdown2, and the file is networking, that doesn't happen.
Also, because we had created a directory with the name of what we want
to install as a file, we need to remove it if it exists. This addition
of a preinst file should not go upstream, and should be removed in a few
weeks when everybody has re-installed enough.
2016-02-19 13:14:55 -08:00
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
|
|
install|upgrade)
|
2016-11-01 19:40:00 +01:00
|
|
|
for filename in ifup ifdown ifquery ifreload
|
|
|
|
do
|
|
|
|
preinst_divert "/usr/share/bash-completion/completions/$filename"
|
|
|
|
preinst_divert "/etc/bash_completion.d/$filename"
|
|
|
|
done
|
|
|
|
|
Fix incorrect install location of networking default file
Ticket: none
Reviewed By: roopa,satish
Testing Done: built, installed, verified correct location
The install file resulted in creating /etc/default/networking/ as a
directory and installing the networking.default file in it. Rename
networking.default to networking, and change the install file.
Normally dh_installinit handles all this, but since the package is
ifupdown2, and the file is networking, that doesn't happen.
Also, because we had created a directory with the name of what we want
to install as a file, we need to remove it if it exists. This addition
of a preinst file should not go upstream, and should be removed in a few
weeks when everybody has re-installed enough.
2016-02-19 13:14:55 -08:00
|
|
|
# workaround 3.0.0 internal install error. This can be removed in a
|
|
|
|
# few weeks.
|
|
|
|
if [ -f /etc/default/networking/networking.default ]; then
|
|
|
|
dpkg-maintscript-helper rm_conffile /etc/default/networking/networking.default 1.1 -- $@
|
|
|
|
rm -rf /etc/default/networking
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2016-09-09 12:30:50 -07:00
|
|
|
#DEBHELPER#
|