Skip to content

feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466

Open
M0Rf30 wants to merge 1 commit intorenovatebot:mainfrom
M0Rf30:feat/pkgbuild-manager
Open

feat: add pkgbuild manager (Arch Linux PKGBUILD)#39466
M0Rf30 wants to merge 1 commit intorenovatebot:mainfrom
M0Rf30:feat/pkgbuild-manager

Conversation

@M0Rf30
Copy link

@M0Rf30 M0Rf30 commented Nov 22, 2025

Summary

Adds a new manager for Arch Linux PKGBUILD files. Automatically detects new versions, updates pkgver, resets pkgrel, downloads source archives, computes checksums, and creates pull requests.

What it does

  • Automatically detects new versions from source URLs
  • Updates pkgver to the new version
  • Resets pkgrel to 1 (Arch convention)
  • Downloads new source archive and computes checksums programmatically
  • Updates sha256sums, sha512sums, b2sums, md5sums
  • Creates a pull request with all changes

Supported package sources

GitHub

  • Archive and release URLs

GitLab

  • gitlab.com and self-hosted instances

PyPI (Python)

  • files.pythonhosted.org, pypi.org

npm (Node.js)

  • Regular and scoped packages (@org/package)

CPAN (Perl)

  • cpan.metacpan.org

Packagist (PHP)

  • packagist.org

Gitea

  • gitea.com, codeberg.org, and self-hosted

Forgejo

  • code.forgejo.org and self-hosted

Generic Git repositories

  • Any git hosting with archive URLs or .git URLs

Repology (fallback)

  • Used automatically for unknown sources
  • Can be manually configured: # renovate: repology=repo/package

Additional features

  • Variable expansion: ${pkgver}, $pkgver, ${_pkgver}, $_pkgver
  • Architecture-specific checksums: sha256sums_x86_64, sha256sums_aarch64, etc.
  • Multi-source arrays (updates all sources that use ${pkgver})
  • Handles multiple archive formats: .tar.gz, .tar.bz2, .tar.xz, .zip, .tgz

What it doesn't support

  • VCS sources (git+https://...)
  • -git packages that track HEAD/latest commit
  • Packages with dynamic pkgver() functions

Example

pkgname=example
pkgver=1.2.3
pkgrel=1
source=("https://github.com/owner/repo/archive/v${pkgver}.tar.gz")
sha256sums=('abc123...')

Renovate detects GitHub, updates pkgver, resets pkgrel, downloads new tarball, computes new checksum.

Context

  • I accept the risk that this PR may be closed if maintainers disagree

AI assistance disclosure

  • Yes — minimal assistance

Documentation

  • I have updated documentation

How I've tested my work

  • Unit tests + real repository

@M0Rf30 M0Rf30 changed the title feat: add pkgbuild manager (Arch Linux PKGBUILD) - v2 feat: add pkgbuild manager (Arch Linux PKGBUILD) Nov 22, 2025
@M0Rf30 M0Rf30 changed the title feat: add pkgbuild manager (Arch Linux PKGBUILD) feat: add pkgbuild manager (Arch Linux PKGBUILD) Nov 22, 2025
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from bd3da39 to 029575d Compare November 24, 2025 11:26
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 029575d to db3f29d Compare November 25, 2025 12:40
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from db3f29d to 2217fad Compare December 5, 2025 13:53
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from aff9917 to 5a4d5d8 Compare December 9, 2025 13:00
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from b54a48b to 52592ef Compare December 9, 2025 16:27
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from 84e697c to 3d76b8b Compare January 27, 2026 20:07
@M0Rf30
Copy link
Author

M0Rf30 commented Jan 27, 2026

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.

@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 😄

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 4 times, most recently from ba03359 to 91a0559 Compare January 29, 2026 03:17
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 2 times, most recently from d417b81 to b0f6ffb Compare February 2, 2026 20:20
@M0Rf30 M0Rf30 requested a review from viceice February 3, 2026 02:04
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from b0f6ffb to bb48672 Compare February 3, 2026 02:08
@D3vil0p3r
Copy link

D3vil0p3r commented Feb 5, 2026

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD?
Does it work also with Python PyPI libs versioning update?

@M0Rf30
Copy link
Author

M0Rf30 commented Feb 5, 2026

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD? Does it work also with Python PyPI libs versioning update?

@M0Rf30 does your change include also the updpkgsums to have the updated hashes and at the end the creation of a PR?

Does it work also with -git packages to retrieve the latest commit version in PKGBUILD? Does it work also with Python PyPI libs versioning update?

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.

@D3vil0p3r
Copy link

D3vil0p3r commented Feb 5, 2026

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?

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from bb48672 to 227440c Compare February 5, 2026 19:43
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 11 times, most recently from ca51978 to 19d3826 Compare February 9, 2026 15:05
@M0Rf30
Copy link
Author

M0Rf30 commented Feb 9, 2026

@RahulGautamSingh @viceice I think it's ready now. just FYK. waiting for your bless

Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do a review tomorrow. It is big so clearing chunks at a time 😄

@RahulGautamSingh RahulGautamSingh self-requested a review February 10, 2026 22:59
@D3vil0p3r
Copy link

Will do a review tomorrow. It is big so clearing chunks at a time 😄

Any news about the review?

@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch 3 times, most recently from 9ecf587 to 30586ed Compare February 14, 2026 13:52
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from 27d008e to e5016c8 Compare February 18, 2026 10:47
@M0Rf30 M0Rf30 force-pushed the feat/pkgbuild-manager branch from e5016c8 to ffe5a2a Compare February 18, 2026 21:42
@D3vil0p3r
Copy link

I checked the changes, they seem ok. @RahulGautamSingh what do you think? Is there some additional point to take care?

@D3vil0p3r
Copy link

D3vil0p3r commented Feb 20, 2026

@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?

Comment on lines +26 to +32
const content = `
pkgname=example-package
pkgver=1.2.3
pkgrel=1
source=("https://github.com/example/example/archive/v\${pkgver}.tar.gz")
sha256sums=('abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890')
`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* Parse GitHub URLs
*/
function parseGitHubUrl(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    finally {
      // delete zip file
      await fs.rmCache(downloadPath);
    }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move hash computation to separate file and do it similar to terraform, especially the caching to avoid repeated downloads

export class TerraformProviderHash {

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.

4 participants