[Trac-bugs] [PC-BSD Trac] #681: pc-metapkgmanager broken by echos in get_mirror() in /usr/local/share/pcbsd/scripts/functions.sh

PC-BSD trac at pcbsd.org
Sun Dec 2 21:36:13 PST 2012


#681: pc-metapkgmanager broken by echos in get_mirror() in
/usr/local/share/pcbsd/scripts/functions.sh
----------------------+---------------------------
 Reporter:  jdmulloy  |       Type:  System Defect
   Status:  new       |   Priority:  major
Milestone:            |  Component:  PBI System
  Version:  9.1-RC3   |   Keywords:
----------------------+---------------------------
 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
 }}}

-- 
Ticket URL: <http://trac.pcbsd.org/ticket/681>
PC-BSD <http://trac.pcbsd.org>
PC-BSD Project Management


More information about the Trac-bugs mailing list