force the linking
authorRudolf Polzer <divverent@alientrap.org>
Fri, 7 Jan 2011 22:56:38 +0000 (23:56 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 7 Jan 2011 22:56:38 +0000 (23:56 +0100)
misc/tools/cached-converter.sh

index 06433d0856783deb4e1863eb87063e21d84fef8b..d50348fcc162578cf6c8fca72d14f89a5831018c 100755 (executable)
@@ -76,14 +76,14 @@ cached()
        tempfile1="${name1%/*}/new-${name1##*/}"
        [ -z "$outfile2" ] || tempfile2="${name2%/*}/new-${name2##*/}"
        if [ -f "$name1" ] && { [ -z "$outfile2" ] || [ -f "$name2" ]; }; then
-               case "$outfile1" in */*) mkdir -p "${outfile1%/*}"; esac && { ln "$name1" "$outfile1" 2>/dev/null || cp "$name1" "$outfile1"; }
-               [ -z "$outfile2" ] || { case "$outfile2" in */*) mkdir -p "${outfile2%/*}"; esac && { ln "$name2" "$outfile2" 2>/dev/null || cp "$name2" "$outfile2"; }; }
+               case "$outfile1" in */*) mkdir -p "${outfile1%/*}"; esac && { ln -f "$name1" "$outfile1" 2>/dev/null || cp "$name1" "$outfile1"; }
+               [ -z "$outfile2" ] || { case "$outfile2" in */*) mkdir -p "${outfile2%/*}"; esac && { ln -f "$name2" "$outfile2" 2>/dev/null || cp "$name2" "$outfile2"; }; }
                conv=true
        elif "$method" "$infile1" "$infile2" "$tempfile1" "$tempfile2" "$@"; then
                mv "$tempfile1" "$name1"
                [ -z "$outfile2" ] || mv "$tempfile2" "$name2"
-               case "$outfile1" in */*) mkdir -p "${outfile1%/*}"; esac && { ln "$name1" "$outfile1" 2>/dev/null || cp "$name1" "$outfile1"; }
-               [ -z "$outfile2" ] || { case "$outfile2" in */*) mkdir -p "${outfile2%/*}"; esac && { ln "$name2" "$outfile2" 2>/dev/null || cp "$name2" "$outfile2"; }; }
+               case "$outfile1" in */*) mkdir -p "${outfile1%/*}"; esac && { ln -f "$name1" "$outfile1" 2>/dev/null || cp "$name1" "$outfile1"; }
+               [ -z "$outfile2" ] || { case "$outfile2" in */*) mkdir -p "${outfile2%/*}"; esac && { ln -f "$name2" "$outfile2" 2>/dev/null || cp "$name2" "$outfile2"; }; }
                conv=true
        else
                rm -f "$tempfile1"