]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
CI: fix handling of sources.list
authorSerge Hallyn <serge@hallyn.com>
Thu, 31 Oct 2024 03:06:44 +0000 (22:06 -0500)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 31 Oct 2024 08:46:51 +0000 (09:46 +0100)
Closes #1088

We can't be sure whether a github runner will have new- or old-
style sources.list, so check whether the new exists, else use
the old style.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
.github/actions/install-dependencies/action.yml

index 2dd0f8ee8db2ca25a13adb1505bfb8d537b13ade..e0fb53fcf9e00e85f76c1c59208ef04ea16606cb 100644 (file)
@@ -5,8 +5,16 @@ runs:
   steps:
   - shell: bash
     run: |
-      cat /etc/apt/sources.list.d/ubuntu.sources
-      sudo sed -i 's/^Types: deb/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
+      if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
+        echo "Found new-style sources.list.d"
+        cat /etc/apt/sources.list.d/ubuntu.sources
+        sudo sed -i 's/^Types: deb/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
+      else
+        echo "Found legacy sources.list"
+        cat /etc/apt/sources.list
+        sudo sed -i '/deb-src/d' /etc/apt/sources.list
+        sudo sed -i '/^deb /p;s/ /-src /' /etc/apt/sources.list
+      fi
       export DEBIAN_PRIORITY=critical
       export DEBIAN_FRONTEND=noninteractive
       # let's try to work around upgrade breakage in a pkg we don't care about