From b27927724a5da017796d16de47979116d01455dc Mon Sep 17 00:00:00 2001 From: jnqnfe Date: Thu, 5 Feb 2015 03:30:47 +0000 Subject: locks: tidy lock acquisition Combine the check+create done in each script. (The original functions are still callable as before, but a new combined `Aquire_lockfile` function can be called instead, as now used). Note, a further simplification could be done in removing the passing of the lock filename in as a parameter since every use of the functions is with ".lock". The lock functions already have a fallback to ".build/lock" though. Checking the history, the fallback used to be for a system wide lock, which was then replaced with this config-tree specific one. As long as that is not used implicitly by 3rd-party hooks then surely we are free to change the fallback to ".lock" and further remove passing in a name as a param...? history: db5d2b0dcdae96e712661605e17bc9875e224f9f 0aa8289a3773fd8a3885090b72622c2f95ab099c Gbp-Dch: Short Closes: #952918 --- scripts/build/chroot_archives | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'scripts/build/chroot_archives') diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index b602caf4b..2457b534d 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -38,11 +38,8 @@ case "${1}" in # Checking stage file Check_stagefile .build/chroot_archives - # Checking lock file - Check_lockfile .lock - - # Creating lock file - Create_lockfile .lock + # Aquire lock file + Acquire_lockfile # Restoring cache Restore_package_cache chroot @@ -321,11 +318,8 @@ case "${1}" in remove) Echo_message "Deconfiguring file /etc/apt/sources.list" - # Checking lock file - Check_lockfile .lock - - # Creating lock file - Create_lockfile .lock + # Aquire lock file + Acquire_lockfile # Restore top-level sources if [ -e chroot/etc/apt/sources.list.d/zz-sources.list ] -- cgit v1.2.3