mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-10 06:14:22 +00:00
debian: fix config migration
This commit is contained in:
Vendored
+9
@@ -30,6 +30,15 @@ case "$1" in
|
|||||||
# set config file permissions not world readable as it may contain secrets
|
# set config file permissions not world readable as it may contain secrets
|
||||||
chown root:aptly-api /etc/aptly.conf
|
chown root:aptly-api /etc/aptly.conf
|
||||||
chmod 640 /etc/aptly.conf
|
chmod 640 /etc/aptly.conf
|
||||||
|
|
||||||
|
if [ -f /etc/aptly-api.conf.migrate ]; then
|
||||||
|
rootDir=`grep rootDir /etc/aptly-api.conf.migrate | sed 's_/var/lib/aptly-api_~_' | sed -n 's/.\+: "\([^"]\+\)".*/\1/p'`
|
||||||
|
if [ -n "$rootDir" ]; then
|
||||||
|
sed -i 's/\(.*"rootDir": "\)[^"]*\(".*\)/\1'$rootDir'\2/' /etc/aptly.conf
|
||||||
|
fi
|
||||||
|
echo "backing up /etc/aptly-api.conf to /etc/aptly-api.conf.old..."
|
||||||
|
mv /etc/aptly-api.conf.migrate /etc/aptly-api.conf.old
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
|||||||
Vendored
+2
-4
@@ -16,10 +16,8 @@ set -e
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
install|upgrade)
|
install|upgrade)
|
||||||
if [ -f /etc/aptly-api.conf ]; then
|
if [ -f /etc/aptly-api.conf ]; then
|
||||||
echo "migrating /etc/aptly-api.conf to /etc/aptly.conf ..."
|
echo "migrating /etc/aptly-api.conf ..."
|
||||||
cp /etc/aptly-api.conf /etc/aptly.conf
|
mv /etc/aptly-api.conf /etc/aptly-api.conf.migrate
|
||||||
mv /etc/aptly-api.conf /etc/aptly-api.conf.old
|
|
||||||
sed -i 's_/var/lib/aptly-api_~/.aptly_' /etc/aptly.conf
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user