Opened 6 months ago
Closed 6 months ago
#681 closed System Defect (fixed)
pc-metapkgmanager broken by echos in get_mirror() in /usr/local/share/pcbsd/scripts/functions.sh
| Reported by: | jdmulloy | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | PBI System | Version: | 9.1-RC3 |
| Keywords: | Cc: | trac-bugs@… |
Description
pc-metapkgmanager doesn't work because get_mirror() in /usr/local/share/pcbsd/scripts/functions.sh echo's extra messages like "Getting regional mirror..." and "Using mirror: $VAL" which ends up in $pkgAddMirror variable on line 75 in /usr/local/bin/pc-metapkgmanager. So instead of just the mirror URL $pkgAddMirror becomes the following.
Getting regional mirror... Using mirror: http://mirrors.isc.org/pub/pcbsd http://mirrors.isc.org/pub/pcbsd/9.1-RC3/amd64/netinstall/metapackages/warden/packages/
When it ought to just be "http://mirrors.isc.org/pub/pcbsd/9.1-RC3/amd64/netinstall/metapackages/warden/packages/". I was able to work around this by commenting out all echos in get_mirror(). These echos should be removed or redirected to STDERR. It is likely that /usr/local/bin/pc-updatemanager is also affected.
This occurred on a fresh install of TrueOS 9.1-RC3 AMD64
Error message:
# /usr/local/bin/pc-metapkgmanager --pkgset warden --chroot /usr/jails/10.1.1.105 add ownCloud Pending Meta-Package changes: 1 ERROR: The pkg location Getting regional mirror... Using mirror: http://mirrors.isc.org/pub/pcbsd http://mirrors.isc.org/pub/pcbsd/9.1-RC3/amd64/netinstall/metapackages/warden/packages/ does not exist! #
/usr/local/bin/pc-metapkgmanager:
72 add_metapkgs() {
73 if [ -z "$1" ] ; then exit_err "No meta-pkg specified!" ; fi
74 local pkgAddMirror="$2"
75 if [ -z "$pkgAddMirror" ] ; then pkgAddMirror=`use_default_mirror` ; fi
76 if [ ! -e "${MPDIR}/${1}/pkg-list" ] ; then exit_err "No such meta-pkg: $1" ; fi
77 _apkg=$1
78
79 MIRRORURL=`parse_url "$pkgAddMirror"`
80
81 # Figure out the type of location we are installing from
82 echo $MIRRORURL | grep -e '^http://' -e '^ftp://' >/dev/null 2>/dev/null
83 if [ "$?" = "0" ] ; then
84 loc="NET"
85 else
86 if [ ! -d "${MIRRORURL}" ] ; then exit_err "The pkg location $MIRRORURL does not exist!" ; fi
87 loc="PATH"
88 fi
Change History (1)
comment:1 Changed 6 months ago by kris
- Resolution set to fixed
- Status changed from new to closed

This is already fixed for 9.1, and will be included in the next update.
Thanks for the heads up!