Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate bin/check-ports @ 100:a9324638b70e
FIX: Style
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 25 Sep 2019 09:43:46 +0200 |
| parents | 7a064049405f |
| children | bf8f0aa3c698 |
| rev | line source |
|---|---|
|
0
08cf7bf119b7
Current version of a tool to check the versions of installed ports against the source ports tree and other binary repositories
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
1 #!/bin/sh |
| 79 | 2 # -*- indent-tabs-mode: nil; -*- |
|
86
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
3 : 'Check the version status of installed ports and compare them to |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
4 repository versions. |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
5 |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
6 :Author: Franz Glasner |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
7 :Copyright: (c) 2017-2019 Franz Glasner. |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
8 All rights reserved. |
|
99
7a064049405f
Use the "Full name" in the license section
Franz Glasner <fzglas.hg@dom66.de>
parents:
94
diff
changeset
|
9 :License: BSD 3-Clause "New" or "Revised" License. |
|
86
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
10 See LICENSE for details. |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
11 If you cannot find LICENSE see |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
12 <https://opensource.org/licenses/BSD-3-Clause> |
| 93 | 13 :ID: @(#)@@PKGORIGIN@@ $HGid$ |
|
86
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
14 |
|
a3b9d4fe560e
Provide "module" doc-strings
Franz Glasner <fzglas.hg@dom66.de>
parents:
85
diff
changeset
|
15 ' |
|
0
08cf7bf119b7
Current version of a tool to check the versions of installed ports against the source ports tree and other binary repositories
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
16 |
| 79 | 17 VERSION="@@VERSION@@" |
|
17
089afc4908c0
Expand @@VERSION@@ with the package version also
Franz Glasner <hg@dom66.de>
parents:
16
diff
changeset
|
18 |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
19 # |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
20 # Configuration directory |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
21 # |
|
66
1f3a64254c9c
Replace @@ETCDIR@@ and @@INDEXFILE@@ dynamically at package build time
Franz Glasner <hg@dom66.de>
parents:
64
diff
changeset
|
22 : ${CONFIGDIR:=@@ETCDIR@@} |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
23 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
24 # |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
25 # Mapping configuration: installed package name -> original package name |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
26 # Note: This is independent of any repo |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
27 # |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
28 : ${PACKAGE_MAPPING:=${CONFIGDIR}/package-mapping.conf} |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
29 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
30 # |
| 55 | 31 # Local repository with non-public packages and/or ports with changed |
| 32 # OPTIONS (i.e. not using the defaults) or forks of official packages with | |
| 33 # other package names | |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
34 # |
| 1 | 35 : ${LOCAL_REPO:=LocalRepo} |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
36 |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
37 # |
|
15
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
38 # Local repository with ports with default OPTIONS (i.e. unchanged) |
|
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
39 # but newer than the packages in the "FreeBSD" repository. |
|
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
40 # Some sort of a fast-track repository. |
|
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
41 # |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
42 : ${LOCALBSDPORTS_REPO:=LocalBSDPorts} |
| 59 | 43 |
|
15
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
44 # |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
45 # The official FreeBSD binary repository |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
46 # |
| 1 | 47 : ${FREEBSD_REPO:=FreeBSD} |
| 59 | 48 |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
49 # |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
50 # Directly installed from ports |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
51 # |
| 1 | 52 : ${PORTS_DIRECT_INSTALLED_REPO:=unknown-repository} |
| 53 | |
|
64
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
54 # |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
55 # For the workaround of the bug in pkg rquery -I |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
56 # |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
57 : ${PORTSDIR:=/usr/ports} |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
58 : ${INDEXDIR:=${PORTSDIR}} |
|
66
1f3a64254c9c
Replace @@ETCDIR@@ and @@INDEXFILE@@ dynamically at package build time
Franz Glasner <hg@dom66.de>
parents:
64
diff
changeset
|
59 : ${INDEXFILE:=@@INDEXFILE@@} |
|
64
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
60 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
61 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
62 get_remote_repo_versions() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
63 : 'Determine the remote repository versions of all packages in |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
64 repository `_repo`. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
65 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
66 Args: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
67 _repo: the name of the repote repository |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
68 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
69 Returns: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
70 status 0 on success, 1 on errors |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
71 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
72 Output (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
73 remote_versions_${_repo}: the versions of all packages in `_repo` and |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
74 their extended version status with respect to |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
75 locally installed packages |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
76 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
77 ' |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
78 local _repo _data _rv |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
79 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
80 _repo=$1 |
|
0
08cf7bf119b7
Current version of a tool to check the versions of installed ports against the source ports tree and other binary repositories
Franz Glasner <hg@dom66.de>
parents:
diff
changeset
|
81 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
82 _data=$(pkg version -U -R -r ${_repo} -v) |
| 1 | 83 _rv=$? |
|
60
ec0cc8a8f27a
Renamed remote_REPO_versions to remote_versions_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
59
diff
changeset
|
84 eval remote_versions_${_repo}=\"\${_data}\" |
| 1 | 85 return ${_rv} |
| 86 } | |
| 87 | |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
88 get_remote_repo_data() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
89 : 'Get the extended package version information from the remote repository |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
90 `_repo` for package `_name`. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
91 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
92 Args: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
93 _repo: the name of the remote repository |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
94 _name: the package name |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
95 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
96 Input (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
97 remote_versions_${_repo}: the extended version info for *all* packages |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
98 in repo `_repo`. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
99 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
100 Returns: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
101 status 0 on success, 1 on errors or if the package is not found |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
102 in the remote repository |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
103 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
104 Output (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
105 remote_label_${_repo}: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
106 remote_descr_${_repo}: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
107 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
108 ' |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
109 local _repo _name _rversions _rfqp _rl _rdescr |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
110 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
111 _repo=$1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
112 _name=$2 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
113 |
|
60
ec0cc8a8f27a
Renamed remote_REPO_versions to remote_versions_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
59
diff
changeset
|
114 eval _rversions=\"\${remote_versions_${_repo}}\" |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
115 while read _rfqp _rl _rdescr ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
116 if [ ${_rfqp%-*} = ${_name} ] ; then |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
117 eval remote_label_${_repo}=\"\${_rl}\" |
|
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
118 eval remote_descr_${_repo}=\"\${_rdescr}\" |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
119 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
120 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
121 done <<EOF884657 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
122 ${_rversions} |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
123 EOF884657 |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
124 eval remote_label_${_repo}="" |
|
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
125 eval remote_descr_${_repo}="" |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
126 return 1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
127 } |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
128 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
129 get_local_index_versions() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
130 : 'Determine the extendes versions of all packages in the local index |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
131 (ports). |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
132 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
133 Returns: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
134 status 0 on success or 1 on errors |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
135 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
136 Output (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
137 local_index_versions: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
138 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
139 ' |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
140 local_index_versions=$(pkg version -I -v) |
| 1 | 141 } |
| 142 | |
|
56
ad454e403e24
Rename function: has now a better name
Franz Glasner <fzglas.hg@dom66.de>
parents:
55
diff
changeset
|
143 get_repo_for_installed_package() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
144 : 'Determine for a package `_name` from which repository is has been |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
145 installed. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
146 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
147 Args: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
148 _name: the name of the package to search for |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
149 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
150 Returns: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
151 0 on success, 1 on errors or if the package is not installed |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
152 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
153 Output (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
154 repository: the repository from which the installed packages `_name` |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
155 has been installed |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
156 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
157 ' |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
158 local _name _n _v _r |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
159 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
160 _name=$1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
161 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
162 while read _n _v _r ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
163 if [ ${_name} = ${_n} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
164 repository=${_r} |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
165 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
166 fi |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
167 done <<EOF223777 |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
168 ${installed_data} |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
169 EOF223777 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
170 return 1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
171 } |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
172 |
|
63
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
173 get_immediate_index_version() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
174 : 'Determine for package `_package` the version of the package in the |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
175 local ports index. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
176 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
177 Args: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
178 _package: the package name to search for |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
179 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
180 Input (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
181 INDEXDIR: the directory where to search the index file |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
182 INDEXFILE: the name of the index file |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
183 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
184 Returns: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
185 0 on success, 1 on errors or if the package is not in the index |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
186 |
| 100 | 187 Output (Globals): |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
188 immediate_index_version: the version number of `_package` in the |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
189 index |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
190 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
191 ' |
|
64
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
192 local _package _line _fqpn _n _lines |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
193 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
194 _package=$1 |
|
63
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
195 |
|
64
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
196 # _val=$(pkg rquery -I "${_package}" | cut -f 1 -d '|') |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
197 # _rv=$? |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
198 # immediate_index_version=${_val##*-} |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
199 # return ${_rv} |
|
63
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
200 |
|
64
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
201 if [ -r "${INDEXDIR}/${INDEXFILE}" ] ; then |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
202 # |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
203 # Note: Direct piping does not set immediate_index_version at return correctly |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
204 # "_line" is set correctly and parsing works, but the return 0 seems to kill |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
205 # some of the previous effects. |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
206 # |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
207 # "grep" does a fast pre-selection, reading, parsing and comparing is done for |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
208 # exact matching. |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
209 # |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
210 _lines=$(egrep '^'"${_package}" "${INDEXDIR}/${INDEXFILE}") |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
211 while read _line ; do |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
212 _fqpn="${_line%%|*}" |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
213 _n=${_fqpn%-*} |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
214 if [ "${_package}" = "${_n}" ] ; then |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
215 immediate_index_version="${_fqpn##*-}" |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
216 return 0 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
217 fi |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
218 done <<EOF1334TGH1 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
219 ${_lines} |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
220 EOF1334TGH1 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
221 fi |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
222 |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
223 immediate_index_version="" |
|
ffd5f575edd5
FIX: Work around the bug in "pkg rquery -i" not asking the port's INDEX file.
Franz Glasner <hg@dom66.de>
parents:
63
diff
changeset
|
224 return 1 |
|
63
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
225 } |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
226 |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
227 get_immediate_remote_repo_version() { |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
228 local _repo _name _version _rv |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
229 |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
230 _repo=$1 |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
231 _name=$2 |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
232 |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
233 _version=$(pkg rquery -U -r "${_repo}" '%v' "${_name}") |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
234 _rv=$? |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
235 eval immediate_remote_repo_version_${_repo}=\"\${_version}\" |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
236 return ${_rv} |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
237 } |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
238 |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
239 assert_local_version() { |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
240 local _name _version _n _v _r |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
241 |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
242 _name=$1 |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
243 _version=$2 |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
244 |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
245 while read _n _v _r ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
246 if [ ${_name} = ${_n} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
247 if [ ${_version} != ${_v} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
248 return 1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
249 else |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
250 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
251 fi |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
252 fi |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
253 done <<EOF223 |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
254 ${installed_data} |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
255 EOF223 |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
256 return 2 |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
257 } |
|
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
258 |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
259 get_mapping() { |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
260 local _package _n _mapped |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
261 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
262 _package=$1 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
263 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
264 if [ -r "${PACKAGE_MAPPING}" ] ; then |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
265 while read _n _mapped ; do |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
266 if [ "${_n}" = "${_package}" ] ; then |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
267 mapped_package_name="${_mapped}" |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
268 return 0 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
269 fi |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
270 done < ${PACKAGE_MAPPING} |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
271 fi |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
272 mapped_package_name="" |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
273 return 1 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
274 } |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
275 |
|
31
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
276 print_title() { |
|
94
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
277 : 'Print the output title line for a package |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
278 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
279 Args: |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
280 _package: the package name |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
281 _repo: the repository name |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
282 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
283 Input (Globals). |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
284 title_printed: a global that determines if the title really needs |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
285 to be printed. |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
286 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
287 If it is an empty string the the title is |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
288 really printed and the variable is set to |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
289 "yes". |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
290 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
291 Output (Globals): |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
292 title_printed: set to "yes" if the title has been printed |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
293 |
|
c9fb9e920a32
Docu: documented many functions
Franz Glasner <fzglas.hg@dom66.de>
parents:
93
diff
changeset
|
294 ' |
|
31
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
295 local _package _repo |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
296 |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
297 _package=$1 |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
298 _repo=$2 |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
299 if [ -z "${title_printed}" ] ; then |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
300 echo "${_package} (${_repo})" |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
301 title_printed=yes |
|
31
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
302 fi |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
303 } |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
304 |
|
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
305 |
|
10
f08b39dacb21
Implemented "-A" and "-a" options for printing info for all installed packages and/or with LocalRepo data
Franz Glasner <hg@dom66.de>
parents:
9
diff
changeset
|
306 alldata_flag="" |
|
61
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
307 alldata_flag_LocalBSDPorts="" |
|
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
308 alldata_flag_LocalRepo="" |
|
34
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
309 short_flag="" |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
310 verbose_flag="" |
|
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
311 |
|
81
124faa20ae80
Implemented a "-V" global option to print the program's name and version number to stdout
Franz Glasner <fzglas.hg@dom66.de>
parents:
79
diff
changeset
|
312 while getopts "VAasv" _opt ; do |
|
10
f08b39dacb21
Implemented "-A" and "-a" options for printing info for all installed packages and/or with LocalRepo data
Franz Glasner <hg@dom66.de>
parents:
9
diff
changeset
|
313 case ${_opt} in |
|
81
124faa20ae80
Implemented a "-V" global option to print the program's name and version number to stdout
Franz Glasner <fzglas.hg@dom66.de>
parents:
79
diff
changeset
|
314 V) |
|
124faa20ae80
Implemented a "-V" global option to print the program's name and version number to stdout
Franz Glasner <fzglas.hg@dom66.de>
parents:
79
diff
changeset
|
315 echo "check-ports v${VERSION} (rv:@@HGREVISION@@)" |
|
124faa20ae80
Implemented a "-V" global option to print the program's name and version number to stdout
Franz Glasner <fzglas.hg@dom66.de>
parents:
79
diff
changeset
|
316 exit 0 |
|
124faa20ae80
Implemented a "-V" global option to print the program's name and version number to stdout
Franz Glasner <fzglas.hg@dom66.de>
parents:
79
diff
changeset
|
317 ;; |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
318 A) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
319 # print for every package the status of all repositories |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
320 alldata_flag=1 |
|
61
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
321 alldata_flag_LocalBSDPorts=1 |
|
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
322 alldata_flag_LocalRepo=1 |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
323 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
324 a) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
325 # print the data of all repos that have the package |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
326 alldata_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
327 ;; |
|
34
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
328 s) |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
329 # "short" output: if installed from FreeBSD repo: don't |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
330 # report if only the index is newer |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
331 short_flag=1 |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
332 ;; |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
333 v) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
334 # print all titles and repo of every installed always |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
335 verbose_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
336 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
337 \?) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
338 exit 2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
339 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
340 *) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
341 echo "option handling failed" >&2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
342 exit 2 |
| 42 | 343 ;; |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
344 esac |
|
12
fd56d1b7d822
Use extra flag for controlling the printing of the package title
Franz Glasner <hg@dom66.de>
parents:
11
diff
changeset
|
345 done |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
346 |
|
34
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
347 if [ -n "${short_flag}" -a -n "${alldata_flag}" ]; then |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
348 echo "the -s option cannot be combined with -A or -a" >&2 |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
349 exit 2 |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
350 fi |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
351 |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
352 installed_packages=$(pkg query '%n') |
|
4
ba95569a12b1
Use standars word separators again (i.e. don't change IFS)
Franz Glasner <hg@dom66.de>
parents:
3
diff
changeset
|
353 installed_data="$(pkg query '%n %v %R' $installed_packages)" |
| 1 | 354 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
355 get_remote_repo_versions ${LOCAL_REPO} |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
356 get_remote_repo_versions ${LOCALBSDPORTS_REPO} |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
357 get_remote_repo_versions ${FREEBSD_REPO} |
|
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
358 get_local_index_versions |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
359 |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
360 while read lfqp llabel ldescr ; do |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
361 _installed_name=${lfqp%-*} |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
362 _installed_version=${lfqp##*-} |
|
31
abe1659ff3c1
Refactor: a "print_title()" function which prints the title line (package and repo) if its not yet printed
Franz Glasner <hg@dom66.de>
parents:
24
diff
changeset
|
363 title_printed="" |
|
56
ad454e403e24
Rename function: has now a better name
Franz Glasner <fzglas.hg@dom66.de>
parents:
55
diff
changeset
|
364 get_repo_for_installed_package ${_installed_name} |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
365 get_mapping ${_installed_name} |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
366 if [ -n "${verbose_flag}" ] ; then |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
367 print_title "${lfqp}" "${repository}" |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
368 fi |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
369 if ! assert_local_version ${_installed_name} ${_installed_version} ; then |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
370 echo "Assertion failed: $lfqp ${_installed_name} ${_installed_version} ${llabel}" >&2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
371 exit 1 |
|
7
2712d249c371
Assert that the installed version number we get from "pkg query" is the same as the version in "pkg version"
Franz Glasner <hg@dom66.de>
parents:
6
diff
changeset
|
372 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
373 get_remote_repo_data ${LOCAL_REPO} ${_installed_name} |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
374 get_remote_repo_data ${LOCALBSDPORTS_REPO} ${_installed_name} |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
375 get_remote_repo_data ${FREEBSD_REPO} ${_installed_name} |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
376 _print_detail="" |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
377 if [ -n "${mapped_package_name}" ] ; then |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
378 _print_detail=1 |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
379 fi |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
380 if [ \( -n "${alldata_flag}" \) ]; then |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
381 _print_detail=1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
382 else |
|
34
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
383 if [ -n "${short_flag}" ]; then |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
384 # |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
385 # NOTE: -s and -A/-a are incompatible: so "alldata_XXX" needs not |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
386 # to be checked! |
|
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
387 # |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
388 case "${repository}" in |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
389 "${FREEBSD_REPO}") |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
390 if [ \( "${llabel}" != '<' -a "${llabel}" != '=' \) -o "${remote_label_FreeBSD}" != '=' -o "${remote_label_LocalRepo}" != '?' -o "${remote_label_LocalBSDPorts}" != '?' ]; then |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
391 _print_detail=1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
392 fi |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
393 ;; |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
394 "${LOCAL_REPO}") |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
395 _print_detail=1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
396 ;; |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
397 "${LOCALBSDPORTS_REPO}") |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
398 if [ "${llabel}" != '=' -o "${remote_label_FreeBSD}" != '>' -o "${remote_label_LocalRepo}" != '?' -o "${remote_label_LocalBSDPorts}" = '?' -o "${remote_label_LocalBSDPorts}" = '<' ]; then |
|
50
f4352f7b5c86
When running in "-s"-mode: extra intelligence when the repo is LocalBSDPorts
Franz Glasner <hg@dom66.de>
parents:
49
diff
changeset
|
399 _print_detail=1 |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
400 fi |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
401 ;; |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
402 "${PORTS_DIRECT_INSTALLED_REPO}") |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
403 _print_detail=1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
404 ;; |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
405 *) |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
406 echo "ERROR: unhandled repository: ${repository}" >&2 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
407 exit 1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
408 ;; |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
409 esac |
|
34
36a10ff20355
Implemented a -s (short) flag that filters output if the repo is FreeBSD and only the local portstree INDEX has a newer version
Franz Glasner <hg@dom66.de>
parents:
33
diff
changeset
|
410 else |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
411 if [ \( \( "${llabel}" != '?' -a "${llabel}" != '=' \) -o \( "${remote_label_FreeBSD}" != '?' -a "${remote_label_FreeBSD}" != '=' \) -o \( "${remote_label_LocalBSDPorts}" != '?' -a "${remote_label_LocalBSDPorts}" != '=' \) -o \( "${remote_label_LocalRepo}" != '?' -a "${remote_label_LocalRepo}" != '=' \) \) -o \( "${repository}" = "${PORTS_DIRECT_INSTALLED_REPO}" \) ]; then |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
412 _print_detail=1 |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
413 fi |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
414 fi |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
415 fi |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
416 if [ -n "${_print_detail}" ]; then |
|
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
417 print_title "${lfqp}" "${repository}" |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
418 echo " INDEX : ${llabel} ${ldescr}" |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
419 echo " FreeBSD : ${remote_label_FreeBSD} ${remote_descr_FreeBSD}" |
|
61
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
420 if [ \( -n "${alldata_flag_LocalBSDPorts}" \) -o \( "${remote_label_LocalBSDPorts}" != '?' \) ] ; then |
|
58
28800573d702
Rename variables: the repo name in the "label" and "descr" variables at the end of the variable name
Franz Glasner <fzglas.hg@dom66.de>
parents:
56
diff
changeset
|
421 echo " LocalBSDPorts: ${remote_label_LocalBSDPorts} ${remote_descr_LocalBSDPorts}" |
|
51
9e131a355fbe
Refactor: new -s (short-mode) implementation and new loop architecture
Franz Glasner <hg@dom66.de>
parents:
50
diff
changeset
|
422 fi |
|
61
26cf051f6c93
Rename alldata_REPO_flag to alldata_flag_REPO
Franz Glasner <fzglas.hg@dom66.de>
parents:
60
diff
changeset
|
423 if [ \( -n "${alldata_flag_LocalRepo}" \) -o \( "${remote_label_LocalRepo}" != '?' \) ] ; then |
|
62
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
424 echo " LocalRepo : ${remote_label_LocalRepo} ${remote_descr_LocalRepo}" |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
425 fi |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
426 if [ -n "${mapped_package_name}" ] ; then |
|
6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
Franz Glasner <fzglas.hg@dom66.de>
parents:
61
diff
changeset
|
427 echo " ---> ${mapped_package_name}" |
|
63
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
428 get_immediate_index_version "${mapped_package_name}" |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
429 get_immediate_remote_repo_version ${LOCAL_REPO} ${mapped_package_name} |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
430 get_immediate_remote_repo_version ${LOCALBSDPORTS_REPO} ${mapped_package_name} |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
431 get_immediate_remote_repo_version ${FREEBSD_REPO} ${mapped_package_name} |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
432 echo " INDEX : ${immediate_index_version}" |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
433 echo " FreeBSD : ${immediate_remote_repo_version_FreeBSD}" |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
434 echo " LocalBSDPorts: ${immediate_remote_repo_version_LocalBSDPorts}" |
|
0ae7697702b3
Handling of mapped packages is basically implemented.
Franz Glasner <hg@dom66.de>
parents:
62
diff
changeset
|
435 echo " LocalRepo : ${immediate_remote_repo_version_LocalRepo}" |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
436 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
437 fi |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
438 done <<EOF856661111299999 |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
439 ${local_index_versions} |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
440 EOF856661111299999 |
