1
1

* extfs/uar.in: Simplify "list" command, don't use current year.

Use more careful quoting.
Этот коммит содержится в:
Pavel Roskin 2002-12-12 09:01:40 +00:00
родитель b1c7fda53b
Коммит a50ddb5450
2 изменённых файлов: 13 добавлений и 22 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2002-12-12 Pavel Roskin <proski@gnu.org>
* extfs/uar.in: Simplify "list" command, don't use current year.
Use more careful quoting.
2002-12-12 Adam Byrtek <alpha@debian.org>
* extfs/apt.in: Add non-interactive remove using dpkg.

Просмотреть файл

@ -7,45 +7,31 @@
# (C) 1997, 1998 The Free Software Foundation.
#
#
XAR=ar
XARINFO="ar tv"
AWK=awk
mcarfs_list ()
{
YEAR=`date '+%Y'`
$XARINFO $1 | @AWK@ -v year=$YEAR '
{
date = $(NF-1)
if(date == year) {
date = $(NF-2);
}
perms = substr($1, 1, 9);
split($2, id, "/");
if(NF > 8) {
id[2] = $3;
}
printf("-%9s 1 %8d %8d %8d %s %s %s %s\n", perms, id[1], id[2], $(NF-5), $(NF-4), $(NF-3), date, $(NF));
}' 2>/dev/null
$XAR tv "$1" | sed 's,^,-,;s, , 1 ,;s,/, ,'
}
mcarfs_copyout ()
{
$XAR p $1 $2 > $3
$XAR p "$1" "$2" > "$3"
}
mcarfs_copyin ()
{
TMPDIR=/tmp/mctmpdir-uar.$$
mkdir $TMPDIR || exit 1
name=`basename $2`
(cd $TMPDIR && cp -f $3 $name && $XAR r $1 $name)
name=`basename "$2"`
(cd $TMPDIR && cp -f "$3" $name && $XAR r "$1" $name)
rm -rf $TMPDIR
}
mcarfs_rm ()
{
$XAR d $1 $2
$XAR d "$1" "$2"
}
# override any locale for dates
@ -54,7 +40,7 @@ export LC_ALL
umask 077
case "$1" in
list) mcarfs_list $2 ;;
list) mcarfs_list "$2" ;;
copyout) shift; mcarfs_copyout "$@" ;;
copyin) shift; mcarfs_copyin "$@" ;;
rm) shift; mcarfs_rm "$@" ;;