Subject: [bug#30062] Help wanted

From: Gábor Boskovits <[email-masked]>
Date: Mon, 29 Jan 2018 10:55:25 +0100

2018-01-29 10:22 GMT+01:00 Chris Marusich <[email-masked]>:

> Gábor Boskovits <[email-masked]> writes:
>
> > Hello Chris!
> >
> > Could you help me out on this?
> >
> > It seems that I should somehow extract the version string from the input
> to
> > use in substitute*, to fix the version string in tests. What would be the
> > proper way of doing this?
>
> It looks like the existing code is already substituting the version
> string (by hard-coding it):
>
> --8<---------------cut here---------------start------------->8---
> (arguments
>      `(#:jar-name "java-ops4j-pax-tinybundles.jar"
>        #:source-dir "src/main/java"
>        #:test-exclude
>        ;; Abstract base classes for other tests
>        (list "**/BndTest.java" "**/CoreTest.java")
>        #:phases
>        (modify-phases %standard-phases
>          (add-before 'check 'fix-version
>            (lambda _
>              ;; This test has a reference to an old version of bndlib we
> are not
>              ;; packaging.  It uses the version referenced in pom.xml.  We
> replace
>              ;; it with our own version.
>              (substitute* "src/test/java/org/ops4j/pax/
> tinybundles/bnd/BndTest.java"
>                (("2.4.0.201411031534") "3.4.0")))))))
> --8<---------------cut here---------------end--------------->8---
>
> I think we could probably just make a change like the following (I
> haven't tested this, though):
>
> --8<---------------cut here---------------start------------->8---
>              (substitute* "src/test/java/org/ops4j/pax/
> tinybundles/bnd/BndTest.java"
> -               (("2.4.0.201411031534") "3.4.0")))))))
> +               (("2.4.0.201411031534") ,(package-version
> java-aqute-bndlib))))))))
> --8<---------------cut here---------------end--------------->8---
>
> The comma is 'unquote' (see: (guile) Expression Syntax), which should
> insert the package version of java-aqute-bndlib into the quasi-quoted
> list.
>
> Does that help?
>
> Yes, thanks. This has the piece of information I was missing.
I would also like to replace the matching expression to be something less
specific, because
it would be nice, if upon upgrade we could just flip the version and the
hash.
I will try to get this done by wednesday.

> --
> Chris