Skip to content
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

WIP: Add script for converting Zephyr repository #394

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fstachura
Copy link
Collaborator

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 from projects directory scripts, like script.sh does. Zephyr-specific repository conversion part could be then placed in projects/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.

Copy link
Member

@tleb tleb left a 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
}
Copy link
Member

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?

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,`
Copy link
Member

@tleb tleb Feb 25, 2025

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)"

@tleb tleb mentioned this pull request Feb 25, 2025
@fstachura fstachura force-pushed the zephyr-converter branch 3 times, most recently from a086530 to 3c1af40 Compare February 28, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants