Author: aurel32 Date: 2008-02-20 06:08:45 +0000 (Wed, 20 Feb 2008) New Revision: 2819
Added: glibc-package/trunk/debian/script.in/nsscheck.sh Modified: glibc-package/trunk/debian/changelog glibc-package/trunk/debian/debhelper.in/libc.postinst glibc-package/trunk/debian/debhelper.in/libc.preinst glibc-package/trunk/debian/rules.d/debhelper.mk Log: * Factorize NSS detection code: - debhelper.in/libc.preinst, debhelper.in/libc.postinst: move NSS code to... - script.in/nsscheck.sh: ... this file. - rules.d/debhelper.mk: Replace NSS_CHECK with code from script.in/nsscheck.sh. Modified: glibc-package/trunk/debian/changelog =================================================================== --- glibc-package/trunk/debian/changelog 2008-02-19 22:10:12 UTC (rev 2818) +++ glibc-package/trunk/debian/changelog 2008-02-20 06:08:45 UTC (rev 2819) @@ -6,6 +6,12 @@ * any/submitted-link-local_resolver.diff: kernel 2.6.24 is out, don't wait indefinitely for upstream. This patch from Pierre Ynard adds support for link-local addresses in /etc/resolv.conf. + * Factorize NSS detection code: + - debhelper.in/libc.preinst, debhelper.in/libc.postinst: move NSS code + to... + - script.in/nsscheck.sh: ... this file. + - rules.d/debhelper.mk: Replace NSS_CHECK with code from + script.in/nsscheck.sh. -- Aurelien Jarno <[EMAIL PROTECTED]> Tue, 19 Feb 2008 23:06:29 +0100 Modified: glibc-package/trunk/debian/debhelper.in/libc.postinst =================================================================== --- glibc-package/trunk/debian/debhelper.in/libc.postinst 2008-02-19 22:10:12 UTC (rev 2818) +++ glibc-package/trunk/debian/debhelper.in/libc.postinst 2008-02-20 06:08:45 UTC (rev 2819) @@ -155,50 +155,9 @@ if [ ! -d /var/mail ] && [ ! -L /var/mail ]; then ln -sf spool/mail /var/mail fi - if dpkg --compare-versions $preversion lt 2.3.5-1; then - echo -n "Checking for services that may need to be restarted..." - check="apache2-common apache apache-ssl apache-perl autofs at" - check="$check boa cucipop courier-authdaemon cron cupsys exim" - check="$check exim4-base dovecot-common cucipop lprng lpr" - check="$check lpr-ppd mysql-server nis openbsd-inetd" - check="$check openldapd postfix postfix-tls proftpd rsync samba" - check="$check sasl2-bin slapd smail sendmail snmpd ssh" - check="$check spamassassin vsftpd wu-ftpd wu-ftpd-academ wwwoffle" - check="$check webmin dropbear" - # Only get the ones that are installed, and configured - check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}') - # some init scripts don't match the package names - check=$(echo $check | \ - sed -e's/\bapache2-common\b/apache2/g' \ - -e's/\bat\b/atd/g' \ - -e's/\bdovecot-common\b/dovecot/g' \ - -e's/\bexim4-base\b/exim4/g' \ - -e's/\blpr\b/lpd/g' \ - -e's/\blpr-ppd\b/lpd-ppd/g' \ - -e's/\bsasl2-bin\b/saslauthd/g' \ - ) - echo - echo "Checking init scripts..." - rl=$(runlevel | sed 's/.*\ //') - for service in $check; do - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - idl=$(ls /etc/init.d/${service} 2> /dev/null | head -n 1) - if [ -n "$idl" ] && [ -x $idl ]; then - services="$service $services" - else - echo "WARNING: init script for $service not found." - fi - else - if [ -f /usr/share/file-rc/rc ] || [ -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then - idl=$(filerc $rl $service) - else - idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -1) - fi - if [ -n "$idl" ] && [ -x $idl ]; then - services="$service $services" - fi - fi - done + if dpkg --compare-versions $preversion lt 2.6-1; then + + # NSS services check: NSS_CHECK if [ -n "$services" ]; then if [ -f /usr/share/debconf/confmodule ] ; then Modified: glibc-package/trunk/debian/debhelper.in/libc.preinst =================================================================== --- glibc-package/trunk/debian/debhelper.in/libc.preinst 2008-02-19 22:10:12 UTC (rev 2818) +++ glibc-package/trunk/debian/debhelper.in/libc.preinst 2008-02-20 06:08:45 UTC (rev 2819) @@ -45,10 +45,7 @@ # NSS authentication trouble guard if dpkg --compare-versions $2 lt 2.6-1; then - check="xdm kdm gdm postgresql xscreensaver proftpd" - # Only get the ones that are installed, and configured - service=$(dpkg -s $check 2> /dev/null | awk 'BEGIN{RS="\n\n";FS="\n"}{if ( $2 ~ /Status: .* installed$/ ) { print $1 } }' | cut -f 2 -d ' ') - + # NSS services check: NSS_CHECK echo echo "Name Service Switch update in the C Library: pre-installation question." echo @@ -64,10 +61,10 @@ echo " $check" echo - if [ -n "$service" ]; then + if [ -n "$services" ]; then echo "This script detected the following installed services which must be" echo "stopped before the upgrade:" - echo " $service" + echo " $services" else echo "This script did not detect any installed services which need to be" echo "stopped." Modified: glibc-package/trunk/debian/rules.d/debhelper.mk =================================================================== --- glibc-package/trunk/debian/rules.d/debhelper.mk 2008-02-19 22:10:12 UTC (rev 2818) +++ glibc-package/trunk/debian/rules.d/debhelper.mk 2008-02-20 06:08:45 UTC (rev 2819) @@ -172,6 +172,7 @@ cp $$x $$z; \ sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \ sed -e "/KERNEL_VERSION_CHECK/r debian/script.in/kernelcheck.sh" -i $$z; \ + sed -e "/NSS_CHECK/r debian/script.in/nsscheck.sh" -i $$z; \ sed -e "/NOHWCAP/r debian/script.in/nohwcap.sh" -i $$z; \ sed -e "s#LIBC#$(libc)#" -i $$z; \ sed -e "s#CURRENT_VER#$(DEB_VERSION)#" -i $$z; \ Added: glibc-package/trunk/debian/script.in/nsscheck.sh =================================================================== --- glibc-package/trunk/debian/script.in/nsscheck.sh (rev 0) +++ glibc-package/trunk/debian/script.in/nsscheck.sh 2008-02-20 06:08:45 UTC (rev 2819) @@ -0,0 +1,43 @@ + echo -n "Checking for services that may need to be restarted..." + check="apache2-common apache apache-ssl apache-perl autofs at" + check="$check boa cucipop courier-authdaemon cron cupsys exim" + check="$check exim4-base dovecot-common cucipop lprng lpr" + check="$check lpr-ppd mysql-server nis openbsd-inetd" + check="$check openldapd postfix postfix-tls proftpd rsync samba" + check="$check sasl2-bin slapd smail sendmail snmpd ssh" + check="$check spamassassin vsftpd wu-ftpd wu-ftpd-academ wwwoffle" + check="$check webmin dropbear" + # Only get the ones that are installed, and configured + check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}') + # some init scripts don't match the package names + check=$(echo $check | \ + sed -e's/\bapache2-common\b/apache2/g' \ + -e's/\bat\b/atd/g' \ + -e's/\bdovecot-common\b/dovecot/g' \ + -e's/\bexim4-base\b/exim4/g' \ + -e's/\blpr\b/lpd/g' \ + -e's/\blpr-ppd\b/lpd-ppd/g' \ + -e's/\bsasl2-bin\b/saslauthd/g' \ + ) + echo + echo "Checking init scripts..." + rl=$(runlevel | sed 's/.*\ //') + for service in $check; do + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + idl=$(ls /etc/init.d/${service} 2> /dev/null | head -n 1) + if [ -n "$idl" ] && [ -x $idl ]; then + services="$service $services" + else + echo "WARNING: init script for $service not found." + fi + else + if [ -f /usr/share/file-rc/rc ] || [ -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then + idl=$(filerc $rl $service) + else + idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -1) + fi + if [ -n "$idl" ] && [ -x $idl ]; then + services="$service $services" + fi + fi + done -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]