Allow installation of TA before tef-simulator 37/245037/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 29 Sep 2020 10:59:46 +0000 (12:59 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 29 Sep 2020 11:06:42 +0000 (13:06 +0200)
Until now the TA directory with all existing TA's was being removed on first
tef-simulator installation. As a result the sesion to installed TA's could not
be opened.

To avoid potential problems resulting from incorrect installation order, save
existing TA's before recreating the TA store link.

Change-Id: I5707a547fa384f9eaab0a5b4ddc40afe53bf7161

packaging/tef-simulator.spec

index 169be7c7a18b0e4cb175c502c4b8a550a1d5d158..01f6c963dc88e55ad3173ee339b5676c2f98013f 100644 (file)
@@ -113,8 +113,19 @@ if [ $1 -gt 1 ] ; then
 fi
 
 %post
-# do it always in case the path was changed
-rm -rf %{link_tastore_dir}
+
+if [ -d %{link_tastore_dir} ]
+then
+    # move existing TAs to the correct dir unless link already points to it
+    if [ `readlink -f %{link_tastore_dir}` != `readlink -f %{tastore_dir}` ]
+    then
+        mv -v %{link_tastore_dir}/* %{tastore_dir}/
+    fi
+
+    # do it always in case the target path was changed
+    rm -rf %{link_tastore_dir}
+fi
+
 mkdir -p `dirname %{link_tastore_dir}`
 ln -sf %{tastore_dir} %{link_tastore_dir}