Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate tests/ports.t @ 793:3b5a59b0840d
common.subr: Shell variable quoting in eval in checkyesno() and checkyes()
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 30 Oct 2024 14:15:59 +0100 |
| parents | 954d3607e87d |
| children | 2310764e5c4e |
| rev | line source |
|---|---|
|
770
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 Basic tests of ports.subr |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 Shell is /bin/sh |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
5 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
6 Setup |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 ===== |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
8 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
9 We need common.subr and ports.subr |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
10 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
11 $ set -u |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
12 $ . "${TESTDIR}/testsetup.sh" |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
13 $ _p_datadir="${TESTDIR}/../share/local-bsdtools" |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
14 $ . "${_p_datadir}/farray.sh" |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
15 $ . "${_p_datadir}/common.subr" |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
16 $ . "${_p_datadir}/ports.subr" |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
17 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
18 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
19 Package Mapping |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
20 =============== |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
21 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
22 init_package_mapping |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
23 -------------------- |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
24 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
25 $ init_package_mapping PMAPPING |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
26 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
27 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
28 get_package_mapping |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
29 ------------------- |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
30 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
31 An empty database errors fatally |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
32 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
33 $ (get_package_mapping '' whatever-package) |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
34 ERROR: missing falist name or token value |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
35 [70] |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
36 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
37 Empty package name errors fatally |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
38 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
39 $ (get_package_mapping PMAPPING) |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
40 /bin/sh: ERROR: missing package name |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
41 [64] |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
42 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
43 $ get_package_mapping PMAPPING install-package |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
44 parent-package (no-eol) |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
45 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
46 This is the target of the mapping |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
47 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
48 $ get_package_mapping PMAPPING parent-package |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
49 [1] |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
50 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
51 Another package |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
52 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
53 $ get_package_mapping PMAPPING install-package-v2 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
54 parent-package-v2 (no-eol) |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
55 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
56 Commented out |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
57 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
58 $ get_package_mapping PMAPPING install-package-v3 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
59 [1] |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
60 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
61 |
|
791
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
62 Local Index File |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
63 ================ |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
64 |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
65 Assumes fag's standard: PORTSDIR=/home/fag/ports |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
66 |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
67 $ is_local_index_file_available |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
68 $ PORTSDIR=/nonexisting is_local_index_file_available |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
69 [1] |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
70 $ export VERSION_SOURCE=I |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
71 $ is_local_index_file_available |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
72 [1] |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
73 $ export VERSION_SOURCE=P |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
74 $ is_local_index_file_available |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
75 $ unset VERSION_SOURCE |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
76 |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
77 $ get_local_index_file |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
78 /home/fag/ports/INDEX-[0-9]+ \(no-eol\) (re) |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
79 $ PORTSDIR=/nonexisting get_local_index_file |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
80 [1] |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
81 $ export VERSION_SOURCE=I |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
82 $ get_local_index_file |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
83 [1] |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
84 $ export VERSION_SOURCE=P |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
85 $ get_local_index_file |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
86 /home/fag/ports/INDEX-[0-9]+ \(no-eol\) (re) |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
87 $ unset VERSION_SOURCE |
|
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
88 |
|
792
954d3607e87d
ports.subr: Parse a (local) index file for a package version
Franz Glasner <fzglas.hg@dom66.de>
parents:
791
diff
changeset
|
89 $ _pkgversion="$(parse_index_file_for_package_version "$(get_local_index_file)" 'pkg')" |
|
954d3607e87d
ports.subr: Parse a (local) index file for a package version
Franz Glasner <fzglas.hg@dom66.de>
parents:
791
diff
changeset
|
90 $ [ -n "${_pkgversion}" ] |
|
954d3607e87d
ports.subr: Parse a (local) index file for a package version
Franz Glasner <fzglas.hg@dom66.de>
parents:
791
diff
changeset
|
91 $ printf '%s' "${_pkgversion}" |
|
954d3607e87d
ports.subr: Parse a (local) index file for a package version
Franz Glasner <fzglas.hg@dom66.de>
parents:
791
diff
changeset
|
92 \d+\.\d+(\.\d+) \(no-eol\) (re) |
|
954d3607e87d
ports.subr: Parse a (local) index file for a package version
Franz Glasner <fzglas.hg@dom66.de>
parents:
791
diff
changeset
|
93 |
|
791
1ffb4e15151d
ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR).
Franz Glasner <fzglas.hg@dom66.de>
parents:
770
diff
changeset
|
94 |
|
770
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
95 Repositories |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
96 ============ |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
97 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
98 Assume that FreeBSD is always configured and enabled |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
99 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
100 $ get_configured_pkg_repository_names | grep -F FreeBSD |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
101 FreeBSD |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
102 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
103 |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
104 # Runtime much too long: need another strategy |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
105 # $ REPODB='' |
|
56ab5c012d5f
fports: Begin a new command "fports" and fully implemented its subcommand "fports deptree".
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
106 # $ init_repositories REPODB |
