{"comment":{"url":"https://api.github.com/repos/opengapps/opengapps/comments/12006664","html_url":"https://github.com/opengapps/opengapps/commit/b103d8d286ed45418036bc577a9760433e7bdafc#commitcomment-12006664","id":12006664,"user":{"login":"mfonville","id":6221544,"avatar_url":"https://avatars.githubusercontent.com/u/6221544?v=3","gravatar_id":"","url":"https://api.github.com/users/mfonville","html_url":"https://github.com/mfonville","followers_url":"https://api.github.com/users/mfonville/followers","following_url":"https://api.github.com/users/mfonville/following{/other_user}","gists_url":"https://api.github.com/users/mfonville/gists{/gist_id}","starred_url":"https://api.github.com/users/mfonville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfonville/subscriptions","organizations_url":"https://api.github.com/users/mfonville/orgs","repos_url":"https://api.github.com/users/mfonville/repos","events_url":"https://api.github.com/users/mfonville/events{/privacy}","received_events_url":"https://api.github.com/users/mfonville/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"b103d8d286ed45418036bc577a9760433e7bdafc","created_at":"2015-07-05T19:49:14Z","updated_at":"2015-07-05T19:49:14Z","body":"I thought of the following patch, but I am afraid that the assigment of appsize on line 151 would break down, because $app_density would be empty in the statement ```($app_density|common)```\r\nwhat do you think? Do you think it would break down, or not?\r\n\r\n```\r\ndiff --git a/scripts/inc.updatebinary.sh b/scripts/inc.updatebinary.sh\r\nindex 9c9832f..c58b323 100755\r\n--- a/scripts/inc.updatebinary.sh\r\n+++ b/scripts/inc.updatebinary.sh\r\n@@ -97,7 +97,7 @@ extract_app() {\r\n        TAR=\"/tmp/$1.tar.xz\";\r\n        app_name=\"$(basename \"$1\")\";\r\n     which_dpi \"$app_name\";\r\n-    if [ \"$dpiapkpath\" != \"unknown\" ]; then #technically not necessary, 'unknown' folder would not exist anyway\r\n+    if [ -n \"$dpiapkpath\" ]; then\r\n         folder_extract \"$dpiapkpath\";\r\n     fi\r\n     folder_extract \"$app_name/common\";\r\n@@ -278,15 +278,15 @@ which_dpi() {\r\n        app_densities=\"\";\r\n        app_densities=\"$(cat /tmp/app_densities.txt | grep -E \"$1/([0-9-]+|nodpi)/\" | sed -r 's#.*/([0-9-]+|nodpi)/.*#\\1#' | sort)\";\r\n     # Check if in the package there is a version for our density, or a universal one.\r\n+    dpiapkpath=\"\"\r\n        for densities in $app_densities; do\r\n                case \"$densities\" in\r\n                        *\"$density\"*) dpiapkpath=\"$1/$densities\"; break;;\r\n                        *nodpi*) dpiapkpath=\"$1/nodpi\"; break;;\r\n-                       *) dpiapkpath=\"unknown\";;\r\n                esac;\r\n        done;\r\n        # If there is no package for our density nor a universal one, we will look for the one with closer, but higher density.\r\n-       if [ \"$dpiapkpath\" = \"unknown\" ] && [ -n \"$app_densities\" ]; then\r\n+       if [ -n \"$dpiapkpath\" ] && [ -n \"$app_densities\" ]; then\r\n                for densities in $app_densities; do\r\n                        all_densities=\"$(echo \"$densities\" | sed 's/-/ /g' | tr ' ' '\\n' | sort | tr '\\n' ' ')\";\r\n                        for d in $all_densities; do\r\n@@ -298,7 +298,7 @@ which_dpi() {\r\n                done;\r\n        fi;\r\n        # If there is no package for our density nor a universal one or one for higher density, we will use the one with closer, but lower density.\r\n-       if [ \"$dpiapkpath\" = \"unknown\" ] && [ -n \"$app_densities\" ]; then\r\n+       if [ -n \"$dpiapkpath\" ] && [ -n \"$app_densities\" ]; then\r\n                for densities in $app_densities; do\r\n                        all_densities=\"$(echo \"$densities\" | sed 's/-/ /g' | tr ' ' '\\n' | sort -r | tr '\\n' ' ')\";\r\n                        for d in $all_densities; do\r\n```"}}