fixes
[distro-setup] / distro-end
index dcf919893dab0ae2946d9c52c60433a9ca21addc..5378579e302561e7e00896fb13ded2c09fa979cc 100755 (executable)
@@ -333,7 +333,7 @@ EOF
 esac
 
 case $codename_compat in
-  jammy)
+  jammy|noble)
     s systemctl enable --now ssh-agent-iank
     ;;
 esac
@@ -752,7 +752,17 @@ EOF
       # s fwupdmgr get-updates
       # says I have 3 "devices with no available firmware updates"
       # if there were updates, install with: s fwupdmgr update
+
+      check_downgrade=false
+      if [[ ! -e /etc/apt/preferences.d/system76-apt-preferences ]]; then
+        check_downgrade=true
+      fi
       pi system76-firmware system76-driver fwupd
+      if $check_downgrade && [[ -e /etc/apt/preferences.d/system76-apt-preferences ]]; then
+        # driver installs a preferences file to give s76 packages
+        # priority so we may need to downgrade here.
+        pup --allow-downgrades
+      fi
       # system76-driver: on a modern kernel, it seems to mainly just do
       # some power settings, I haven't looked entirely through it. it
       # might also change fan speed. Of its recommended packages,
@@ -934,13 +944,16 @@ case $distro in
   ubuntu)
     case $codename in
       noble)
-        # mint firefox has a dependency which is totally not really
-        # needed, just some mint branding and maybe a random firefox
-        # setting.
-        tmpdir="$(mktemp -d)"
-        cd "$tmpdir"
-        # edited from output of equivs-control ubuntu-system-adjustments
-        cat >ubuntu-system-adjustments <<'EOF'
+        if pcheck ubuntu-system-adjustments; then
+          # mint firefox has a dependency which is totally not really
+          # needed, just some mint branding and maybe a random firefox
+          # setting.
+          tmpdir="$(mktemp -d)"
+          # it puts the deb in .., so use a subdir to stay contained
+          mkdir $tmpdir/sub
+          cd "$tmpdir/sub"
+          # edited from output of equivs-control ubuntu-system-adjustments
+          cat >ubuntu-system-adjustments <<'EOF'
 Section: misc
 Priority: optional
 Version: 2030
@@ -948,11 +961,11 @@ Standards-Version: 3.9.2
 Package: ubuntu-system-adjustments
 Description: ubuntu-system-adjustments-dummy
 EOF
-        equivs-build ubuntu-system-adjustments
-        sudo dpkg -i ubuntu-system-adjustments_2030_all.deb
-        rm -rf ./ubuntu-system-adjustments*
-        cd
-        rm -r "$tmpdir"
+          equivs-build ubuntu-system-adjustments
+          sudo dpkg -i ../ubuntu-system-adjustments_2030_all.deb
+          cd
+          rm -r "$tmpdir"
+        fi
         ;;
     esac
     pi firefox
@@ -1799,22 +1812,24 @@ rm -rf /home/iank/.mpv
 
 case $(debian-codename) in
   aramo)
-    tmpdir="$(mktemp -d)"
-    cd "$tmpdir"
-    # edited from output of equivs-control tox
-    cat >tox <<'EOF'
+    if pcheck tox; then
+      tmpdir="$(mktemp -d)"
+      cd "$tmpdir"
+      # edited from output of equivs-control tox
+      cat >tox <<'EOF'
 Section: python
 Priority: optional
 Standards-Version: 3.9.2
 Package: tox
 Description: tox-dummy
 EOF
-    equivs-build tox
-    sudo dpkg -i tox_1.0_all.deb
-    rm -rf ./tox*
-    pi beets python3-discogs-client
-    cd
-    rm -r "$tmpdir"
+      equivs-build tox
+      sudo dpkg -i tox_1.0_all.deb
+      rm -rf ./tox*
+      pi beets
+      cd
+      rm -r "$tmpdir"
+    fi
     ;;
 esac