pandora-scripts: make op_osupgrade update .xinitrc
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 11 May 2016 00:05:01 +0000 (03:05 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 11 May 2016 00:05:01 +0000 (03:05 +0300)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_osupgrade_work.sh

index d710285..bbadf65 100644 (file)
@@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 
 RDEPENDS = "bash sed gawk grep zenity"
 
-PR = "r166"
+PR = "r167"
 
 SRC_URI = " \
           file://op_bright.sh \
index 2f4241e..deaa1fa 100755 (executable)
@@ -39,6 +39,20 @@ fi
 # finally run the upgrade itself
 opkg upgrade
 
+# update .xinitrc
+xinitrc="/home/$SUDO_USER/.xinitrc"
+if test -e "$xinitrc" && ! cmp -s /etc/skel/.xinitrc "$xinitrc"; then
+  # ... only from a known old version
+  known="5642b24d5d4570c6779807904506c162 b2cf2d45ef7f3bee9836105008c009a7"
+  md5=`md5sum "$xinitrc" | awk '{print $1}'`
+  for k in $known; do
+    if [ "$md5" = "$k" ]; then
+      cp -av /etc/skel/.xinitrc "$xinitrc"
+      break
+    fi
+  done
+fi
+
 # done
 touch /tmp/upgrade_ok
 sync