From 5a44eb936490f2d13b264dca4148021457d6fe21 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> Date: Thu, 18 May 2023 09:48:31 +0100 Subject: [PATCH] texlive.tlpdb.nix: better sed looping technique --- pkgs/tools/typesetting/tex/texlive/tl2nix.sed | 43 +++++++++---------- pkgs/tools/typesetting/tex/texlive/tlpdb.nix | 3 ++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/tl2nix.sed b/pkgs/tools/typesetting/tex/texlive/tl2nix.sed index 94b10ba6f776..e4d9ffa3fea2 100644 --- a/pkgs/tools/typesetting/tex/texlive/tl2nix.sed +++ b/pkgs/tools/typesetting/tex/texlive/tl2nix.sed @@ -14,8 +14,7 @@ $a} } # form an attrmap per package -# ignore packages whose name contains "." (such as binaries) -:next-package +# ignore packages whose name contains "." (such as binaries) except for texlive.infra /^name ([^.]+|texlive\.infra)$/,/^$/{ # quote package names, as some start with a number :-/ s/^name (.*)$/"\1" = {/p @@ -37,33 +36,34 @@ $a} s/^catalogue-version_(.*)/ version = "\1";/p # extract deps - /^depend [^.]+$/{ - s/^depend (.+)$/ deps = [\n "\1"/ + /^depend ([^.]+|texlive\.infra)$/{ + # open a list + i\ deps = [ # loop through following depend lines - :next - h ; N # save & read next line - s/\ndepend ([^.]+|texlive\.infra)$/\n "\1"/ - s/\ndepend (.+)$// - t next # loop if the previous lines matched + :next-dep + s/^\n?depend ([^.]+|texlive\.infra)$/ "\1"/p # print dep + s/^.*$// # clear pattern space + N; /^\ndepend /b next-dep - x; s/$/\n ];/p ; x # print saved deps - s/^.*\n// # remove deps, resume processing + # close the list + i\ ]; + D # restart cycle from the current line } # detect presence of notable files /^runfiles /{ - s/^runfiles .*$// # ignore the first line - :next-file - h ; N # save to hold space & read next line - s!\n (.+)$! \1! # save file name - t next-file # loop if the previous lines matched + s/^.*$// # ignore the first line + + # read all files + :next-file + N + s/\n / / # remove newline + t next-file # loop if previous line matched - x # work on saved lines in hold space / (RELOC|texmf-dist)\//i\ hasRunfiles = true; / tlpkg\//i\ hasTlpkg = true; - x # restore pattern space - s/^.*\n// # remove saved lines, resume processing + D # restart cycle from the current line } # extract postaction scripts (right now, at most one per package, so a string suffices) @@ -75,8 +75,5 @@ $a} /^execute\sAddFormat/i\ hasFormats = true; # close attrmap - /^$/{ - i}; - b next-package - } + /^$/i}; } diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix index 2d932c76d1b2..5813d1b3b62d 100644 --- a/pkgs/tools/typesetting/tex/texlive/tlpdb.nix +++ b/pkgs/tools/typesetting/tex/texlive/tlpdb.nix @@ -36186,6 +36186,9 @@ }; "texlive-scripts" = { revision = 66570; + deps = [ + "texlive.infra" + ]; sha512.run = "3dbb2007ae7b80862265d6196f77a9d796f02f6914871f4dad094f8419040fe7064daf6ecf5dd611b5764dd4148d034a97d82aa22671199e8a3dc79373859c67"; sha512.doc = "6976ba00c8ee50664aaa1f762231f297f01548a94d6a632b386845e7fa43b20b63342d58874e87869a73a9c23bba358f762f5cc3814690f870c6216679471a89"; hasRunfiles = true;