mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
update: wait running apt processes
This commit is contained in:
parent
01a33d4317
commit
8dbd28246b
@ -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
|
||||
|
||||
16
buildlib.sh
16
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user