Commit 3d5cee70 authored by Matthias Klumpp's avatar Matthias Klumpp
Browse files

Automatically migrate PureOS 'green' to 'amber'

parent 9abc6b9d
......@@ -120,3 +120,20 @@ if [ "$1" = "configure" ] && [ "$2" != "" ]; then
install_directory mnt 755 root
fi
fi
# Migrate rolling PureOS 'green' to stable PureOS 'amber'
# We only ever even attempt to run this once (le-nl is intended)
if dpkg --compare-versions "$2" le-nl "10.1pureos6"; then
SOURCES_LIST=/etc/apt/sources.list
if [ -f "$SOURCES_LIST" ]; then
if grep -q "green" $SOURCES_LIST; then
# the sources.list file was not modified yet, migrate it,
# but first create a backup
echo "Migrating distribution from 'green' to 'amber'"
cp -f "$SOURCES_LIST" "$SOURCES_LIST.old"
sed -i 's/green/amber/g' "$SOURCES_LIST"
printf "deb https://repo.pureos.net/pureos/ amber-security main\ndeb https://repo.pureos.net/pureos/ amber-updates main\n" >> "$SOURCES_LIST"
fi
fi
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment