-
Notifications
You must be signed in to change notification settings - Fork 161
Add script for converting Zephyr repository #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
copy_git_worktree() { | ||
echo $1 $2 | ||
rsync -q -av $1 --exclude .git $2 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reasoning behind two Git directories? Could you use a single one instead and generate tags on it which have a prefix/suffix?
So maybe upstream pushes v1.0
and we add a new local tag called elixir-v1.0
(or whatever). Then the upper layers only pick those tags up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed trickier to do it with a single repository, and I don't think modifying the original source in any way is a good idea.
But then I realized, that the repo
directory has to be the conversion target, not source. And utils/index
already fetches new tags into hardcoded repo
directory. So if I want to have conversion target and source separate, I would have to modify utils/index
(and possibly more) to fetch tags into a different directory. I don't really see a good way of changing that.
And then there is west wanting to have zephyr
repository in the base directory/"top dir"...
The next (current) iteration uses worktrees, and adds tags prefixed with elixir-
to the main repo.
utils/zephyr-converter.sh
Outdated
west_manifest=$TOP_DIR/$PROJECT_NAME/west.yml | ||
if [[ -f $west_manifest ]]; then | ||
# Find disabled groups | ||
extra_groups=`cat west-topdir/zephyr/west.yml | yq -r '(.manifest."group-filter" // [])[]' | grep '^-' | sed 's/^-/+/' | paste -s -d,` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Python for YAML manipulation? This pipeline is hardly readable. eg
x='
import yaml
import sys
x = yaml.safe_load(sys.stdin)
# ...'
extra_groups="$(python -c "$x" < west-topdir/zephyr/west.yml)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixing in multiline Python snippets won't make things more readable. I would rather rewrite the whole script in Python. For now I have split the pipeline into two and added a comment.
3c1af40
to
42ed877
Compare
42ed877
to
43dd6cc
Compare
43dd6cc
to
bf4d5fc
Compare
This is a work-in-progress version of Zephyr repository converter discussed in #279. It's not integrated with Elixir in any way yet, I'm not sure what would the best way to approach this. For now, probably the
utils/index
script could "inherit" functions fromprojects
directory scripts, likescript.sh
does. Zephyr-specific repository conversion part could be then placed inprojects/zephyr.sh
.The script does not try to properly order commits in the target repository, I don't think it matters for Elixir.
In this version, all the extra projects are placed in
west_projects
directory. West by default places project directories in directory above Zephyr, but that is not going to work for Elixir, because it would break URLs.All west groups disabled in the manifest are enabled.
I have no experience with Zephyr, so I don't know if this makes sense.