diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-11-20 21:29:47 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-11-20 21:29:47 +0100 |
commit | a2cdd819ed32cd4ccfefab2c2ce0ead118f9772d (patch) | |
tree | 70733eaa05cb29e7c3be64f11243e7d881c27c63 /cron-jobs | |
parent | 7edb6b55cbacbc32c0234026df38401a60561dc7 (diff) |
sourceballs: Lock the repo while reading the db file
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/sourceballs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 1add36e..351b06d 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -21,9 +21,16 @@ for repo in ${PKGREPOS[@]}; do warning "DB file does not exist: ${dbfile}" continue fi - for pkg in $(bsdtar -xOf "${dbfile}" \ - | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ - | sort -u); do + + repo_lock ${repo} ${arch} || exit 1 + # Read packages from db file + # Format is: <pkgbase|pkgname>/<pkgver>-<pkgrel> + pkgs=($(bsdtar -xOf "${dbfile}" \ + | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s ", b, v}' \ + | sort -u)) + repo_unlock ${repo} ${arch} + + for pkg in ${pkgs[@]}; do pkgbase=${pkg%/*} pkgver=${pkg#*/} srcpkg="${pkgbase}-${pkgver}${SRCEXT}" |