mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-24 00:38:51 -05:00
Replace usage of "cp -s" with the more portable "ln -s"
The "-s" argument does not exist on BSD, and neither does "--remove-destination". This patch replaces the calls to "cp -s --remove-destination" with the equivalent "rm -f" and "ln -s" calls, in order to increase portability. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
bf2964dc58
commit
1d71079c5b
@ -435,11 +435,13 @@ download_sources() {
|
|||||||
local file=$(strip_url "$netfile")
|
local file=$(strip_url "$netfile")
|
||||||
if [ -f "$startdir/$file" ]; then
|
if [ -f "$startdir/$file" ]; then
|
||||||
msg2 "$(gettext "Found %s in build dir")" "$file"
|
msg2 "$(gettext "Found %s in build dir")" "$file"
|
||||||
cp -s --remove-destination "$startdir/$file" "$srcdir/"
|
rm -f "$srcdir/$file"
|
||||||
|
ln -s "$startdir/$file" "$srcdir/"
|
||||||
continue
|
continue
|
||||||
elif [ -f "$SRCDEST/$file" ]; then
|
elif [ -f "$SRCDEST/$file" ]; then
|
||||||
msg2 "$(gettext "Using cached copy of %s")" "$file"
|
msg2 "$(gettext "Using cached copy of %s")" "$file"
|
||||||
cp -s --remove-destination "$SRCDEST/$file" "$srcdir/"
|
rm -f "$srcdir/$file"
|
||||||
|
ln -s "$SRCDEST/$file" "$srcdir/"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -464,7 +466,8 @@ download_sources() {
|
|||||||
if echo "$dlclient" | grep -q "%o" ; then
|
if echo "$dlclient" | grep -q "%o" ; then
|
||||||
mv -f "$SRCDEST/$file.part" "$SRCDEST/$file"
|
mv -f "$SRCDEST/$file.part" "$SRCDEST/$file"
|
||||||
fi
|
fi
|
||||||
cp -s --remove-destination "$SRCDEST/$file" "$srcdir/"
|
rm -f "$srcdir/$file"
|
||||||
|
ln -s "$SRCDEST/$file" "$srcdir/"
|
||||||
done
|
done
|
||||||
|
|
||||||
popd &>/dev/null
|
popd &>/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user