Skip to content

helpers/generate_common.sh: fix issues with local mirrors

Karel Koci requested to merge bugfix/generate-common into hbl

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.

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.

Merge request reports