diff options
author | Judd Vinet <judd@archlinux.org> | 2006-05-05 03:38:33 +0200 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2006-05-05 03:38:33 +0200 |
commit | 2d8cc96bf6eada340975827b8f631496da79e63b (patch) | |
tree | 71d8cbf87f55dc14f29b3984cb9721b9f5a55d4d /updatesync-many | |
parent | f3d8a756a29d26d91bfe191e717b2a656d39c176 (diff) | |
download | dbscripts-2d8cc96bf6eada340975827b8f631496da79e63b.tar.gz dbscripts-2d8cc96bf6eada340975827b8f631496da79e63b.tar.xz |
updates for multi-architecture support
Diffstat (limited to 'updatesync-many')
-rwxr-xr-x | updatesync-many | 16 |
1 files changed, 14 insertions, 2 deletions
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 <jason@archlinux.org> -# Derived from gensync (c) 2002-2006 Judd Vinet <jvinet@zeroflux.org> +# Copyright (c) 2004-2006 by Jason Chu and Judd Vinet +# Contact: <jason@archlinux.org> and <jvinet@zeroflux.org> # # 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} |