Package: modutils
Version: 2.4.26-1.2
Severity: normal
Here are few changes. The main goal was to fix the regexp, but at the
same time I make the script to fit into 80 character console. The original
regexp read:
dpkg-[a-z]*
which included non-effective part [a-z]*. It is faster to say like this:
dpkg-
See other changes below. Patches attached.
2005-03-10 Jari Aalto <jari.aalto A T cante net>
* update-modules.modutils
- Made code to fit in 80 column display
- Streamlined regexp to ignore certina *dokg files
- Added ignoring '#'-files (Emacs auto save) and .tmp files
(if user want to temporarily ignore certain files).
(depdir): Split grep/tail/sed
command to separate lines.
(archmodel): Split sed/echo commands to separate lines.
(checkoverwrite): Split echo commands to separate lines.
2005-03-10 Jari Aalto <jari aalto A T cante net>
* update-modules.modutils.8: Updated REGEXP documentation
at the end.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ISO-8859-1) (ignored: LC_ALL set to en_US)
Versions of packages modutils depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
ii sysvinit 2.86.ds1-1 System-V like init
-- no debconf information
--- update-modules.modutils.8 2005/03/10 19:56:52 1.1
+++ update-modules.modutils.8 2005/03/10 20:03:39 1.2
@@ -51,15 +51,15 @@
.B update\-modules
will ignore files that match the following regular expression:
.RS
-.B *\e(\e.dpkg\-[a\-z]*\e|~\e)$
+.B *\e(\e.dpkg\-\e|[~#]\e|\e.tmp\e)$
.RE
-(ie files with the extension
+(i.e. files with the extension
.IR .dpkg\-new ,
.IR .dpkg\-orig ,
.IR .dpkg\-dist ,
.IR .dpkg\-old ,
or whose filename end with a
-.IR ~ ).
+.IR ~ or # or temporary *.tmp files).
.SH OPTIONS
.TP
.I force
--- update-modules.modutils 2005/03/10 19:42:55 1.1
+++ update-modules.modutils 2005/03/10 19:53:33 1.2
@@ -27,7 +27,9 @@
depdir()
{
- dep=`grep '[[:space:]]*depfile' "${MODCONFFILE}" | tail -n 1 | sed -e
's/depfile=//' -e 's,/[^/]*$,,'`
+ dep=`grep '[[:space:]]*depfile' "${MODCONFFILE}" \
+ | tail -n 1 \
+ | sed -e 's/depfile=//' -e 's,/[^/]*$,,'`
if [ -z "$dep" ] ; then
dep="/lib/modules/`uname -r`"
fi
@@ -51,7 +53,8 @@
local model=""
if [ $arch = "m68k" ]; then
if [ -f /proc/hardware ]; then
- model=`sed -ne 's/^Model:[[:space:]]*//p'
/proc/hardware`
+ model=`sed -ne 's/^Model:[[:space:]]*//p' \
+ /proc/hardware`
case $model in
Atari*) model="atari"; ;;
Amiga*) model="amiga"; ;;
@@ -61,12 +64,15 @@
esac
model=".${model}"
else
- echo "/proc/hardware does not exist, assuming general
m68k system"
+ echo "/proc/hardware does not exist," \
+ " assuming general m68k system"
model=".generic"
fi
elif [ $arch = "powerpc" ]; then
if [ -f /proc/cpuinfo ]; then
- model=`sed -ne 's/^machine[[:space:]]*:[[:space:]]*//p'
/proc/cpuinfo`
+ model=`sed -ne \
+ 's/^machine[[:space:]]*:[[:space:]]*//p' \
+ /proc/cpuinfo`
case $model in
Amiga*) model="apus"; ;;
Power*) model="pmac"; ;;
@@ -74,19 +80,23 @@
esac
model=".${model}"
else
- echo "/proc/cpuinfo does not exist, assuming general
powerpc system"
+ echo "/proc/cpuinfo does not exist," \
+ " assuming general powerpc system"
model=".generic"
fi
elif [ $arch = "mips" ]; then
if [ -f /proc/cpuinfo ]; then
- model=`sed -ne 's/^system
type[[:space:]]*:[[:space:]]*//p' /proc/cpuinfo`
+ model=`sed -ne \
+ 's/^system type[[:space:]]*:[[:space:]]*//p' \
+ /proc/cpuinfo`
case $model in
"SGI Indy"*) model="ip22"; ;;
*) model="generic"; ;;
esac
model=".${model}"
else
- echo "/proc/cpuinfo does not exist, assuming general
mips system"
+ echo "/proc/cpuinfo does not exist," \
+ " assuming general mips system"
model=".generic"
fi
fi
@@ -98,12 +108,15 @@
if [ -f "$cfgfile" ]; then
if ! sed -ne 1p "$cfgfile" | grep -q "^$HEADER" ; then
- echo "Error: the current $cfgfile is not automatically
generated." >&2
+ echo "Error: the current $cfgfile is" \
+ "not automatically generated." >&2
if [ -z "$force" ]; then
- echo "Use \"update-modules force\" to force
(re)generation."
+ echo 'Use "update-modules force"' \
+ "to force (re)generation."
exit 1
else
- echo "force specified, (re)generating file
anyway."
+ echo "force specified," \
+ " (re)generating file anyway."
fi
fi
fi
@@ -168,21 +181,27 @@
CONF="${ARCHDIR}/${model}"
if [ ! -f "$CONF" ]; then
- echo "Architecture-specific modutils configuration not found, using
defaults"
+ echo "Architecture-specific modutils configuration" \
+ "not found, using defaults"
CONF="${ARCHDIR}/generic"
fi
-[ -e "$MODCONFFILE" ] && cp -f "$MODCONFFILE" "${MODCONFFILE}.old"
-[ "$dochandev" -a -e "$CHANDEVFILE" ] && cp -f "$CHANDEVFILE"
"${CHANDEVFILE}.old"
+[ -e "$MODCONFFILE" ] &&
+cp -f "$MODCONFFILE" "${MODCONFFILE}.old"
+
+[ "$dochandev" -a -e "$CHANDEVFILE" ] &&
+cp -f "$CHANDEVFILE" "${CHANDEVFILE}.old"
createfile "$MODCONFTMPFILE"
[ "$dochandev" ] && createfile "$CHANDEVTMPFILE"
for cfg in /etc/modutils/* $CONF ; do
- if [ -f "$cfg" ]; then # this check is necesarry to skip
/etc/modutils/archs
+ # this check is necesarry to skip /etc/modutils/archs
+ if [ -f "$cfg" ]; then
if [ "$dochandev" ] && echo $cfg | grep -q '\.chandev$' ; then
addfile "$cfg" "$CHANDEVTMPFILE"
- elif ! echo $cfg | grep -q '\(\.dpkg-[a-z]*\|~\)$' ; then
+ elif ! echo $cfg | grep -q '\(\.dpkg-\|[~#]\|\.tmp\)$'
+ then
addfile "$cfg" "$MODCONFTMPFILE"
fi
fi