feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466
feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466M0Rf30 wants to merge 1 commit intorenovatebot:mainfrom
Conversation
bd3da39 to
029575d
Compare
029575d to
db3f29d
Compare
db3f29d to
2217fad
Compare
RahulGautamSingh
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I have done a half-review..and will review again after changes are applied.
Please, use the review request feature for notifying.
aff9917 to
5a4d5d8
Compare
b54a48b to
52592ef
Compare
84e697c to
3d76b8b
Compare
@RahulGautamSingh I think it's ready now. I'm writing here because I requested a review some time ago. Some time has passed, and here we are 😄 |
ba03359 to
91a0559
Compare
d417b81 to
b0f6ffb
Compare
b0f6ffb to
bb48672
Compare
|
@M0Rf30 does your change include also the Does it work also with |
PyPI is fully supported The implementation downloads the source archive directly and computes all checksums programmatically using Node's crypto module. It automatically calculates all checksum types present in the PKGBUILD (sha256, sha512, b2, md5). This manager is designed for versioned releases, not VCS sources. Git packages (like -git AUR packages that track HEAD) use git+ URLs and have dynamic pkgver() functions rather than static versions, so they're fundamentally incompatible with this approach. The manager only handles versioned tarballs/archives from known sources. |
|
Grande! For git versioning I'll try to look for another bot if existing. For this PR, is there something additional you need to add on the code, or it needs only to be reviewed and merged? Also svc stable sources are supported? |
bb48672 to
227440c
Compare
ca51978 to
19d3826
Compare
|
@RahulGautamSingh @viceice I think it's ready now. just FYK. waiting for your bless |
RahulGautamSingh
left a comment
There was a problem hiding this comment.
Will do a review tomorrow. It is big so clearing chunks at a time 😄
Any news about the review? |
9ecf587 to
30586ed
Compare
27d008e to
e5016c8
Compare
e5016c8 to
ffe5a2a
Compare
|
I checked the changes, they seem ok. @RahulGautamSingh what do you think? Is there some additional point to take care? |
|
@M0Rf30 one question: could it be good to integrate how to use renovate with your implemented changes inside Renovate docs? For example, configuration and examples of usage? |
| const content = ` | ||
| pkgname=example-package | ||
| pkgver=1.2.3 | ||
| pkgrel=1 | ||
| source=("https://github.com/example/example/archive/v\${pkgver}.tar.gz") | ||
| sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890') | ||
| `; |
There was a problem hiding this comment.
| const content = ` | |
| pkgname=example-package | |
| pkgver=1.2.3 | |
| pkgrel=1 | |
| source=("https://github.com/example/example/archive/v\${pkgver}.tar.gz") | |
| sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890') | |
| `; | |
| const content = codeBlock` | |
| pkgname=example-package | |
| pkgver=1.2.3 | |
| pkgrel=1 | |
| source=("https://github.com/example/example/archive/v\${pkgver}.tar.gz") | |
| sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890') | |
| `; |
use our codeBlock template helper
| `(${type}sums(?:_([^=]+))?)=\\('([a-fA-F0-9]{${length}})'\\)`, | ||
| 'g', | ||
| ); | ||
| while ((match = singleQuoteRegex.exec(content)) !== null) { |
There was a problem hiding this comment.
| /** | ||
| * Parse GitHub URLs | ||
| */ | ||
| function parseGitHubUrl( |
There was a problem hiding this comment.
please move the platform specific function to separate files eg ./extract/github.ts
utils can be moved to ./extract/utils.ts if they're need in platform code.
this file is otherwise very big and hard to review.
splittet files can also be much easier tested.
| // Get cache directory for temporary file storage | ||
| const cacheDir = await ensureCacheDir('pkgbuild'); | ||
| const fileName = url.split('/').pop() ?? 'download'; | ||
| const downloadPath = upath.join(cacheDir, `temp-${Date.now()}-${fileName}`); |
There was a problem hiding this comment.
| const downloadPath = upath.join(cacheDir, `temp-${Date.now()}-${fileName}`); | |
| const downloadPath = upath.join(cacheDir, `${fileName}`); |
don't use date based file names, delete in finally block
| 'Failed to download file for checksum computation', | ||
| ); | ||
| throw err; | ||
| } |
There was a problem hiding this comment.
finally {
// delete zip file
await fs.rmCache(downloadPath);
}
There was a problem hiding this comment.
please move hash computation to separate file and do it similar to terraform, especially the caching to avoid repeated downloads
Summary
Adds a new manager for Arch Linux PKGBUILD files. Automatically detects new versions, updates
pkgver, resetspkgrel, downloads source archives, computes checksums, and creates pull requests.What it does
pkgverto the new versionpkgrelto 1 (Arch convention)sha256sums,sha512sums,b2sums,md5sumsSupported package sources
GitHub
GitLab
PyPI (Python)
npm (Node.js)
CPAN (Perl)
Packagist (PHP)
Gitea
Forgejo
Generic Git repositories
Repology (fallback)
# renovate: repology=repo/packageAdditional features
${pkgver},$pkgver,${_pkgver},$_pkgversha256sums_x86_64,sha256sums_aarch64, etc.${pkgver})What it doesn't support
git+https://...)-gitpackages that track HEAD/latest commitpkgver()functionsExample
Renovate detects GitHub, updates pkgver, resets pkgrel, downloads new tarball, computes new checksum.
Context
AI assistance disclosure
Documentation
How I've tested my work