helpers/generate_common.sh: fix issues with local mirrors
The first issue is unbound variable access for _updated_mirrors. This requires new function that checks correctly that feed name is a key in the associative array. The second issue in the same function is that _updated_mirrors was never actually set after feed was updated. Another issue discovered and introduced during review is that _git_mirror_lock can't call functions because in case of mirror it spawns subshell where functions are not available. This simply reverts all _git usages after _git_mirror_lock to git. The another issue discovered was that repositories cloned using git_checkout function were not actually using mirror. At the same time the mirror URL construction is now placed in single function that can be called from two locations it is used in. There was also an issue with feed_url_replace function that was invalidly handling URLs that had no reference. The effect was that the URL for feed without any reference was handled by the first case and result was something like https://example.org;https://example.org for https://example.org Another fix for mirrors was invalid detection of existence of the mirror. The wrong variable was used and also the initial clone was placed in the invalid directory. There was also an issue if git mirror directory itself was missing. This is fixed by simply creating it unconditionally. And the last issue was with OpenWrt expecting full git history. This actually does not break build but produces nasty warnings from git commands that are run in script getver.sh that is called from top level makefile. The fix here is to mask CLONE_DEEP when getting OpenWrt repository.
bugfix/generate-common in 5 minutes and 36 seconds (queued for 7 seconds)7 jobs for