From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:40047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGzGK-00010f-F2 for guix-patches@gnu.org; Thu, 18 Apr 2019 01:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGzGJ-0002L5-2x for guix-patches@gnu.org; Thu, 18 Apr 2019 01:07:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGzGI-0002Ju-Tz for guix-patches@gnu.org; Thu, 18 Apr 2019 01:07:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hGzGI-0007g4-ML for guix-patches@gnu.org; Thu, 18 Apr 2019 01:07:02 -0400 Subject: [bug#35312] core-update: Handle jar-files with patches Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:39948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGzFm-0000vG-26 for guix-patches@gnu.org; Thu, 18 Apr 2019 01:06:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGzFk-00024H-NF for guix-patches@gnu.org; Thu, 18 Apr 2019 01:06:30 -0400 Received: from m4s11.vlinux.de ([83.151.27.109]:35006 helo=bjoernhoefling.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGzFk-000222-3Y for guix-patches@gnu.org; Thu, 18 Apr 2019 01:06:28 -0400 Received: from alma-ubu (unknown [37.49.7.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bjoernhoefling.de (Postfix) with ESMTPSA id 073513F943 for ; Thu, 18 Apr 2019 07:06:21 +0200 (CEST) Date: Thu, 18 Apr 2019 07:06:21 +0200 From: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= Message-ID: <20190418070621.09cd7307@alma-ubu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/EQ+KlU/5e8NC4dsCpY6owft"; protocol="application/pgp-signature" 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: 35312@debbugs.gnu.org --Sig_/EQ+KlU/5e8NC4dsCpY6owft Content-Type: multipart/mixed; boundary="MP_/O_BdbNh.VyB3WSzQcACN=uk" --MP_/O_BdbNh.VyB3WSzQcACN=uk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Please review carefully, this is my first work below the gexp-border. This patch is the outcome of my question at: https://lists.gnu.org/archive/html/guix-devel/2019-04/msg00226.html When a jar-file had patches, it was not recognized and wrongly handled with "tar xz". There is one open question: For patch-and-repack, the flags defaults to '("p1"), but for jar-files we would usually need a "p0". That would mean for jar-sources with patches, one would need to manually add the patch-flags with "p0" to the origin. This is not nice. On the other hand, I would not like to override the patch-flags for jar-files to always "p0". WDYT? Bj=C3=B6rn --MP_/O_BdbNh.VyB3WSzQcACN=uk Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-guix-Handle-patching-of-jar-files-correctly.patch =46rom 84098800908c732facea1196cbc51b06128ff2ab Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Bj=3DC3=3DB6rn=3D20H=3DC3=3DB6fling?=3D Date: Thu, 18 Apr 2019 06:27:39 +0200 Subject: [PATCH] guix: Handle patching of jar-files correctly. When jar-files are used as origins with patches, they were not handled correctly and unpacked with the default "tar xz" command. This fix adds a case for jar-files. * guix/packages.scm (%standard-inputs): Add entry for jar-files. (patch-and-repack)(decompression-type): Handle "jar" suffix. patch-and-repack)(build): Unpack jar-files with unzip. Don't change into first-file for jar-files. See discussion at: . --- guix/packages.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index a961dc3973..5af2c25cd9 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -436,6 +436,7 @@ identifiers. The result is inferred from the file name= s of patches." ("gzip" ,(ref '(gnu packages compression) 'gzip)) ("lzip" ,(ref '(gnu packages compression) 'lzip)) ("unzip" ,(ref '(gnu packages compression) 'unzip)) + ("jar" ,(ref '(gnu packages compression) 'unzip)) ("patch" ,(ref '(gnu packages base) 'patch)) ("locales" ,(ref '(gnu packages base) 'glibc-utf8-locales))))) =20 @@ -492,6 +493,7 @@ specifies modules in scope when evaluating SNIPPET." ((string-suffix? "bz2" source-file-name) "bzip2") ((string-suffix? "lz" source-file-name) "lzip") ((string-suffix? "zip" source-file-name) "unzip") + ((string-suffix? "jar" source-file-name) "jar") (else "xz"))) =20 (define original-file-name @@ -585,12 +587,17 @@ specifies modules in scope when evaluating SNIPPET." (directory (string-drop base (+ 1 dash)))) (mkdir directory) (copy-recursively #+source directory)) - #+(if (string=3D? decompression-type "unzip") + #+(if (or + (string=3D? decompression-type "unzip") + (string=3D? decompression-type "jar")) #~(invoke "unzip" #+source) #~(invoke (string-append #+tar "/bin/tar") "xvf" #+source))) =20 - (let ((directory (first-file "."))) + ;; jar-files have their contents directly in the root folder + (let ((directory (if (string=3D? #+decompression-type "jar") + "." + (first-file ".")))) (format (current-error-port) "source is under '~a'~%" directory) (chdir directory) --=20 2.21.0 --MP_/O_BdbNh.VyB3WSzQcACN=uk-- --Sig_/EQ+KlU/5e8NC4dsCpY6owft Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXLgFzQAKCRC/KGy2WT5f /TGRAJ45ly76SM+G8g+Aeh3WpBYojjRIOwCfdPG6lYuvdTiysK5fMqMWYIzsnIs= =6EI4 -----END PGP SIGNATURE----- --Sig_/EQ+KlU/5e8NC4dsCpY6owft--