Verified Commit ca80ded4 authored by Karel Koci's avatar Karel Koci 🤘 Committed by Karel Koci

localrepo: drop content2localrepo

This script was required for migration between old versions of Turris OS
3.x. This is no longer required on Turris OS 4.x.
parent dc0d9766
#!/bin/sh
# Simple script for migration from Content to localrepo
set -ex
# Because we no way depend on updater-ng it self we can be easily installed before
# or after it. So if we are migrating in version 60 auto.lua to opkg-auto.lua we
# can encounter both cases. So here check which one we have with preference on new
# place.
if [ -f "/etc/updater/conf.d/opkg-auto.lua" ]; then
UPDATER_CONFIG="/etc/updater/conf.d/opkg-auto.lua"
elif [ -f "/etc/updater/auto.lua" ]; then
UPDATER_CONFIG="/etc/updater/auto.lua"
else
# No automatic configuration file. This is ok if this is clean new install
exit 0
fi
# Add all content packages to localrepo
sed -n 's/^Package.*content *= *"file:\/\/\([^"]*\)".*/\1/p' "$UPDATER_CONFIG" | \
while read PKG; do
localrepo add --repo auto "$PKG"
done
# Clean localrepo from unused packages
localrepo clean --repo auto
# Drop all lines added because of package content
sed -i '/^Package.*content/d' "$UPDATER_CONFIG"
# And remove local store
rm -rf /usr/share/updater/local-pkgs
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