Browse Source

Fix downloading dom0 updates on Debian

When yumdownloader is used, it needs yum.conf. In Qubes 4.1 it isn't
there anymore, so symlink dnf.conf instead.

In Debian case, packages are downloaded directly to packages directory,
doesn't need to be extracted from cache. Redirect error message to
/dev/null for that.
Marek Marczykowski-Górecki 4 năm trước cách đây
mục cha
commit
ca659ef6df
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      misc/qubes-download-dom0-updates.sh

+ 5 - 1
misc/qubes-download-dom0-updates.sh

@@ -116,6 +116,10 @@ YUM_COMMAND="fakeroot $YUM $YUM_ACTION -y --downloadonly"
 # check for --downloadonly option - if not supported (Debian), fallback to
 # yumdownloader
 if ! $YUM --help | grep -q downloadonly; then
+    # setup environment for yumdownloader to be happy
+    if [ ! -e "$DOM0_UPDATES_DIR/etc/yum.conf" ]; then
+        ln -nsf dnf/dnf.conf "$DOM0_UPDATES_DIR/etc/yum.conf"
+    fi
     if [ "$YUM_ACTION" = "install" ]; then
         YUM_COMMAND="yumdownloader --destdir=$DOM0_UPDATES_DIR/packages --resolve"
     elif [ "$YUM_ACTION" = "upgrade" ]; then
@@ -162,7 +166,7 @@ else
     $YUM_COMMAND $OPTS "${PKGLIST[@]}"
 fi
 
-find "$DOM0_UPDATES_DIR/var/cache" -name '*.rpm' -print0 |\
+find "$DOM0_UPDATES_DIR/var/cache" -name '*.rpm' -print0 2>/dev/null |\
     xargs -0 -r ln -f -t "$DOM0_UPDATES_DIR/packages/"
 
 if ls "$DOM0_UPDATES_DIR"/packages/*.rpm > /dev/null 2>&1; then