Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/postinstall /usr/X11R7/lib/X11/xkb/symbols/pc used ...



details:   https://anonhg.NetBSD.org/src/rev/2aad460eba28
branches:  trunk
changeset: 748087:2aad460eba28
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Oct 13 07:47:00 2009 +0000

description:
/usr/X11R7/lib/X11/xkb/symbols/pc used to be a directory, but changed
to a file on 2009-06-12.  Fixing this requires removing the directory
(which we can do) and re-extracting the xbase set (which we can't do),
or at least adding that one file (which we may be able to do if X11SRCDIR
is available).

Reviewed by mrg, snj

diffstat:

 usr.sbin/postinstall/postinstall |  71 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 2 deletions(-)

diffs (108 lines):

diff -r 97d43af070ac -r 2aad460eba28 usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Tue Oct 13 00:49:38 2009 +0000
+++ b/usr.sbin/postinstall/postinstall  Tue Oct 13 07:47:00 2009 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.105 2009/09/29 23:56:35 tsarna Exp $
+# $NetBSD: postinstall,v 1.106 2009/10/13 07:47:00 apb Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -49,6 +49,7 @@
 # This script is executed as part of a cross build.  Allow the build
 # environment to override the locations of some tools.
 : ${AWK:=awk}
+: ${EGREP:=egrep}
 : ${FGREP:=fgrep}
 : ${GREP:=grep}
 : ${MAKE:=make}
@@ -623,7 +624,7 @@
 detect_x11()
 {
        if $SOURCEMODE; then
-               get_makevar MKX11 X11ROOTDIR
+               get_makevar MKX11 X11ROOTDIR X11SRCDIR
        else
                if [ -f "${SRC_DIR}/etc/mtree/set.xetc" ]; then
                        MKX11=yes
@@ -632,6 +633,7 @@
                        MKX11=no
                        X11ROOTDIR=
                fi
+               X11SRCDIR=/nonexisent/xsrc
        fi
 }
 
@@ -1348,6 +1350,71 @@
 }
 
 #
+#      xkb
+#
+# /usr/X11R7/lib/X11/xkb/symbols/pc used to be a directory, but changed
+# to a file on 2009-06-12.  Fixing this requires removing the directory
+# (which we can do) and re-extracting the xbase set (which we can't do),
+# or at least adding that one file (which we may be able to do if X11SRCDIR
+# is available).
+#
+additem xkb "clean up for xkbdata to xkeyboard-config upgrade"
+do_xkb()
+{
+       [ -n "$1" ] || err 3 "USAGE: do_xkb  fix|check"
+       op="$1"
+       failed=0
+
+       pcpath="/usr/X11R7/lib/X11/xkb/symbols/pc"
+       pcsrcdir="${X11SRCDIR}/external/mit/xkeyboard-config/dist/symbols"
+
+       filemsg="\
+${pcpath} was a directory, should be a file.
+    To fix, extract the xbase set again."
+
+       _notfixed=""
+       if [ "${op}" = "fix" ]; then
+               _notfixed="${NOT_FIXED}"
+       fi
+
+       if [ ! -d "${DESTDIR}${pcpath}" ]; then
+               return 0
+       fi
+
+       # Delete obsolete files in the directory, and the directory
+       # itself.  If the directory contains unexpected extra files
+       # then it will not be deleted.
+       ( [ -f "${DEST_DIR}"/var/db/obsolete/xbase ] \
+           &&  sort -ru "${DEST_DIR}"/var/db/obsolete/xbase \
+           | ${EGREP} "^\\.?${pcpath}/" ;
+           echo "${pcpath}" ) \
+       | obsolete_paths "${op}"
+       failed=$(( ${failed} + $? ))
+
+       # If the directory was removed above, then try to replace it with
+       # a file.
+       if [ -d "${DESTDIR}${pcpath}" ]; then
+               msg "${filemsg}${_notfixed}"
+               failed=$(( ${failed} + 1 ))
+       else
+               if ! find_file_in_dirlist pc "${pcpath}" \
+                       "${pcsrcdir}" "${SRC_DIR}${pcpath%/*}"
+               then
+                       msg "${filemsg}${_notfixed}"
+                       failed=$(( ${failed} + 1 ))
+               else
+                       # ${dir} is set by find_file_in_dirlist()
+                       populate_dir "${op}" true \
+                               "${dir}" "${DEST_DIR}${pcpath%/*}" 444 \
+                               pc
+                       failed=$(( ${failed} + $? ))
+               fi
+       fi
+
+       return $failed
+}
+
+#
 #      uid
 #
 additem uid "required users in /etc/master.passwd"



Home | Main Index | Thread Index | Old Index