OSDN Git Service

1-install: update symlink if the linked dir is upgraded android-x86-7.1-r4 android-x86-7.1-r5
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 13 May 2020 05:24:32 +0000 (13:24 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 13 May 2020 05:24:32 +0000 (13:24 +0800)
install/scripts/1-install

index 1e39375..54401c4 100644 (file)
@@ -343,6 +343,9 @@ try_upgrade()
                prev=hd/$choice
                if [ -d "$prev" ]; then
                        mv $prev $1
+                       for d in `find hd -type l -maxdepth 1`; do
+                               [ "`readlink $d`" = "$choice" ] && ln -sf `basename $1` $d
+                       done
                        rm -rf $1/data/dalvik-cache/* $1/data/system/wpa_supplicant
                        [ -s $1/data/misc/wifi/wpa_supplicant.conf ] && sed -i 's/\(ctrl_interface=\)\(.*\)/\1wlan0/' $1/data/misc/wifi/wpa_supplicant.conf
                fi