melpa / package-build

Tools for assembling a package archive
https://github.com/melpa/melpa
25 stars 34 forks source link

Checkout configurable tag #55

Closed spegelref closed 2 years ago

spegelref commented 2 years ago

I have expanded the recipes to include a tag options to let me build packages of targeted releases. I'm kinda new to Emacs so the code might not be idiomatic, or a better solution exists that isn't documented.

At least this is my naive attempt, and it seems to work without problem.

Rationale

I run openSUSE which contains an older packages of Emacs (25.3). on Emacs homepage the official way is to use the distributions supplied version. I want to work with Clojure and run CIDER. CIDER supports emacs25 from MELPA stable, but dependencies of CIDER have emacs26 as latest supported version. Instead of downloading Github repositories and loading packages it would be neater to setup a custom MELPA with predefined version of packages.

purcell commented 2 years ago

Hi, thanks! If I'm not mistaken, it's already possible to specify a tag by using either a :commit or a very restrictive :version-regexp, so I wonder if this is really necessary?

spegelref commented 2 years ago

I did try both. Commit didn't work with stable, (the test repo I used was clojure-mode) got version 5.13 (latest) when using commit for 5.12. Using ordinary melpa build (without stable) didn't give me a version just a date.

I thought regexp would work but it only gave me the exception that no such tags exists.

purcell commented 2 years ago

Commit didn't work with stable, (the test repo I used was clojure-mode) got version 5.13 (latest) when using commit for 5.12. Using ordinary melpa build (without stable) didn't give me a version just a date.

Right, that makes sense.

I thought regexp would work but it only gave me the exception that no such tags exists.

What format did you use for the regexp? It must simply not be matching, so perhaps the regexp is subtly wrong?

spegelref commented 2 years ago

What format did you use for the regexp? It must simply not be matching, so perhaps the regexp is subtly wrong?

My regex-fu might not be the strongest, I did try: "5.12.0", "5\.12\.0" and "5\\.12\\.0" (double escaped as well since I'm mainly a java dev)

purcell commented 2 years ago

Which repo is that?

spegelref commented 2 years ago

https://github.com/clojure-emacs/clojure-mode

milkypostman commented 2 years ago

you need to specified a group to capture.

Something more like,

:version-regexp "\\(5\\.12\\.0\\)")
milkypostman commented 2 years ago

I tried my version above and it worked. Please close after confirming for yourself.

purcell commented 2 years ago

Ah yes, and probably also need to anchor the regexp so it doesn't match "15.12.03", for example:

:version-regexp "\\`\\(5\\.12\\.0\\)\\'")

(somewhat similar to ^ and $ that you may have seen elsewhere, or more accurately \A and \z in Ruby for start-of-input/end-of-input matches).

spegelref commented 2 years ago

Thanks, this works with no problems, a little more to write but better than extra code.

Awesome!

purcell commented 2 years ago

Thanks @spegelref !