Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-11-08 13:51:59 +0300
committernachoparker <nacho@ownyourbits.com>2017-11-08 20:16:24 +0300
commit8dbd28246b6fba1cf9342f531c0356ef156765ce (patch)
treed439087c1ed1ef601062c01ec26e6c82b108a5f6
parent01a33d4317959de46ed2cfac4a636167132cf77b (diff)
update: wait running apt processesv0.32.5
-rw-r--r--build-devel.sh8
-rw-r--r--buildlib.sh16
-rwxr-xr-xupdate.sh4
3 files changed, 11 insertions, 17 deletions
diff --git a/build-devel.sh b/build-devel.sh
index e37bf687..d0188e9c 100644
--- a/build-devel.sh
+++ b/build-devel.sh
@@ -17,7 +17,13 @@
# this is a replica of ncp-update, but from devel branch
install()
{
- test -f /etc/apt/apt.conf.d/20nextcloudpi-upgrades && { echo "deactivate unattended upgrades first"; return 1; }
+ # wait for other apt processes
+ test -f /var/lib/apt/lists/lock && echo "waiting for apt processes to finish..." && \
+ while :; do
+ test -f /var/lib/apt/lists/lock && break
+ sleep 1
+ done
+
echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
git clone --depth 20 -q -b devel https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp
diff --git a/buildlib.sh b/buildlib.sh
index 503c7572..42352f7c 100644
--- a/buildlib.sh
+++ b/buildlib.sh
@@ -143,22 +143,6 @@ function copy_to_image()
rmdir tmpmnt &>/dev/null
}
-function deactivate_unattended_upgrades()
-{
- local IMG=$1
- local SECTOR
- local OFFSET
- SECTOR=$( fdisk -l "$IMG" | grep Linux | awk '{ print $2 }' )
- OFFSET=$(( SECTOR * 512 ))
-
- [ -f "$IMG" ] || { echo "no image"; return 1; }
- mkdir -p tmpmnt
- sudo mount "$IMG" -o offset="$OFFSET" tmpmnt || return 1
- sudo rm -f tmpmnt/etc/apt/apt.conf.d/20nextcloudpi-upgrades
- sudo umount -l tmpmnt
- rmdir tmpmnt &>/dev/null
-}
-
function download_resize_raspbian_img()
{
local SIZE=$1
diff --git a/update.sh b/update.sh
index bbae5928..08d0af44 100755
--- a/update.sh
+++ b/update.sh
@@ -49,6 +49,10 @@ EXCL_DOCKER+="
nc-update.sh
nc-autoupdate-ncp.sh
"
+
+# wait for other apt processes
+test -f /var/lib/apt/lists/lock && { echo "apt is currently running. Try again later"; exit 1; }
+
cp etc/library.sh /usr/local/etc/
source /usr/local/etc/library.sh