dom0+vm: use qubes_download_dom0_updates.sh instead of qubes_check_for_updates.sh
Remove code duplication. Implemented required --check-only option to qubes_download_dom0_updates.sh.
This commit is contained in:
parent
0970a2490c
commit
bdf407b716
@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates
|
|
||||||
|
|
||||||
if ! [ -d "$DOM0_UPDATES_DIR" ]; then
|
|
||||||
echo "Dom0 updates dir does not exists: $DOM0_UPDATES_DIR" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $DOM0_UPDATES_DIR/etc
|
|
||||||
sed -i '/^reposdir\s*=/d' $DOM0_UPDATES_DIR/etc/yum.conf
|
|
||||||
|
|
||||||
# check also for template updates
|
|
||||||
echo "Checking for template updates..." >&2
|
|
||||||
TEMPLATEPKGLIST=`yum check-update -q | cut -f 1 -d ' '`
|
|
||||||
echo "template:$TEMPLATEPKGLIST"
|
|
||||||
|
|
||||||
echo "Checking for dom0 updates..." >&2
|
|
||||||
PKGLIST=`yum --installroot $DOM0_UPDATES_DIR check-update -q | cut -f 1 -d ' '`
|
|
||||||
echo "dom0:$PKGLIST"
|
|
@ -5,6 +5,7 @@ DOM0_UPDATES_DIR=/var/lib/qubes/dom0-updates
|
|||||||
DOIT=0
|
DOIT=0
|
||||||
GUI=1
|
GUI=1
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
|
CHECK_ONLY=0
|
||||||
OPTS="--installroot $DOM0_UPDATES_DIR"
|
OPTS="--installroot $DOM0_UPDATES_DIR"
|
||||||
PKGLIST=
|
PKGLIST=
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
@ -18,6 +19,9 @@ while [ -n "$1" ]; do
|
|||||||
--clean)
|
--clean)
|
||||||
CLEAN=1
|
CLEAN=1
|
||||||
;;
|
;;
|
||||||
|
--check-only)
|
||||||
|
CHECK_ONLY=1
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
OPTS="$OPTS $1"
|
OPTS="$OPTS $1"
|
||||||
;;
|
;;
|
||||||
@ -48,6 +52,15 @@ else
|
|||||||
PKGS_FROM_CMDLINE=1
|
PKGS_FROM_CMDLINE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$CHECK_ONLY" = "1" ]; then
|
||||||
|
# check also for template updates
|
||||||
|
echo "Checking for template updates..." >&2
|
||||||
|
TEMPLATEPKGLIST=`yum check-update -q | cut -f 1 -d ' '`
|
||||||
|
echo "template:$TEMPLATEPKGLIST"
|
||||||
|
echo "dom0:$PKGLIST"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$PKGLIST" ]; then
|
if [ -z "$PKGLIST" ]; then
|
||||||
# No new updates
|
# No new updates
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -81,7 +81,6 @@ cp qubes_memory.rules $RPM_BUILD_ROOT/etc/udev/rules.d/50-qubes_memory.rules
|
|||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
|
cp setup_ip $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
cp qubes_download_dom0_updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/
|
cp qubes_download_dom0_updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||||
cp qubes_check_for_updates.sh $RPM_BUILD_ROOT/usr/lib/qubes/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/yum/post-actions
|
mkdir -p $RPM_BUILD_ROOT/etc/yum/post-actions
|
||||||
cp qubes_trigger_sync_appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/
|
cp qubes_trigger_sync_appmenus.action $RPM_BUILD_ROOT/etc/yum/post-actions/
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
|
||||||
@ -247,5 +246,4 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/etc/yum/post-actions/qubes_trigger_sync_appmenus.action
|
/etc/yum/post-actions/qubes_trigger_sync_appmenus.action
|
||||||
/usr/lib/qubes/qubes_trigger_sync_appmenus.sh
|
/usr/lib/qubes/qubes_trigger_sync_appmenus.sh
|
||||||
/usr/lib/qubes/qubes_download_dom0_updates.sh
|
/usr/lib/qubes/qubes_download_dom0_updates.sh
|
||||||
/usr/lib/qubes/qubes_check_for_updates.sh
|
|
||||||
/lib/firmware/updates
|
/lib/firmware/updates
|
||||||
|
Loading…
Reference in New Issue
Block a user