Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison bin/check-ports @ 62:6c8ee1ef9ef2
First parts of checks of forked and/or renamed packages
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 21 Mar 2019 09:39:39 +0100 |
| parents | 26cf051f6c93 |
| children | 0ae7697702b3 |
comparison
equal
deleted
inserted
replaced
| 61:26cf051f6c93 | 62:6c8ee1ef9ef2 |
|---|---|
| 5 # | 5 # |
| 6 # $HGpath$ | 6 # $HGpath$ |
| 7 # | 7 # |
| 8 | 8 |
| 9 VERSION=@@VERSION@@ | 9 VERSION=@@VERSION@@ |
| 10 | |
| 11 # | |
| 12 # Configuration directory | |
| 13 # | |
| 14 : ${CONFIGDIR:=/usr/local/etc/local-bsdtools} | |
| 15 | |
| 16 # | |
| 17 # Mapping configuration: installed package name -> original package name | |
| 18 # Note: This is independent of any repo | |
| 19 # | |
| 20 : ${PACKAGE_MAPPING:=${CONFIGDIR}/package-mapping.conf} | |
| 10 | 21 |
| 11 # | 22 # |
| 12 # Local repository with non-public packages and/or ports with changed | 23 # Local repository with non-public packages and/or ports with changed |
| 13 # OPTIONS (i.e. not using the defaults) or forks of official packages with | 24 # OPTIONS (i.e. not using the defaults) or forks of official packages with |
| 14 # other package names | 25 # other package names |
| 15 # | 26 # |
| 16 : ${LOCAL_REPO:=LocalRepo} | 27 : ${LOCAL_REPO:=LocalRepo} |
| 28 | |
| 17 # | 29 # |
| 18 # Local repository with ports with default OPTIONS (i.e. unchanged) | 30 # Local repository with ports with default OPTIONS (i.e. unchanged) |
| 19 # but newer than the packages in the "FreeBSD" repository. | 31 # but newer than the packages in the "FreeBSD" repository. |
| 20 # Some sort of a fast-track repository. | 32 # Some sort of a fast-track repository. |
| 21 # | 33 # |
| 101 ${installed_data} | 113 ${installed_data} |
| 102 EOF223 | 114 EOF223 |
| 103 return 2 | 115 return 2 |
| 104 } | 116 } |
| 105 | 117 |
| 118 get_mapping() { | |
| 119 local _package _n _mapped | |
| 120 | |
| 121 _package=$1 | |
| 122 | |
| 123 if [ -r "${PACKAGE_MAPPING}" ] ; then | |
| 124 while read _n _mapped ; do | |
| 125 if [ "${_n}" = "${_package}" ] ; then | |
| 126 mapped_package_name="${_mapped}" | |
| 127 return 0 | |
| 128 fi | |
| 129 done < ${PACKAGE_MAPPING} | |
| 130 fi | |
| 131 mapped_package_name="" | |
| 132 return 1 | |
| 133 } | |
| 134 | |
| 106 print_title() { | 135 print_title() { |
| 107 local _package _repo | 136 local _package _repo |
| 108 | 137 |
| 109 _package=$1 | 138 _package=$1 |
| 110 _repo=$2 | 139 _repo=$2 |
| 168 while read lfqp llabel ldescr ; do | 197 while read lfqp llabel ldescr ; do |
| 169 _installed_name=${lfqp%-*} | 198 _installed_name=${lfqp%-*} |
| 170 _installed_version=${lfqp##*-} | 199 _installed_version=${lfqp##*-} |
| 171 title_printed="" | 200 title_printed="" |
| 172 get_repo_for_installed_package ${_installed_name} | 201 get_repo_for_installed_package ${_installed_name} |
| 202 get_mapping ${_installed_name} | |
| 173 if [ -n "${verbose_flag}" ] ; then | 203 if [ -n "${verbose_flag}" ] ; then |
| 174 print_title "${lfqp}" "${repository}" | 204 print_title "${lfqp}" "${repository}" |
| 175 fi | 205 fi |
| 176 if ! assert_local_version ${_installed_name} ${_installed_version} ; then | 206 if ! assert_local_version ${_installed_name} ${_installed_version} ; then |
| 177 echo "Assertion failed: $lfqp ${_installed_name} ${_installed_version} ${llabel}" >&2 | 207 echo "Assertion failed: $lfqp ${_installed_name} ${_installed_version} ${llabel}" >&2 |
| 179 fi | 209 fi |
| 180 get_remote_repo_data ${LOCAL_REPO} ${_installed_name} | 210 get_remote_repo_data ${LOCAL_REPO} ${_installed_name} |
| 181 get_remote_repo_data ${LOCALBSDPORTS_REPO} ${_installed_name} | 211 get_remote_repo_data ${LOCALBSDPORTS_REPO} ${_installed_name} |
| 182 get_remote_repo_data ${FREEBSD_REPO} ${_installed_name} | 212 get_remote_repo_data ${FREEBSD_REPO} ${_installed_name} |
| 183 _print_detail="" | 213 _print_detail="" |
| 214 if [ -n "${mapped_package_name}" ] ; then | |
| 215 _print_detail=1 | |
| 216 fi | |
| 184 if [ \( -n "${alldata_flag}" \) ]; then | 217 if [ \( -n "${alldata_flag}" \) ]; then |
| 185 _print_detail=1 | 218 _print_detail=1 |
| 186 else | 219 else |
| 187 if [ -n "${short_flag}" ]; then | 220 if [ -n "${short_flag}" ]; then |
| 188 # | 221 # |
| 217 fi | 250 fi |
| 218 fi | 251 fi |
| 219 fi | 252 fi |
| 220 if [ -n "${_print_detail}" ]; then | 253 if [ -n "${_print_detail}" ]; then |
| 221 print_title "${lfqp}" "${repository}" | 254 print_title "${lfqp}" "${repository}" |
| 222 echo " INDEX: ${llabel} ${ldescr}" | 255 echo " INDEX : ${llabel} ${ldescr}" |
| 223 echo " FreeBSD: ${remote_label_FreeBSD} ${remote_descr_FreeBSD}" | 256 echo " FreeBSD : ${remote_label_FreeBSD} ${remote_descr_FreeBSD}" |
| 224 if [ \( -n "${alldata_flag_LocalBSDPorts}" \) -o \( "${remote_label_LocalBSDPorts}" != '?' \) ] ; then | 257 if [ \( -n "${alldata_flag_LocalBSDPorts}" \) -o \( "${remote_label_LocalBSDPorts}" != '?' \) ] ; then |
| 225 echo " LocalBSDPorts: ${remote_label_LocalBSDPorts} ${remote_descr_LocalBSDPorts}" | 258 echo " LocalBSDPorts: ${remote_label_LocalBSDPorts} ${remote_descr_LocalBSDPorts}" |
| 226 fi | 259 fi |
| 227 if [ \( -n "${alldata_flag_LocalRepo}" \) -o \( "${remote_label_LocalRepo}" != '?' \) ] ; then | 260 if [ \( -n "${alldata_flag_LocalRepo}" \) -o \( "${remote_label_LocalRepo}" != '?' \) ] ; then |
| 228 echo " LocalRepo: ${remote_label_LocalRepo} ${remote_descr_LocalRepo}" | 261 echo " LocalRepo : ${remote_label_LocalRepo} ${remote_descr_LocalRepo}" |
| 262 fi | |
| 263 if [ -n "${mapped_package_name}" ] ; then | |
| 264 echo " ---> ${mapped_package_name}" | |
| 265 get_remote_repo_data ${LOCAL_REPO} ${mapped_package_name} | |
| 266 get_remote_repo_data ${LOCALBSDPORTS_REPO} ${mapped_package_name} | |
| 267 get_remote_repo_data ${FREEBSD_REPO} ${mapped_package_name} | |
| 268 echo " LocalBSDPorts: ${remote_label_LocalBSDPorts} ${remote_descr_LocalBSDPorts}" | |
| 269 echo " LocalRepo : ${remote_label_LocalRepo} ${remote_descr_LocalRepo}" | |
| 229 fi | 270 fi |
| 230 fi | 271 fi |
| 231 done <<EOF856661111299999 | 272 done <<EOF856661111299999 |
| 232 ${local_index_versions} | 273 ${local_index_versions} |
| 233 EOF856661111299999 | 274 EOF856661111299999 |
