blob: 7d48388cd39faa14a6863659c5c8db17e6e9ecd0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# wrap whole file into an attrset
1i{ # no indentation
$a}
# extract repository metadata
/^name 00texlive\.config$/,/^$/{
s/^name (.*)$/"\1" = {/p
/^$/,1i};
s!^depend frozen/0$! frozen = false;!p
s!^depend frozen/1$! frozen = true;!p
s!^depend release/(.*)$! year = \1;!p
s!^depend revision/(.*)$! revision = \1;!p
}
# form an attrmap per package
# ignore packages whose name contains "." (such as binaries) except for texlive.infra
/^name ([^.]+|texlive\.infra)$/,/^$/{
# quote invalid names
s/^name ([0-9].*|texlive\.infra)$/"\1" = {/p
s/^name (.*)$/\1 = {/p
# extract revision
s/^revision ([0-9]*)$/ revision = \1;/p
# extract hashes of *.tar.xz
s/^containerchecksum (.*)/ sha512.run = "\1";/p
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p
# number of path components to strip, defaulting to 1 ("texmf-dist/")
/^relocated 1/i\ stripPrefix = 0;
# extract version and clean unwanted chars from it
/^catalogue-version/y/ \/~/_--/
/^catalogue-version/s/[\#,:\(\)]//g
s/^catalogue-version_(.*)/ version = "\1";/p
# extract deps
/^depend ([^.]+|texlive\.infra)$/{
# open a list
i\ deps = [
# loop through following depend lines
:next-dep
s/^\n?depend ([^.]+|texlive\.infra)$/ "\1"/p # print dep
s/^.*$// # clear pattern space
N; /^\ndepend /b next-dep
# close the list
i\ ];
D # restart cycle from the current line
}
# detect presence of notable files
/^runfiles /{
s/^.*$// # ignore the first line
# read all files
:next-file
N
s/\n / / # remove newline
t next-file # loop if previous line matched
/ (RELOC|texmf-dist)\//i\ hasRunfiles = true;
/ tlpkg\//i\ hasTlpkg = true;
D # restart cycle from the current line
}
# extract postaction scripts (right now, at most one per package, so a string suffices)
s/^postaction script file=(.*)$/ postactionScript = "\1";/p
# extract hyphenation patterns and formats
# (this may create duplicate lines, use uniq to remove them)
/^execute\sAddHyphen/i\ hasHyphens = true;
/^execute\sAddFormat/i\ hasFormats = true;
# close attrmap
/^$/i};
}
|