mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 03:11:15 +02:00
zsh-workers/7707
This commit is contained in:
parent
d14fab7bd7
commit
b4958a1a60
2 changed files with 20 additions and 16 deletions
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if test -d $DESTDIR$fndir.old; then
|
fndir=$DESTDIR$fndir
|
||||||
|
|
||||||
|
if test -d $fndir.old; then
|
||||||
add_old=1
|
add_old=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$sdir_top/mkinstalldirs $DESTDIR$fndir || exit 1;
|
$sdir_top/mkinstalldirs $fndir || exit 1;
|
||||||
|
|
||||||
# If the source directory is somewhere else, we need to force
|
# If the source directory is somewhere else, we need to force
|
||||||
# the shell to expand it in that directory, then strip it off.
|
# the shell to expand it in that directory, then strip it off.
|
||||||
|
@ -22,17 +24,17 @@ for file in $install; do
|
||||||
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
||||||
subfile="$file"
|
subfile="$file"
|
||||||
subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
|
subdir="`echo $file | sed -e 's%/[^/]*$%%'`"
|
||||||
olddir="$DESTDIR$fndir.old/$subdir"
|
olddir="$fndir.old/$subdir"
|
||||||
instdir="$DESTDIR$fndir/$subdir"
|
instdir="$fndir/$subdir"
|
||||||
else
|
else
|
||||||
subfile="`echo $file | sed -e 's%^.*/%%'`"
|
subfile="`echo $file | sed -e 's%^.*/%%'`"
|
||||||
olddir="$DESTDIR$fndir.old"
|
olddir="$fndir.old"
|
||||||
instdir="$DESTDIR$fndir"
|
instdir="$fndir"
|
||||||
fi
|
fi
|
||||||
if test -f $DESTDIR$fndir/$subfile; then
|
if test -f $fndir/$subfile; then
|
||||||
if cmp $DESTDIR$fndir/$subfile $sdir/$file >/dev/null; then :; else
|
if cmp $fndir/$subfile $sdir/$file >/dev/null; then :; else
|
||||||
$sdir_top/mkinstalldirs $olddir
|
$sdir_top/mkinstalldirs $olddir
|
||||||
mv $DESTDIR$fndir/$subfile $olddir
|
mv $fndir/$subfile $olddir
|
||||||
: ${add_old:=1}
|
: ${add_old:=1}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -42,7 +44,7 @@ for file in $install; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if test x$add_old != x1; then
|
if test x$add_old != x1; then
|
||||||
rm -rf $DESTDIR$fndir.old
|
rm -rf $fndir.old
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -11,18 +11,20 @@ for file in $FUNCTIONS_INSTALL; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
fndir=$DESTDIR$fndir
|
||||||
|
|
||||||
for file in $install; do
|
for file in $install; do
|
||||||
if test -f $sdir/$file; then
|
if test -f $sdir/$file; then
|
||||||
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
if test x$FUNCTIONS_SUBDIRS != x -a x$FUNCTIONS_SUBDIRS != xno; then
|
||||||
rm -f $DESTDIR$fndir/$file;
|
rm -f $fndir/$file;
|
||||||
if test -f $DESTDIR$fndir.old/$file; then
|
if test -f $fndir.old/$file; then
|
||||||
mv $DESTDIR$fndir.old/$file $DESTDIR$fndir/$file
|
mv $fndir.old/$file $fndir/$file
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
bfile="`echo $file | sed -e 's%^.*/%%'`"
|
bfile="`echo $file | sed -e 's%^.*/%%'`"
|
||||||
rm -f "$DESTDIR$fndir/$bfile"; \
|
rm -f "$fndir/$bfile"; \
|
||||||
if test -f $DESTDIR$fndir.old/$bfile; then
|
if test -f $fndir.old/$bfile; then
|
||||||
mv $DESTDIR$fndir.old/$bfile $DESTDIR$fndir/$bfile
|
mv $fndir.old/$bfile $fndir/$bfile
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue