Merge branch 'master' of git://git.qubes-os.org/marmarek/core-admin-linux
This commit is contained in:
commit
38b1845e97
@ -10,7 +10,7 @@ qubes-dom0-update - update software in dom0
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
========
|
========
|
||||||
| qubes-dom0-update [--clean] [--check-only] [--gui] [<pkg list>]
|
| qubes-dom0-update [--clean] [--check-only] [--gui] [<yum opts>] [<pkg list>]
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
=======
|
=======
|
||||||
@ -24,6 +24,10 @@ OPTIONS
|
|||||||
<pkg list>
|
<pkg list>
|
||||||
Download (and install if run by root) new packages in dom0 instead of updating
|
Download (and install if run by root) new packages in dom0 instead of updating
|
||||||
|
|
||||||
|
Besides above options, when no --gui or --check-only given, all other options
|
||||||
|
are passed to yum call. So for example --enablerepo/--disablerepo options works
|
||||||
|
as well.
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
=======
|
=======
|
||||||
| Joanna Rutkowska <joanna at invisiblethingslab dot com>
|
| Joanna Rutkowska <joanna at invisiblethingslab dot com>
|
||||||
|
@ -27,12 +27,15 @@ GUI=
|
|||||||
CHECK_ONLY=
|
CHECK_ONLY=
|
||||||
ALL_OPTS=$*
|
ALL_OPTS=$*
|
||||||
QVMRUN_OPTS=
|
QVMRUN_OPTS=
|
||||||
|
CLEAN=
|
||||||
# Filter out some yum options and collect packages list
|
# Filter out some yum options and collect packages list
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--enablerepo=*|\
|
--enablerepo=*|\
|
||||||
--disablerepo=*|\
|
--disablerepo=*)
|
||||||
|
;;
|
||||||
--clean)
|
--clean)
|
||||||
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
--gui)
|
--gui)
|
||||||
GUI=1
|
GUI=1
|
||||||
@ -71,6 +74,10 @@ if [ "$CHECK_ONLY" == "1" ] && ! xl domid $UPDATEVM > /dev/null 2>&1; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$CLEAN" ]; then
|
||||||
|
rm -f /var/lib/qubes/updates/rpm/*
|
||||||
|
fi
|
||||||
|
|
||||||
# We should ensure the clocks in Dom0 and UpdateVM are in sync
|
# We should ensure the clocks in Dom0 and UpdateVM are in sync
|
||||||
# becuase otherwise yum might complain about future timestamps
|
# becuase otherwise yum might complain about future timestamps
|
||||||
qvm-sync-clock
|
qvm-sync-clock
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
# Get normal user name
|
# Get normal user name
|
||||||
LOCAL_USER=`users | sed -e 's/root *//' | cut -d' ' -f 1`
|
LOCAL_USER=`users | sed -e 's/root *//' | cut -d' ' -f 1`
|
||||||
PIDFILE=/var/run/qubes/dom0-update-notification.pid
|
|
||||||
NOTIFY_ICON=/usr/share/qubes/icons/dom0-update-avail.svg
|
NOTIFY_ICON=/usr/share/qubes/icons/dom0-update-avail.svg
|
||||||
UPDATES_STAT_FILE=/var/lib/qubes/updates/dom0-updates-available
|
UPDATES_STAT_FILE=/var/lib/qubes/updates/dom0-updates-available
|
||||||
UPDATES_DISABLE_FLAG=/var/lib/qubes/updates/disable-updates
|
UPDATES_DISABLE_FLAG=/var/lib/qubes/updates/disable-updates
|
||||||
@ -11,13 +10,6 @@ if [ -f "$UPDATES_DISABLE_FLAG" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Do not allow multiple instances
|
|
||||||
[ -r $PIDFILE ] && kill -0 `cat $PIDFILE` && exit 0
|
|
||||||
# Teoretically the race can happen here, but this tool will be run once a few
|
|
||||||
# hours, so no real problem
|
|
||||||
echo $$ > $PIDFILE
|
|
||||||
trap "rm $PIDFILE" EXIT
|
|
||||||
|
|
||||||
# If no updates available - exit here
|
# If no updates available - exit here
|
||||||
qubes-dom0-update --check-only >/dev/null && exit
|
qubes-dom0-update --check-only >/dev/null && exit
|
||||||
RETCODE=$?
|
RETCODE=$?
|
||||||
@ -36,12 +28,4 @@ fi
|
|||||||
touch $UPDATES_STAT_FILE
|
touch $UPDATES_STAT_FILE
|
||||||
|
|
||||||
# Notify about updates using system tray
|
# Notify about updates using system tray
|
||||||
su -c 'DISPLAY=:0 zenity --notification --window-icon=$NOTIFY_ICON --text="Qubes dom0 updates available."' $LOCAL_USER
|
su -c 'DISPLAY=:0 notify-send -t 0 "Qubes dom0 updates available."' $LOCAL_USER
|
||||||
|
|
||||||
su -c 'DISPLAY=:0 zenity --question --title="Qubes Dom0 updates" \
|
|
||||||
--text="There are updates for dom0 available, do you want to download them now?"' $LOCAL_USER || exit 0
|
|
||||||
|
|
||||||
su -c "DISPLAY=:0 qubes-dom0-update --gui" $LOCAL_USER
|
|
||||||
|
|
||||||
# Check if user installed updates
|
|
||||||
yum -q check-updates && rm $UPDATES_STAT_FILE
|
|
||||||
|
Loading…
Reference in New Issue
Block a user