{"action":"created","issue":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/296","repository_url":"https://api.github.com/repos/Fourdee/DietPi","labels_url":"https://api.github.com/repos/Fourdee/DietPi/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/Fourdee/DietPi/issues/296/comments","events_url":"https://api.github.com/repos/Fourdee/DietPi/issues/296/events","html_url":"https://github.com/Fourdee/DietPi/pull/296","id":150625598,"number":296,"title":"Testing","user":{"login":"rhkean","id":15089796,"avatar_url":"https://avatars.githubusercontent.com/u/15089796?v=3","gravatar_id":"","url":"https://api.github.com/users/rhkean","html_url":"https://github.com/rhkean","followers_url":"https://api.github.com/users/rhkean/followers","following_url":"https://api.github.com/users/rhkean/following{/other_user}","gists_url":"https://api.github.com/users/rhkean/gists{/gist_id}","starred_url":"https://api.github.com/users/rhkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhkean/subscriptions","organizations_url":"https://api.github.com/users/rhkean/orgs","repos_url":"https://api.github.com/users/rhkean/repos","events_url":"https://api.github.com/users/rhkean/events{/privacy}","received_events_url":"https://api.github.com/users/rhkean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-24T04:36:48Z","updated_at":"2016-04-24T20:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Fourdee/DietPi/pulls/296","html_url":"https://github.com/Fourdee/DietPi/pull/296","diff_url":"https://github.com/Fourdee/DietPi/pull/296.diff","patch_url":"https://github.com/Fourdee/DietPi/pull/296.patch"},"body":"migrate the .installed file from\r\n    VARNAME val\r\nto\r\n    VARNAME=val\r\nto remove need to \"cat | grep | awk\" parsing\r\n\r\nalso moved all variable definitions to top, then functions, then main loop at bottom\r\n\r\nCould use some help testing.  (I've done a clean new install test with the v111 image)\r\n\r\nNext:  will perform the same change for automation with dietpi.txt"},"comment":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/comments/214031456","html_url":"https://github.com/Fourdee/DietPi/pull/296#issuecomment-214031456","issue_url":"https://api.github.com/repos/Fourdee/DietPi/issues/296","id":214031456,"user":{"login":"xenfomation","id":10519408,"avatar_url":"https://avatars.githubusercontent.com/u/10519408?v=3","gravatar_id":"","url":"https://api.github.com/users/xenfomation","html_url":"https://github.com/xenfomation","followers_url":"https://api.github.com/users/xenfomation/followers","following_url":"https://api.github.com/users/xenfomation/following{/other_user}","gists_url":"https://api.github.com/users/xenfomation/gists{/gist_id}","starred_url":"https://api.github.com/users/xenfomation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xenfomation/subscriptions","organizations_url":"https://api.github.com/users/xenfomation/orgs","repos_url":"https://api.github.com/users/xenfomation/repos","events_url":"https://api.github.com/users/xenfomation/events{/privacy}","received_events_url":"https://api.github.com/users/xenfomation/received_events","type":"User","site_admin":false},"created_at":"2016-04-24T20:29:29Z","updated_at":"2016-04-24T20:29:29Z","body":"It makes perfect sense to me, especially this:\r\n\r\n> f we then add new variables in this 'write_installed_file_with_variable_expansion' function, it will always initialize our new apps with 0 (or, notice I initialized SSHSERVER_DROPBEAR to 2), but it won't change the values of what we read from an existing .installed file... the ${VARNAME:=0} will only set VARNAME equal to 0 if it doesn't already have a value.\r\n\r\nThe second thing, @rhkean is keeping it consistent as you are doing to avoid false positives and in evaluations of the install, annoying unary operator issues because of the old school [ scalar (evaluation) value ]....  \r\n\r\nI was knee deep in that last week playing with the code and other items outside of scope here!\r\n\r\nIf I can help or take care of the source/read file, take lines X-Y... let me know!  Good explanation, especially here:\r\n\r\n> so, basically,\r\n1. source existing .installed file to get current values of installed apps\r\n2. rewrite .installed file with just read values (and add new variables that may have been added due to upgrade)\r\n3. perform installs and update variables to value of 2 as needed\r\n4. at the end, write the installed file 1 more time with all the updated values\r\n\r\n\r\n-xenfomation | @xenfomation"}}