]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
zypper: Enable autorefresh with refresh delay of 48h 2179/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 14 Dec 2023 18:15:21 +0000 (19:15 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 14 Dec 2023 21:31:38 +0000 (22:31 +0100)
Instead of never refreshing repository metadata, let's refresh
every 48h, which is the same default that dnf uses.

mkosi/installer/zypper.py

index 8d8797f3a73c9c8f9228562880f043a1f6e72501..6197aab93c63cc7c9036b12051113f5b11cea866 100644 (file)
@@ -15,13 +15,15 @@ def setup_zypper(state: MkosiState, repos: Sequence[RpmRepository]) -> None:
     config.parent.mkdir(exist_ok=True, parents=True)
 
     # rpm.install.excludedocs can only be configured in zypp.conf so we append
-    # to any user provided config file.
+    # to any user provided config file. Let's also bump the refresh delay to
+    # the same default as dnf which is 48 hours.
     with config.open("a") as f:
         f.write(
             textwrap.dedent(
                 f"""
                 [main]
                 rpm.install.excludedocs = {yes_no(not state.config.with_docs)}
+                repo.refresh.delay = {48 * 60}
                 """
             )
         )
@@ -39,7 +41,7 @@ def setup_zypper(state: MkosiState, repos: Sequence[RpmRepository]) -> None:
                         {repo.url}
                         gpgcheck=1
                         enabled={int(repo.enabled)}
-                        autorefresh=0
+                        autorefresh=1
                         keeppackages=1
                         """
                     )