[arch-projects] [devtools][PATCH] checkpkg: Use symlinks in work directory instead of copying the packages
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> --- checkpkg | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/checkpkg b/checkpkg index c349795..1e3d5aa 100755 --- a/checkpkg +++ b/checkpkg @@ -39,9 +39,9 @@ for _pkgname in ${pkgname[@]}; do fi if [ -f "$STARTDIR/$pkgfile" ]; then - cp "$STARTDIR/$pkgfile" . + ln -s "$STARTDIR/$pkgfile" "$pkgfile" elif [ -f "$PKGDEST/$pkgfile" ]; then - cp "$PKGDEST/$pkgfile" . + ln -s "$PKGDEST/$pkgfile" "$pkgfile" else echo "File \"$pkgfile\" doesn't exist" exit 1 @@ -65,11 +65,12 @@ for _pkgname in ${pkgname[@]}; do if [ ! -f $oldpkg ]; then if echo $pkgurl | grep '^file:///' > /dev/null 2>&1; then - cp $(echo $pkgurl | sed 's#^file://##') . + fullname=$(echo $pkgurl | sed 's#^file://##') + ln -s "$fullname" $(basename "$fullname") elif [ -f "$PKGDEST/$oldpkg" ]; then - cp "$PKGDEST/$oldpkg" . + ln -s "$PKGDEST/$oldpkg" "$oldpkg" elif [ -f "$STARTDIR/$oldpkg" ]; then - cp "$STARTDIR/$oldpkg" . + ln -s "$STARTDIR/$oldpkg" "$oldpkg" else wget --quiet $pkgurl fi -- 1.7.6
On Sun, 7 Aug 2011 00:09:35 -0400, Eric Bélanger wrote: + fullname=$(echo $pkgurl | sed 's#^file://##') You can replace this with this bash internal syntax: fullname=${pkgurl#file://} Kind regards, Andrwe
On Mon, Aug 8, 2011 at 5:15 AM, Andrwe <archlinux@andrwe.org> wrote:
On Sun, 7 Aug 2011 00:09:35 -0400, Eric Bélanger wrote:
+ fullname=$(echo $pkgurl | sed 's#^file://##')
You can replace this with this bash internal syntax: fullname=${pkgurl#file://}
Kind regards, Andrwe
Thanks. I just sent a new patch.
participants (2)
-
Andrwe
-
Eric Bélanger