OpenMediaVault-Plugin-Developers / installScript

script that installs omv-extras and openmediavault if not installed already.
1.1k stars 207 forks source link

fix "fix5to6upgrade" script with correct repos "sed" command #101

Closed morganfw closed 1 year ago

morganfw commented 2 years ago

Please fix "fix5to6upgrade" script for RPi Bullseye repos.

From:

echo "Change to bullseye and shaitan just in case ..."
sed -i "s/buster/bullseye/g" /etc/apt/sources.list
sed -i "s/buster/bullseye/g" /etc/apt/sources.list.d/*
sed -i "s/usul/shaitan/g" /etc/apt/sources.list.d/*

if [ -f /etc/apt/apt.conf ]; then
  echo "Changing apt.conf ..."
  sed -i "s/buster/bullseye/g" /etc/apt/apt.conf
fi

To:

echo "Change to bullseye and shaitan just in case ..."
sed -i "s/buster/bullseye/g" /etc/apt/sources.list
sed -i "s/buster/bullseye/g" /etc/apt/sources.list.d/*
sed -i "s/usul/shaitan/g" /etc/apt/sources.list.d/*

if [ -f /etc/apt/sources.list.d/openmediavault-os-security.list ]; then
  echo "Changing openmediavault-os-security.list ..."
  sed -i "s/bullseye/bullseye-security/g" /etc/apt/sources.list.d/openmediavault-os-security.list
fi

if [ -f /etc/apt/apt.conf ]; then
  echo "Changing apt.conf ..."
  sed -i "s/buster/bullseye/g" /etc/apt/apt.conf
fi

Thanks

ryecoaaron commented 2 years ago

The proper thing to do is delete the file and let saltstack recreate it. Since the omv release upgrade scripts are already deleting it (https://github.com/openmediavault/openmediavault/blob/5.x/deb/openmediavault/usr/share/openmediavault/release-upgrade/pre.d/20-apt-update-source-list#L49), I don't see much of a reason to try and fix it. If any thing the file should be deleted. security updates could be installed once everything is updated and working.