diff mbox series

[bug#51774,v2] gnu: font-adobe-source-code-pro: Update to 2.032R-ro-1.052R-it-1.012R-VAR.

Message ID 70rnBf4hiAtWtLXEZPbo9WBALUmUha4qT-xxVwBX-Z-TnfVEp5b6M-3cZ9H-oIg-VXpfqgP_4lSCX1Vzgy3IAFcYplL6gMeXI3L1gu_cNlI=@protonmail.com
State Accepted
Headers show
Series [bug#51774,v2] gnu: font-adobe-source-code-pro: Update to 2.032R-ro-1.052R-it-1.012R-VAR. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

phodina Nov. 16, 2021, 7:07 p.m. UTC
Hi,

Jelle pointed out, that this font is already packaged as adobe-source-code-pro. Thanks, indeed it is.

Unfortunately since the version string changed (another backslash) the regexp now looks horrible. Maybe it would be better to define it with let to keep the code cleaner. What do you think?

Petr


* gnu/packages/fonts (font-adobe-source-code-pro): Update to
  2.032R-ro-1.052R-it-1.012R-VAR and update regexp in commit.

--
2.33.0

Comments

Liliana Marie Prikler Nov. 16, 2021, 8:29 p.m. UTC | #1
Hi,

Am Dienstag, den 16.11.2021, 19:07 +0000 schrieb phodina:
> Hi,
> 
> Jelle pointed out, that this font is already packaged as adobe-
> source-code-pro. Thanks, indeed it is.
> 
> Unfortunately since the version string changed (another backslash)
> the regexp now looks horrible. Maybe it would be better to define it
> with let to keep the code cleaner. What do you think?
In principle both are fine solutions to me, but the implementation
matters.  Perhaps someone else has another reason why to use one or the
other, but that's it for me.  As for the implementation here, see
below.

> * gnu/packages/fonts (font-adobe-source-code-pro): Update to
>   2.032R-ro-1.052R-it-1.012R-VAR and update regexp in commit.
Normally, you'd insert two dashes here and comments after that.  These 
lines don't appear in the commit log or the diff.

> diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
> index 3f36a71bdd..eddbeaba7e 100644
> --- a/gnu/packages/fonts.scm
> +++ b/gnu/packages/fonts.scm
> @@ -975,19 +975,20 @@ (define-public font-hack
>  (define-public font-adobe-source-code-pro
>    (package
>      (name "font-adobe-source-code-pro")
> -    (version "2.030R-ro-1.050R-it")
> +    (version "2.032R-ro-1.052R-it-1.012R-VAR")
>      (source
>       (origin
>         (method git-fetch)
>         (uri (git-reference
>               (url "https://github.com/adobe-fonts/source-code-pro")
> -             (commit (regexp-substitute/global
> -                      ;; The upstream tag uses "/" between the roman
> and italic
> -                      ;; versions, so substitute our "-" separator
> here.
> -                      #f "R-ro-" version 'pre "R-ro/" 'post))))
> +             (commit (regexp-substitute/global #f "it-" (regexp-
> substitute/global
> +                                                         ;; The
> upstream tag uses "/" between the roman and italic
> +                                                         ;;
> versions, so substitute our "-" separator here.
> +                                                         #f "R-ro-"
> version 'pre "R-ro/" 'post) 'pre "it/"
> +                                                         'post))))
This regexp could be simplified by noticing that it's always
<VERSION>R-<TAG>/<VERSION>R-<TAG>/<VERSION>R-<TAG>, whereas we use
<VERSION>R-<TAG>-<VERSION>R-<TAG>-<VERSION>R-<TAG>.  So simply use a
regexp that matches <VERSION>R-<TAG>- and then replace just the dash
with a slash.  That being said, I'm not sure how much cleaner this is
compared to let-binding

Cheers.
diff mbox series

Patch

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 3f36a71bdd..eddbeaba7e 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -975,19 +975,20 @@  (define-public font-hack
 (define-public font-adobe-source-code-pro
   (package
     (name "font-adobe-source-code-pro")
-    (version "2.030R-ro-1.050R-it")
+    (version "2.032R-ro-1.052R-it-1.012R-VAR")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
              (url "https://github.com/adobe-fonts/source-code-pro")
-             (commit (regexp-substitute/global
-                      ;; The upstream tag uses "/" between the roman and italic
-                      ;; versions, so substitute our "-" separator here.
-                      #f "R-ro-" version 'pre "R-ro/" 'post))))
+             (commit (regexp-substitute/global #f "it-" (regexp-substitute/global
+                                                         ;; The upstream tag uses "/" between the roman and italic
+                                                         ;; versions, so substitute our "-" separator here.
+                                                         #f "R-ro-" version 'pre "R-ro/" 'post) 'pre "it/"
+                                                         'post))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0hc5kflr8xzqgdm0c3gbgb1paygznxmnivkylid69ipc7wnicx1n"))))
+        (base32 "1lqchm8z0ah5y675ycmciqvr8y1v1gcj22ysfs443gm291vy0z4v"))))
     (build-system font-build-system)
     (home-page "https://github.com/adobe-fonts/source-code-pro")
     (synopsis