Fix pkgmgr-create-delta.sh.in 96/68896/1
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 9 May 2016 15:41:21 +0000 (17:41 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Tue, 10 May 2016 08:28:21 +0000 (10:28 +0200)
To verify, generated delta file from two version of widget:
 $ pkgcmd -X v1 -Y v2
and check that delta includes removed and added files.

Change-Id: Ic6d90018214f7b689d70b1cfb30fbdd3bc792cc2

data/pkgmgr-create-delta.sh.in

index b22963e..aa643a8 100644 (file)
@@ -147,6 +147,8 @@ while read line
                         action="only"
                elif [ $count -eq 2 ]; then
                        file1=$word;
+               elif [ $count -eq 3 ]; then
+                       file=$word;
                elif [ $count -eq 4 ]; then
                        file2=$word;
                elif [ $count -eq 5 ]; then
@@ -216,7 +218,7 @@ while read line
                        `echo "<file name=\"$dirpath$filepath\" />" >> $sample_delta/modified.xml`
                fi
 
-       elif [[ "$action" == "only" && "$file1" =~ "$old_pkg_unzip_path" ]]; then
+       elif [[ "$action" == "only" && "$file" =~ "$old_pkg_unzip_path" ]]; then
                parent_path=${line##*$old_pkg_unzip_path}
                #echo "removed " $parent_path
                string_to_replace_with="/"
@@ -232,7 +234,7 @@ while read line
                        dirpath="$dirpath/"
                fi
                `echo "<file name=\"$dirpath$filepath\" />" >> $sample_delta/removed.xml`
-       elif [[ "$action" == "only" && "$file1" =~ "$new_pkg_unzip_path" ]]; then
+       elif [[ "$action" == "only" && "$file" =~ "$new_pkg_unzip_path" ]]; then
                parent_path=${line##*$new_pkg_unzip_path}
                #echo "added " $parent_path
                string_to_replace_with="/"