From 2d8cc96bf6eada340975827b8f631496da79e63b Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Fri, 5 May 2006 01:38:33 +0000 Subject: updates for multi-architecture support --- updatesync-many | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'updatesync-many') diff --git a/updatesync-many b/updatesync-many index 150cd66..3899632 100755 --- a/updatesync-many +++ b/updatesync-many @@ -2,8 +2,8 @@ # # updatesync-many # -# Copyright (c) 2004 by Jason Chu -# Derived from gensync (c) 2002-2006 Judd Vinet +# Copyright (c) 2004-2006 by Jason Chu and Judd Vinet +# Contact: and # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -189,6 +189,10 @@ update_entry() cd - >/dev/null } +if [ ! "`type -p lsof`" ]; then + echo "ERROR: lsof is needed to run updatesync-many!" + exit 1 +fi if [ $# -lt 3 ]; then usage @@ -225,6 +229,14 @@ tar zxf $PKGDB || die "error unpacking $PKGDB" # Process packages in the staging directory for pkgfile in $STAGEDIR/*.pkg.tar.gz; do + # Make sure this file isn't currently in use by any processes... + # This is our cheap way of (mostly) making sure the file isn't being + # uploaded at this very time (and thus incomplete). + # Of course, if an upload failed and the scp connection terminated, then + # this check will fail us. + lsof $pkgfile &>/dev/null + [ $? -ne 1 ] && continue + tmp=${pkgfile##*/} pkgname=${tmp%-*-*}; fullname=${tmp%.pkg.tar.gz} -- cgit v1.2.3-2-g168b