summaryrefslogtreecommitdiffstats
path: root/syncrepo
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-04-14 20:19:09 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-04-14 20:29:19 +0200
commit67d6c8fbc081c58d92d78908459552603bcf6880 (patch)
tree569946c7ba7c4079d0dca233e955621e61da326f /syncrepo
parent8b6bbd57742623dbf1900e3212ca719de465a97f (diff)
downloadrepo-tools-67d6c8fbc081c58d92d78908459552603bcf6880.tar.gz
repo-tools-67d6c8fbc081c58d92d78908459552603bcf6880.tar.xz
remove lock when script exits
Signed-off-by: Florian Pritz <bluewind@xssn.at> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'syncrepo')
-rwxr-xr-xsyncrepo3
1 files changed, 1 insertions, 2 deletions
diff --git a/syncrepo b/syncrepo
index 1803b8c..f8975ff 100755
--- a/syncrepo
+++ b/syncrepo
@@ -9,6 +9,7 @@ repos='core,extra,testing,community,community-testing'
[ ! -d "${target}" ] && exit 1
[ -f "${lock}" ] && exit 1
touch "${lock}"
+trap "rm -f '${lock}'" EXIT INT TERM
rsync -rptlv --safe-links --delete --progress -h \
--include='*/' \
@@ -25,5 +26,3 @@ rsync -rptlv --safe-links --delete --progress -h \
--exclude='lastsync' \
${source}/{${repos}} \
"${target}"
-
-rm -f "${lock}"