Browse Source

sde-download: cleaned altdir handling and removed legacy "temporal" compatibility

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
3cc523441e
1 changed files with 10 additions and 17 deletions
  1. +10
    -17
      bin/sde-download

+ 10
- 17
bin/sde-download

@ -335,30 +335,23 @@ download_file() {
# Alternative Directory
#
if [ "$altdir" ] ; then
if [ -d "$altdir" ] ; then
altfile=$(find -L "$altdir/" -name `basename $bzfile` | head -n 1)
else
altfile=
fi
#FIXME: compatibility, can be removed sooner or later...
# Check old download dir layout
if [ -z "$altfile" ]; then
if [ -f "download/$repo${pkg:+/}$pkg/`basename $bzfile`" ]; then
altfile="download/$repo${pkg:+/}$pkg/`basename $bzfile`"
fi
fi
if [ "$altfile" ] ; then
if [ -s "$altfile" ] ; then
echo "Found `basename $bzfile` as $altfile."
if [ "$altcopy" = 'link' ]; then
cp -lv $altfile $bzfile
elif [ "$altcopy" = 'copy' ]; then
cp -v $altfile $bzfile
elif [ "$altcopy" = 'move' ]; then
mv -v $altfile $bzfile
fi
case "$altcopy" in
copy)
cp -v "$altfile" "$bzfile" ;;
move)
mv -v "$altfile" "$bzfile" ;;
*) #link
cp -lv "$altfile" "$bzfile" ;;
esac
gzfile="$bzfile"
else

Loading…
Cancel
Save