From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg6Ac-0003S5-GJ for guix-patches@gnu.org; Mon, 29 Jan 2018 04:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg6AU-0001l7-IG for guix-patches@gnu.org; Mon, 29 Jan 2018 04:56:10 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:39222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eg6AU-0001kj-Cz for guix-patches@gnu.org; Mon, 29 Jan 2018 04:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eg6AU-0000Jy-34 for guix-patches@gnu.org; Mon, 29 Jan 2018 04:56:02 -0500 Subject: [bug#30062] Help wanted Resent-Message-ID: MIME-Version: 1.0 In-Reply-To: <87607lnhom.fsf@gmail.com> References: <20180110093308.5581-1-boskovits@gmail.com> <87607lnhom.fsf@gmail.com> From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Date: Mon, 29 Jan 2018 10:55:25 +0100 Message-ID: Content-Type: multipart/alternative; boundary="f403045fad48d1eef90563e73ef1" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Chris Marusich Cc: 30062@debbugs.gnu.org --f403045fad48d1eef90563e73ef1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2018-01-29 10:22 GMT+01:00 Chris Marusich : > G=C3=A1bor Boskovits writes: > > > Hello Chris! > > > > Could you help me out on this? > > > > It seems that I should somehow extract the version string from the inpu= t > to > > use in substitute*, to fix the version string in tests. What would be t= he > > 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. W= e > 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 > --f403045fad48d1eef90563e73ef1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
2018= -01-29 10:22 GMT+01:00 Chris Marusich <cmmarusich@gmail.com>:
G=C3=A1bor Boskovits <boskovi= ts@gmail.com> writes:

> Hello Chris!
>
> Could you help me out on this?
>
> It seems that I should somehow extract the version string from the inp= ut 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 ver= sion
string (by hard-coding it):

--8<---------------cut here---------------start------------->8--= -
(arguments
=C2=A0 =C2=A0 =C2=A0`(#:jar-name "java-ops4j-pax-tinybundles.jar&= quot;
=C2=A0 =C2=A0 =C2=A0 =C2=A0#:source-dir "src/main/java"
=C2=A0 =C2=A0 =C2=A0 =C2=A0#:test-exclude
=C2=A0 =C2=A0 =C2=A0 =C2=A0;; Abstract base classes for other tests
=C2=A0 =C2=A0 =C2=A0 =C2=A0(list "**/BndTest.java" "**/CoreT= est.java")
=C2=A0 =C2=A0 =C2=A0 =C2=A0#:phases
=C2=A0 =C2=A0 =C2=A0 =C2=A0(modify-phases %standard-phases
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(add-before 'check 'fix-version =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda _
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; This test has a referenc= e to an old version of bndlib we are not
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; packaging.=C2=A0 It uses= the version referenced in pom.xml.=C2=A0 We replace
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; it with our own version.=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(substitute* "src/test= /java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(("2.4.0.201411= 031534") "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--= -
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(substitute* "src/test= /java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(("2.4.0.20141= 1031534") "3.4.0")))))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(("2.4.0.20141= 1031534") ,(package-version java-aqute-bndlib))))))))
--8<---------------cut here---------------end--------------->8--= -

The comma is 'unquote' (see: (guile) Expression Syntax), which shou= ld
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 l= ess 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 b= y wednesday.
=C2=A0
--
Chris

--f403045fad48d1eef90563e73ef1--