Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate bin/check-ports @ 32:37f003c9f4e2
untabify and comments for options
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Sat, 18 Nov 2017 11:53:41 +0100 |
| parents | abe1659ff3c1 |
| children | 1537aff795c5 |
| 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 |
|
16
08fc189baf67
Put some keyword expansion into the port.
Franz Glasner <hg@dom66.de>
parents:
15
diff
changeset
|
2 # |
|
21
441e007426e7
Adjusted keyword replacement to my latest standard
Franz Glasner <hg@dom66.de>
parents:
20
diff
changeset
|
3 # $HGsource$ |
|
441e007426e7
Adjusted keyword replacement to my latest standard
Franz Glasner <hg@dom66.de>
parents:
20
diff
changeset
|
4 # $Revision$ $Date$ $Author$ |
|
441e007426e7
Adjusted keyword replacement to my latest standard
Franz Glasner <hg@dom66.de>
parents:
20
diff
changeset
|
5 # |
|
441e007426e7
Adjusted keyword replacement to my latest standard
Franz Glasner <hg@dom66.de>
parents:
20
diff
changeset
|
6 # $HGpath$ |
|
16
08fc189baf67
Put some keyword expansion into the port.
Franz Glasner <hg@dom66.de>
parents:
15
diff
changeset
|
7 # |
|
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
|
8 |
|
17
089afc4908c0
Expand @@VERSION@@ with the package version also
Franz Glasner <hg@dom66.de>
parents:
16
diff
changeset
|
9 VERSION=@@VERSION@@ |
|
089afc4908c0
Expand @@VERSION@@ with the package version also
Franz Glasner <hg@dom66.de>
parents:
16
diff
changeset
|
10 |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
11 # |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
12 # Local repository with |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
13 # non-public packages and/or ports with changed OPTIONS (i.e. not using the |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
14 # defaults) |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
15 # |
| 1 | 16 : ${LOCAL_REPO:=LocalRepo} |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
17 # |
|
15
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
18 # 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
|
19 # but newer than the packages in the "FreeBSD" repository. |
|
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
20 # Some sort of a fast-track repository. |
|
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
21 # |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
22 : ${LOCALBSDPORTS_REPO:=LocalBSDPorts} |
|
15
532757223c28
Handle a "FreeBSDPorts" repository also.
Franz Glasner <hg@dom66.de>
parents:
14
diff
changeset
|
23 # |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
24 # The official FreeBSD binary repository |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
25 # |
| 1 | 26 : ${FREEBSD_REPO:=FreeBSD} |
|
14
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
27 # |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
28 # Directly installed from ports |
|
c0e2eb5613fe
Comment on the 3 repositories handled repositories
Franz Glasner <hg@dom66.de>
parents:
12
diff
changeset
|
29 # |
| 1 | 30 : ${PORTS_DIRECT_INSTALLED_REPO:=unknown-repository} |
| 31 | |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
32 get_remote_repo_versions() { |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
33 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
|
34 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
35 _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
|
36 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
37 _data=$(pkg version -U -R -r ${_repo} -v) |
| 1 | 38 _rv=$? |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
39 eval remote_${_repo}_versions=\"\${_data}\" |
| 1 | 40 return ${_rv} |
| 41 } | |
| 42 | |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
43 get_remote_repo_data() { |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
44 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
|
45 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
46 _repo=$1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
47 _name=$2 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
48 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
49 eval _rversions=\"\${remote_${_repo}_versions}\" |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
50 while read _rfqp _rl _rdescr ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
51 if [ ${_rfqp%-*} = ${_name} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
52 eval remote_${_repo}_label=\${_rl} |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
53 eval remote_${_repo}_descr=\"\${_rdescr}\" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
54 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
55 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
56 done <<EOF884657 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
57 ${_rversions} |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
58 EOF884657 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
59 eval remote_${_repo}_label="" |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
60 eval remote_${_repo}_descr="" |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
61 return 1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
62 } |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
63 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
64 get_local_index_versions() { |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
65 local_index_versions=$(pkg version -I -v) |
| 1 | 66 } |
| 67 | |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
68 get_repo_for_package() { |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
69 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
|
70 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
71 _name=$1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
72 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
73 while read _n _v _r ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
74 if [ ${_name} = ${_n} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
75 repository=${_r} |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
76 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
77 fi |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
78 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
|
79 ${installed_data} |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
80 EOF223777 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
81 return 1 |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
82 } |
|
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
83 |
|
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
|
84 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
|
85 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
|
86 |
|
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
|
87 _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
|
88 _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
|
89 |
|
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
|
90 while read _n _v _r ; do |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
91 if [ ${_name} = ${_n} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
92 if [ ${_version} != ${_v} ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
93 return 1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
94 else |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
95 return 0 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
96 fi |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
97 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
|
98 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
|
99 ${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
|
100 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
|
101 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
|
102 } |
|
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
|
103 |
|
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
|
104 print_title() { |
|
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
|
105 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
|
106 |
|
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
|
107 _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
|
108 _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
|
109 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
|
110 echo "${_package} (${_repo})" |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
111 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
|
112 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
|
113 } |
|
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
|
114 |
|
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
|
115 |
|
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
|
116 alldata_flag="" |
|
22
864971f5cddd
Renamed FreeBSDPorts to LocalBSDPorts.
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
21
diff
changeset
|
117 alldata_LocalBSDPorts_flag="" |
|
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
|
118 alldata_LocalRepo_flag="" |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
119 verbose_flag="" |
|
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
120 |
|
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
|
121 while getopts "Aav" _opt ; do |
|
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
|
122 case ${_opt} in |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
123 A) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
124 # print for every package the status of all repositories |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
125 alldata_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
126 alldata_LocalBSDPorts_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
127 alldata_LocalRepo_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
128 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
129 a) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
130 # 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
|
131 alldata_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
132 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
133 v) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
134 # print all titles and repo of every installed always |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
135 verbose_flag=1 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
136 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
137 \?) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
138 exit 2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
139 ;; |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
140 *) |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
141 echo "option handling failed" >&2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
142 exit 2 |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
143 ;; |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
144 esac |
|
12
fd56d1b7d822
Use extra flag for controlling the printing of the package title
Franz Glasner <hg@dom66.de>
parents:
11
diff
changeset
|
145 done |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
146 |
|
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
|
147 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
|
148 installed_data="$(pkg query '%n %v %R' $installed_packages)" |
| 1 | 149 |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
150 get_remote_repo_versions ${LOCAL_REPO} |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
151 get_remote_repo_versions ${LOCALBSDPORTS_REPO} |
|
5
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
152 get_remote_repo_versions ${FREEBSD_REPO} |
|
53c3500894d2
Begin a new implementation algorithm
Franz Glasner <hg@dom66.de>
parents:
4
diff
changeset
|
153 get_local_index_versions |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
154 |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
155 while read lfqp llabel ldescr ; do |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
156 _installed_name=${lfqp%-*} |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
157 _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
|
158 title_printed="" |
|
24
eb764268337c
FIX: Print the correct repository in all cases
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
23
diff
changeset
|
159 get_repo_for_package ${_installed_name} |
|
9
6b77068e7ec8
Introduced option handling with getopts: implemented a "v" option (verbose)
Franz Glasner <hg@dom66.de>
parents:
8
diff
changeset
|
160 if [ -n "${verbose_flag}" ] ; then |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
161 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
|
162 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
|
163 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
|
164 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
|
165 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
|
166 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
167 get_remote_repo_data ${LOCAL_REPO} ${_installed_name} |
|
23
242055572964
FIX: Variable naming
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
22
diff
changeset
|
168 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
|
169 get_remote_repo_data ${FREEBSD_REPO} ${_installed_name} |
|
22
864971f5cddd
Renamed FreeBSDPorts to LocalBSDPorts.
Franz Glasner <f.glasner@feldmann-mg.com>
parents:
21
diff
changeset
|
170 if [ \( -n "${alldata_flag}" \) -o \( ${llabel} != '?' -a ${llabel} != '=' \) -o \( ${remote_FreeBSD_label} != '?' -a ${remote_FreeBSD_label} != '=' \) -o \( ${remote_LocalBSDPorts_label} != '?' -a ${remote_LocalBSDPorts_label} != '=' \) -o \( ${remote_LocalRepo_label} != '?' -a ${remote_LocalRepo_label} != '=' \) ] ; then |
|
32
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
171 print_title "${lfqp}" "${repository}" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
172 echo " INDEX: ${llabel} ${ldescr}" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
173 echo " FreeBSD: ${remote_FreeBSD_label} ${remote_FreeBSD_descr}" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
174 if [ \( -n "${alldata_LocalBSDPorts_flag}" \) -o \( ${remote_LocalBSDPorts_label} != '?' \) ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
175 echo " LocalBSDPorts: ${remote_LocalBSDPorts_label} ${remote_LocalBSDPorts_descr}" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
176 fi |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
177 if [ \( -n "${alldata_LocalRepo_flag}" \) -o \( ${remote_LocalRepo_label} != '?' \) ] ; then |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
178 echo " LocalRepo: ${remote_LocalRepo_label} ${remote_LocalRepo_descr}" |
|
37f003c9f4e2
untabify and comments for options
Franz Glasner <hg@dom66.de>
parents:
31
diff
changeset
|
179 fi |
|
8
208545b92d43
First working version: real useful output of packages differing from any repo
Franz Glasner <hg@dom66.de>
parents:
7
diff
changeset
|
180 fi |
|
6
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
181 done <<EOF856661111299999 |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
182 ${local_index_versions} |
|
0d9a499e89e9
More tests with regard to the new algorithm
Franz Glasner <hg@dom66.de>
parents:
5
diff
changeset
|
183 EOF856661111299999 |
