Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 115031

Summary: etc-update: line 243: less": command not found
Product: Gentoo/Alt Reporter: gentoo
Component: Mac OSXAssignee: Gentoo for Mac OS X <ppc-macos>
Status: RESOLVED WONTFIX    
Severity: normal CC: aaron123456789
Priority: High    
Version: unspecified   
Hardware: PPC   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---

Description gentoo 2005-12-09 15:16:40 UTC
I installed

Reproducible: Always
Steps to Reproduce:
1. Install Tiger 10.4.3 on a PowerBook G4
2. Apply all Apple updates until 20051205
3. Install gentoo-macos-20041118.dmg
4. emerge --sync (I manually rsynced portage tree 20051205 to /usr/portage)
5. run sh /usr/portage/scripts/bootstrap-macos.sh
6. emerge portage to avoid bug 79788
7. do NOT YET emerge system
8. run etc-update
Actual Results:  
neo:/usr/portage root# etc-update 
/usr/sbin/etc-update: line 377: declare: 0": syntax error in expression (error
token is """)
Scanning Configuration files...
Automerging trivial changes in: etc-update.conf
The following is the list of files which need updating, each 
configuration file is followed by a list of possible replacement files.
1) /etc/dispatch-conf.conf
/etc/._cfg0000_dispatch-conf.conf
2) /etc/make.conf.example
/etc/._cfg0000_make.conf.example
Please select a file to edit by entering the corresponding number.
              (don't use -3 or -5 if you're unsure what to do)
              (-1 to exit) (-3 to auto merge all remaining files)
                           (-5 to auto-merge AND not use 'mv -i'): 1

/usr/sbin/etc-update: line 243: less": command not found
/usr/sbin/etc-update: line 404: 11174 Broken pipe             ${showdiffcmd}
1) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
Please select from the menu above (-1 to ignore this update): 1
Replacing /etc/dispatch-conf.conf with /etc/._cfg0000_dispatch-conf.conf
mv: illegal option -- "
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

The following is the list of files which need updating, each
[...and so on...]

Expected Results:  
neo:/usr/portage root# etc-update 
Scanning Configuration files...
Automerging trivial changes in: make.conf.example
The following is the list of files which need updating, each 
configuration file is followed by a list of possible replacement files.
1) /etc/dispatch-conf.conf
/etc/._cfg0000_dispatch-conf.conf
Please select a file to edit by entering the corresponding number.
              (don't use -3 or -5 if you're unsure what to do)
              (-1 to exit) (-3 to auto merge all remaining files)
                           (-5 to auto-merge AND not use 'mv -i'): 1

1) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
Please select from the menu above (-1 to ignore this update): 1
Replacing /etc/dispatch-conf.conf with /etc/._cfg0000_dispatch-conf.conf
overwrite /etc/dispatch-conf.conf? (y/n [n]) y

Exiting: Nothing left to do; exiting. :)


The function get_config in etc-update uses sed to read settings such as the
pager from etc-update.conf. The version of sed in Tiger 10.4.3 with all recent
Apple patches applied interprets the statement
    sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p"
wrong: it replaces
    pager="less"
with
    less"
instead of
    less

I played around with it a bit and found that this works fine:
    sed -ne "s/^ *$item *= *[\"]\{0,1\}\([^\"]*\)[\"]\{0,1\}/\1/p"

The first emerge system pulled in sed-4.1.4 which works fine with the
original sed statement.

Output from emerge info:
!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.0.51.22-r3 (default-darwin/macos/10.4, gcc-4.0.0, unavailable, 8.3.0
Power Macintosh)
=================================================================
System uname: 8.3.0 Power Macintosh powerpc
macos-20041118
distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632)
[disabled]
dev-lang/python:     [Not Present]
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  [Not Present]
ACCEPT_KEYWORDS="ppc-macos"
AUTOCLEAN="yes"
CBUILD="powerpc-apple-darwin"
CFLAGS="-O2 -pipe"
CHOST="powerpc-apple-darwin"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE.UTF-8"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc emboss opengl ppc-macos userland_Darwin kernel_Darwin elibc_Darwin"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Fabian Groffen gentoo-dev 2005-12-09 15:20:21 UTC
It's crap, but the only solution I found was to remove all quotes from
/etc/etc-update.conf, only then it works.
Comment 2 Fabian Groffen gentoo-dev 2008-02-29 20:59:45 UTC
Gentoo for Mac OS X is dead, and this is one of the reasons why that's pretty much a good thing.