Source fetch from melange#2170
Conversation
|
build this and then run something like:
|
3a4ae60 to
fcdbdaa
Compare
|
|
@sergiodj Take a look at the new updates. |
|
I feel like i could probably just edit the melange config and write it out somehow and not call yam but this is mostly just poc stuff. |
fcdbdaa to
c01a3c1
Compare
of course it is. |
b6987c3 to
eb120ee
Compare
This subcommand pulls the source a build config. Currently it only supports git-checkout but in the future it should suppport more functionality. The purpose of this is to make interacting with upstream source and patches easier. I'd like a workflow like `melange source -o sources/ package.yaml` to setup a git tree with patches applied and another command that can do the revese. There's something similiar in source.go for license checks. That version runs the same shell script that the pipeline has. This command is meant for setting up an environment that can be used to develope against the upstream sources. I'm not interested shallow cloning or keeping a consistent commiter id or anything here. I'm realy just trying to make it easy to develop/debug packages using the upstream source.
eb120ee to
7a45c80
Compare
…mits Add a third fallback (patch -p1 --fuzz=2) when git am and git apply both fail to apply a patch. This matches the melange build pipeline behavior and handles patches that require fuzz matching. Also add --no-gpg-sign to git am, git commit, and git cherry-pick since these are automated operations on fetched source that should not inherit the user's commit signing configuration.
7a45c80 to
04a3ffd
Compare
|
|
||
| ``` | ||
| --log-level string log level (e.g. debug, info, warn, error) (default "INFO") | ||
| -o, --output string output directory for extracted source (default "./source") |
There was a problem hiding this comment.
Can we make this ./source/<package name>? Would make working multiple trees easier
| WorkspaceDir string // Directory where patch files are located (usually config dir) | ||
| } | ||
|
|
||
| func GitCheckout(ctx context.Context, opts *GitCheckoutOptions) error { |
There was a problem hiding this comment.
We should probably sync submodules too when git-checkout is configured to do so
| // updatePipelineWithGitAm finds the pipeline array in the YAML node tree, | ||
| // and replaces any 'patch' pipeline step with a 'git-am' step with the given patches. | ||
| // If no patch step exists, inserts git-am after git-checkout. | ||
| func updatePipelineWithGitAm(doc *yaml.Node, patchFiles []string) error { |
There was a problem hiding this comment.
Not sure if worthwhile to eval the working directory (if set) for the patch pipeline as well (not that that should ever really be the case for anything, but maybe submodules with their own tree)
I want this to be for development not for building which is why i'm not doing what sources did and running the pipeline which should be fine shell code. I also want all of the history if i'm doing development.
IMO Ideally the source locations would be used in pipelines but not actually defined in it so that other pipelines could reference it and melange could make smart choices. The update section for example of one that already works around this.
I'd really like to make a world in the future where we can enforce that all patches are applied in a sensible predictable order independent of the melange tool. As far as I can tell right now the best way to do that is to apply them to the source an pop ALL of our patches off as a stack from format-patch.