-
Notifications
You must be signed in to change notification settings - Fork 190
build: Use rpm-ostree compose --print-only to expand ${basearch} #192
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,10 +61,14 @@ prepare_build() { | |
|
|
||
| echo "Using manifest: ${manifest}" | ||
|
|
||
| manifest_tmp_json=${workdir}/tmp/manifest.json | ||
| rpm-ostree compose tree --repo=repo --print-only ${manifest} > ${manifest_tmp_json} | ||
|
|
||
| # Abuse the rojig/name as the name of the VM images | ||
| export name=$(manifest_get '["rojig"]["name"]') | ||
| export name=$(jq -r '.rojig.name' < ${manifest_tmp_json}) | ||
| # TODO - allow this to be unset | ||
| export ref=$(manifest_get '["ref"]') | ||
| export ref=$(jq -r '.ref' < ${manifest_tmp_json}) | ||
| rm -f ${manifest_tmp_json} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why we don't quote variables (here and everywhere else too)?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, consistency is not strong on this. Too bad there's not a "strict mode" for this. But probably our best bet really is to rewrite this in not-bash...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I definitely do think about quoting whenever a variable "could reasonably" have spaces; definitely when handling externally provided filename arguments for example. But in practice we don't support spaces for these variables like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I was mostly asking for my own knowledge in case I was missing some other details, not a blocker. It makes sense to bucket this under #161. On other coreos projects we use https://github.com/koalaman/shellcheck, which helps catching simple things.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooh, wow. That is a useful project. I just ran it against |
||
|
|
||
| # This dir is no longer used | ||
| rm builds/work -rf | ||
|
|
@@ -90,11 +94,6 @@ prepare_build() { | |
| export TMPDIR=$(pwd)/tmp | ||
| } | ||
|
|
||
| # We'll rewrite this in a real language I promise | ||
| manifest_get() { | ||
| python3 -c 'import sys,yaml; print(yaml.safe_load(open(sys.argv[1]))'"$1"')' "${manifest}" | ||
| } | ||
|
|
||
| runcompose() { | ||
| local treecompose_args="" | ||
| if ! grep -q '^# disable-unified-core' "${manifest}"; then | ||
|
|
||
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.
@jlebon does this extra
rpm-ostree composeinvocation have implications on the supermin PR?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.
That should be fine;
--print-onlyshould work without any privileges at all.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 i was referring to is the repo we operate against. Will it perform any write operations to the repo. Do we need to spin up a VM to do this in the supermin case for consistency?
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.
If it does, that's something we would fix in rpm-ostree. :)