Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/md/melange.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ toc: true
* [melange scan](/docs/md/melange_scan.md) - Scan an existing APK to regenerate .PKGINFO
* [melange sign](/docs/md/melange_sign.md) - Sign an APK package
* [melange sign-index](/docs/md/melange_sign-index.md) - Sign an APK index
* [melange source](/docs/md/melange_source.md) - Manage melange source code
* [melange test](/docs/md/melange_test.md) - Test a package with a YAML configuration file
* [melange update-cache](/docs/md/melange_update-cache.md) - Update a source artifact cache
* [melange version](/docs/md/melange_version.md) - Prints the version
Expand Down
37 changes: 37 additions & 0 deletions docs/md/melange_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "melange source"
slug: melange_source
url: /docs/md/melange_source.md
draft: false
images: []
type: "article"
toc: true
---
## melange source

Manage melange source code

### Synopsis

Commands for managing source code from melange configurations.

### Options

```
-h, --help help for source
-o, --output string output directory for extracted source (default "./source")
--source-dir string directory where patches and other sources are located (defaults to ./package-name/)
```

### Options inherited from parent commands

```
--log-level string log level (e.g. debug, info, warn, error) (default "INFO")
```

### SEE ALSO

* [melange](/docs/md/melange.md) -
* [melange source get](/docs/md/melange_source_get.md) - Extract source code from melange configuration
* [melange source pop](/docs/md/melange_source_pop.md) - Generate patches from modified source and update melange configuration

49 changes: 49 additions & 0 deletions docs/md/melange_source_get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "melange source get"
slug: melange_source_get
url: /docs/md/melange_source_get.md
draft: false
images: []
type: "article"
toc: true
---
## melange source get

Extract source code from melange configuration

### Synopsis

Extract source code by cloning git repositories from melange configuration.

This command parses a melange configuration file and extracts sources to the given directory
Currently only supports git-checkout.


```
melange source get [config.yaml] [flags]
```

### Examples

```
melange source get vim.yaml -o ./src
```

### Options

```
-h, --help help for get
```

### Options inherited from parent commands

```
--log-level string log level (e.g. debug, info, warn, error) (default "INFO")
-o, --output string output directory for extracted source (default "./source")
--source-dir string directory where patches and other sources are located (defaults to ./package-name/)
```

### SEE ALSO

* [melange source](/docs/md/melange_source.md) - Manage melange source code

53 changes: 53 additions & 0 deletions docs/md/melange_source_pop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: "melange source pop"
slug: melange_source_pop
url: /docs/md/melange_source_pop.md
draft: false
images: []
type: "article"
toc: true
---
## melange source pop

Generate patches from modified source and update melange configuration

### Synopsis

Generate git format-patch patches from commits made on top of the expected-commit
and update the melange configuration to use git-am pipeline instead of patch pipeline.

This command:
1. Reads the expected-commit from git-checkout pipeline
2. Generates patches from expected-commit..HEAD in the cloned source
3. Writes patches to the source directory
4. Updates the YAML to replace 'patch' with 'git-am' pipeline


```
melange source pop [config.yaml] [flags]
```

### Examples

```
melange source pop apk-tools.yaml
```

### Options

```
-h, --help help for pop
```

### Options inherited from parent commands

```
--log-level string log level (e.g. debug, info, warn, error) (default "INFO")
-o, --output string output directory for extracted source (default "./source")
--source-dir string directory where patches and other sources are located (defaults to ./package-name/)
```

### SEE ALSO

* [melange source](/docs/md/melange_source.md) - Manage melange source code

11 changes: 11 additions & 0 deletions pkg/build/pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ new built-in pipelines, consult [Creating a new built-in pipeline](/docs/PIPELIN


- [fetch](#fetch)
- [git-am](#git-am)
- [git-checkout](#git-checkout)
- [patch](#patch)
- [strip](#strip)
Expand All @@ -33,6 +34,16 @@ Fetch and extract external object into workspace
| timeout | false | The timeout (in seconds) to use for connecting and reading. The fetch will fail if the timeout is hit. | 5 |
| uri | true | The URI to fetch as an artifact. | |

## git-am

Apply patches with git am

### Inputs

| Name | Required | Description | Default |
| ---- | -------- | ----------- | ------- |
| patches | true | A list of patches to apply with git am, as a whitespace delimited string. | |

## git-checkout

Check out sources from git
Expand Down
15 changes: 15 additions & 0 deletions pkg/build/pipelines/git-am.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Apply patches with git am

needs:
packages:
- git

inputs:
patches:
description: |
A list of patches to apply with git am, as a whitespace delimited string.
required: true

pipeline:
- runs: |
git am ${{inputs.patches}}
1 change: 1 addition & 0 deletions pkg/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func New() *cobra.Command {
cmd.AddCommand(scan())
cmd.AddCommand(signCmd())
cmd.AddCommand(signIndex())
cmd.AddCommand(sourceCmd())
cmd.AddCommand(test())
cmd.AddCommand(updateCache())
cmd.AddCommand(version.Version())
Expand Down
Loading
Loading