X Strike Force X.Org X11 SVN commit: r2114 - in trunk/font/xfonts-utils/debian: . local
Author: dnusinow
Date: 2006-05-09 00:53:27 -0400 (Tue, 09 May 2006)
New Revision: 2114
Modified:
trunk/font/xfonts-utils/debian/changelog
trunk/font/xfonts-utils/debian/local/update-fonts-alias
trunk/font/xfonts-utils/debian/local/update-fonts-alias.8
trunk/font/xfonts-utils/debian/local/update-fonts-scale
trunk/font/xfonts-utils/debian/local/update-fonts-scale.8
Log:
* Fix up update-fonts-alias and update-fonts-scale to cope with
files in /etc/X11/fonts/$type/ pointing to font files in either
/usr/share/fonts/X11 or /usr/X11R6/lib/X11/fonts, eliminating some
unnecessary transition work for font package maintainers;
update-fonts-{alias,scale} will in addition check
/etc/X11/fonts/X11R7/$type/ when called with -7, for transitional
purposes only. Closes: #364530.
Modified: trunk/font/xfonts-utils/debian/changelog
===================================================================
--- trunk/font/xfonts-utils/debian/changelog 2006-05-08 04:43:07 UTC (rev 2113)
+++ trunk/font/xfonts-utils/debian/changelog 2006-05-09 04:53:27 UTC (rev 2114)
@@ -1,3 +1,16 @@
+xfonts-utils (1:1.0.0-4) unstable; urgency=low
+
+ [ Steve Langasek ]
+ * Fix up update-fonts-alias and update-fonts-scale to cope with
+ files in /etc/X11/fonts/$type/ pointing to font files in either
+ /usr/share/fonts/X11 or /usr/X11R6/lib/X11/fonts, eliminating some
+ unnecessary transition work for font package maintainers;
+ update-fonts-{alias,scale} will in addition check
+ /etc/X11/fonts/X11R7/$type/ when called with -7, for transitional
+ purposes only. Closes: #364530.
+
+ -- David Nusinow <dnusinow@debian.org> Tue, 9 May 2006 00:53:44 -0400
+
xfonts-utils (1:1.0.0-3) unstable; urgency=low
* Upload to unstable
Modified: trunk/font/xfonts-utils/debian/local/update-fonts-alias
===================================================================
--- trunk/font/xfonts-utils/debian/local/update-fonts-alias 2006-05-08 04:43:07 UTC (rev 2113)
+++ trunk/font/xfonts-utils/debian/local/update-fonts-alias 2006-05-09 04:53:27 UTC (rev 2114)
@@ -6,6 +6,7 @@
# mkfontdir(1x) for a description of the format of fonts.alias files.
# Copyright 1999, 2001, 2002, 2004 Branden Robinson.
+# Copyright 2006 Steve Langasek.
# Licensed under the GNU General Public License, version 2. See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
@@ -43,7 +44,6 @@
fi
cat <<EOF
Usage: $PROGNAME DIRECTORY ...
- $PROGNAME { -7 | --x11r7-layout } DIRECTORY ...
$PROGNAME { -h | --help }
This program combines X font alias information from several packages into a
single file that is placed in each specified X font directory DIRECTORY. This
@@ -51,7 +51,6 @@
update-fonts-alias(8) for more information.
Options:
-h, --help display this usage message and exit
- -7, --x11r7-layout use new font layout introduced with X11R7
EOF
}
@@ -85,60 +84,87 @@
# Try to be clever about the argument; were we given an absolute path?
if expr "$1" : "/.*" >/dev/null 2>&1; then
# Yes; an absolute path to an X font directory was provided.
- XDIR=$1
- if [ -n "$X11R7_LAYOUT" ]; then
- ETCDIR=/etc/X11/fonts/X11R7/${XDIR##*/}
- else
- ETCDIR=/etc/X11/fonts/${XDIR##*/}
- fi
- if [ "$XDIR" = "$ETCDIR" ]; then
+ X11R7DIR=$1
+ ETCDIR=/etc/X11/fonts/${X11R7DIR##*/}
+ ETC7DIR=/etc/X11/fonts/X11R7/${X11R7DIR##*/}
+ if [ "$X11R7DIR" = "$ETCDIR" ] || [ "$X11R7DIR" = "$ETC7DIR" ]; then
# We were given an /etc directory as an argument.
die "path to X font directory must be used"
else
- warn "absolute path $XDIR was provided"
+ warn "absolute path $X11R7DIR was provided"
fi
else
# No; a relative path was provided -- assume we were given just the
# basename.
+ X11R6DIR=/usr/lib/X11/fonts/$1
+ X11R7DIR=/usr/share/fonts/X11/$1
+ ETCDIR=/etc/X11/fonts/$1
+ ETC7DIR=/etc/X11/fonts/X11R7/$1
+ fi
+
+ shift
+
+ # Confirm that the directories to be operated on exist.
+ VALIDSRC=
+ if [ -d "$ETCDIR" ]; then
+ VALIDSRC=yes
+ else
+ warn "$ETCDIR does not exist or is not a directory"
+ fi
+ if [ -d "$ETC7DIR" ]; then
+ VALIDSRC=yes
+ else
if [ -n "$X11R7_LAYOUT" ]; then
- XDIR=/usr/share/fonts/X11/$1
- ETCDIR=/etc/X11/fonts/X11R7/$1
- else
- XDIR=/usr/lib/X11/fonts/$1
- ETCDIR=/etc/X11/fonts/$1
+ warn "$ETC7DIR does not exist or is not a directory"
fi
fi
- # Confirm that the directories to be operated on exist.
- for DIR in "$XDIR" "$ETCDIR"; do
- VALID=yes
- if ! [ -d "$DIR" ]; then
+
+ VALIDDEST=
+ for DIR in "$X11R7DIR" "$X11R6DIR"; do
+ [ -n "$DIR" ] || continue
+ if [ -d "$DIR" ]; then
+ VALIDDEST=yes
+ else
warn "$DIR does not exist or is not a directory"
- VALID=
fi
done
- if [ -n "$VALID" ]; then
- # Are there any files to process?
- if [ "$(echo "$ETCDIR"/*.alias)" != "$ETCDIR/*.alias" ]; then
+
+ if [ -z "$VALIDSRC" ] || [ -z "$VALIDDEST" ]; then
+ continue
+ fi
+
+ # Are there any files to process?
+ if [ "$(echo "$ETCDIR"/*.alias "$ETC7DIR"/*.alias)" != "$ETCDIR/*.alias $ETC7DIR/*.alias" ]
+ then
+ for XDIR in "$X11R7DIR" "$X11R6DIR"; do
+ if [ -z "$XDIR" ] || ! [ -d "$XDIR" ]; then
+ continue
+ fi
# Write the new alias file in a temporary location in case we are
# interrupted.
cat >"$XDIR/fonts.alias.update-new" <<EOF
!! fonts.alias -- automatically generated file. DO NOT EDIT.
!! To modify, see update-fonts-alias(8).
EOF
- for FILE in "$ETCDIR"/*.alias; do
+ for FILE in "$ETCDIR"/*.alias "$ETC7DIR"/*.alias; do
+ [ -e "$FILE" ] || continue
echo "!! $FILE" >>"$XDIR/fonts.alias.update-new"
cat "$FILE" >>"$XDIR/fonts.alias.update-new"
done
mv "$XDIR/fonts.alias.update-new" "$XDIR/fonts.alias"
- else
+ done
+ else
+ for XDIR in "$X11R7DIR" "$X11R6DIR"; do
+ if [ -z "$XDIR" ] || ! [ -d "$XDIR" ]; then
+ continue
+ fi
# There are no files to process; remove any alias file already in
# the font directory.
rm -f "$XDIR/fonts.alias"
# Remove the font directory if it is empty.
rmdir "$XDIR" >/dev/null 2>&1 || true
- fi
+ done
fi
- shift
done
exit 0
Modified: trunk/font/xfonts-utils/debian/local/update-fonts-alias.8
===================================================================
--- trunk/font/xfonts-utils/debian/local/update-fonts-alias.8 2006-05-08 04:43:07 UTC (rev 2113)
+++ trunk/font/xfonts-utils/debian/local/update-fonts-alias.8 2006-05-09 04:53:27 UTC (rev 2114)
@@ -92,12 +92,6 @@
.SH OPTIONS
.B \-h\fR, \fB\-\-help
displays a brief usage message and exits.
-.PP
-.B \-7\fR, \fB\-\-x11r7\-layout
-switches the font layout to the one introduced in X11R7: fonts in
-.IR /usr/share/fonts/X11/ directory
-(default is: fonts in
-.IR /usr/lib/X11/fonts/ directory)
.SH OPERANDS
.B update\-fonts\-alias
takes one or more X font directory names to operate on as operands.
Modified: trunk/font/xfonts-utils/debian/local/update-fonts-scale
===================================================================
--- trunk/font/xfonts-utils/debian/local/update-fonts-scale 2006-05-08 04:43:07 UTC (rev 2113)
+++ trunk/font/xfonts-utils/debian/local/update-fonts-scale 2006-05-09 04:53:27 UTC (rev 2114)
@@ -6,6 +6,7 @@
# mkfontdir(1x) for a description of the format of fonts.scale files.
# Copyright 1999-2002, 2004 Branden Robinson.
+# Copyright 2006 Steve Langasek.
# Licensed under the GNU General Public License, version 2. See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
@@ -50,7 +51,6 @@
fi
cat <<EOF
Usage: $PROGNAME DIRECTORY ...
- $PROGNAME { -7 | --x11r7-layout } DIRECTORY ...
$PROGNAME { -h | --help }
This program combines scalable X font information from several packages into a
single file that is placed in each specified X font directory DIRECTORY. This
@@ -58,7 +58,6 @@
update-fonts-scale(8) for more information.
Options:
-h, --help display this usage message and exit
- -7, --x11r7-layout use new font layout introduced with X11R7
EOF
}
@@ -92,41 +91,64 @@
# Try to be clever about the argument; were we given an absolute path?
if expr "$1" : "/.*" >/dev/null 2>&1; then
# Yes; an absolute path to an X font directory was provided.
- XDIR=$1
- if [ -n "$X11R7_LAYOUT" ]; then
- ETCDIR=/etc/X11/fonts/X11R7/${XDIR##*/}
- else
- ETCDIR=/etc/X11/fonts/${XDIR##*/}
- fi
- if [ "$XDIR" = "$ETCDIR" ]; then
+ X11R7DIR=$1
+ ETCDIR=/etc/X11/fonts/${X11R7DIR##*/}
+ ETC7DIR=/etc/X11/fonts/X11R7/${X11R7DIR##*/}
+ if [ "$X11R7DIR" = "$ETCDIR" ] || [ "$X11R7DIR" = "$ETC7DIR" ]; then
# We were given an /etc directory as an argument.
die "path to X font directory must be used"
else
- warn "absolute path $XDIR was provided"
+ warn "absolute path $X11R7DIR was provided"
fi
else
# No; a relative path was provided -- assume we were given just the
# basename.
+ X11R6DIR=/usr/lib/X11/fonts/$1
+ X11R7DIR=/usr/share/fonts/X11/$1
+ ETCDIR=/etc/X11/fonts/$1
+ ETC7DIR=/etc/X11/fonts/X11R7/$1
+ fi
+
+ shift
+
+ # Confirm that the directories to be operated on exist.
+ VALIDSRC=
+ if [ -d "$ETCDIR" ]; then
+ VALIDSRC=yes
+ else
+ warn "$ETCDIR does not exist or is not a directory"
+ fi
+ if [ -d "$ETC7DIR" ]; then
+ VALIDSRC=yes
+ else
if [ -n "$X11R7_LAYOUT" ]; then
- XDIR=/usr/share/fonts/X11/$1
- ETCDIR=/etc/X11/fonts/X11R7/$1
- else
- XDIR=/usr/lib/X11/fonts/$1
- ETCDIR=/etc/X11/fonts/$1
+ warn "$ETC7DIR does not exist or is not a directory"
fi
fi
- # Confirm that the directories to be operated on exist.
- for DIR in "$XDIR" "$ETCDIR"; do
- VALID=yes
- if ! [ -d "$DIR" ]; then
+
+ VALIDDEST=
+ for DIR in "$X11R7DIR" "$X11R6DIR"; do
+ [ -n "$DIR" ] || continue
+ if [ -d "$DIR" ]; then
+ VALIDDEST=yes
+ else
warn "$DIR does not exist or is not a directory"
- VALID=
fi
done
- if [ -n "$VALID" ]; then
- # Are there any files to process?
- if [ "$(echo "$ETCDIR"/*.scale)" != "$ETCDIR/*.scale" ]; then
- for SCALEFILE in "$ETCDIR"/*.scale; do
+
+ if [ -z "$VALIDSRC" ] || [ -z "$VALIDDEST" ]; then
+ continue
+ fi
+
+ # Are there any files to process?
+ if [ "$(echo "$ETCDIR"/*.scale "$ETC7DIR"/*.scale)" != "$ETCDIR/*.scale $ETC7DIR/*.scale" ]
+ then
+ for XDIR in "$X11R7DIR" "$X11R6DIR"; do
+ if [ -z "$XDIR" ] || ! [ -d "$XDIR" ]; then
+ continue
+ fi
+ for SCALEFILE in "$ETCDIR"/*.scale "$ETC7DIR"/*.scale; do
+ [ -e "$SCALEFILE" ] || continue
# Only write fonts to the .scale file that actually exist, so
# that removed-but-not-purged scalable font packages do not
# register nonexistent fonts; this has the desirable side effect
@@ -155,15 +177,19 @@
mv "$XDIR/fonts.scale.update-new" "$XDIR/fonts.scale"
rm "$XDIR/fonts.scale.update-tmp"
fi
- else
+ done
+ else
+ for XDIR in "$X11R7DIR" "$X11R6DIR"; do
+ if [ -z "$XDIR" ] || ! [ -d "$XDIR" ]; then
+ continue
+ fi
# No files to process; remove any fonts.scale file already in the
# font directory.
rm -f "$XDIR/fonts.scale"
# Remove the font directory if it is empty.
rmdir "$XDIR" >/dev/null 2>&1 || true
- fi
+ done
fi
- shift
done
exit 0
Modified: trunk/font/xfonts-utils/debian/local/update-fonts-scale.8
===================================================================
--- trunk/font/xfonts-utils/debian/local/update-fonts-scale.8 2006-05-08 04:43:07 UTC (rev 2113)
+++ trunk/font/xfonts-utils/debian/local/update-fonts-scale.8 2006-05-09 04:53:27 UTC (rev 2114)
@@ -96,12 +96,6 @@
.SH OPTIONS
.B \-h\fR, \fB\-\-help
displays a brief usage message and exits.
-.PP
-.B \-7\fR, \fB\-\-x11r7\-layout
-switches the font layout to the one introduced in X11R7: fonts in
-.IR /usr/share/fonts/X11/ directory
-(default is: fonts in
-.IR /usr/lib/X11/fonts/ directory)
.SH OPERANDS
.B update\-fonts\-scale
takes one or more X font directory names to operate on as operands.
Reply to: