Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 220397 - eix 0.12.4 eix-sync broken on gfbsd
Summary: eix 0.12.4 eix-sync broken on gfbsd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-05 16:19 UTC by Dan Coats
Modified: 2008-06-25 19:40 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for update-eix-functions.sh (app-portage/eix-0.12.4) (update-eix-functions.sh.diff,1.13 KB, patch)
2008-05-07 16:17 UTC, Jesus Rivero (RETIRED)
Details | Diff
New patch (update-eix-functions.sh.diff,627 bytes, patch)
2008-05-07 17:09 UTC, Martin Väth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Coats 2008-05-05 16:19:25 UTC
eix-sync fails with # eix-sync
eval: 1: Syntax error: Unterminated quoted string
on freebsd.

Reproducible: Always

Steps to Reproduce:
1.emerge =app-portage/eix-0.12.4
2.
3.

Actual Results:  
 # eix-sync
eval: 1: Syntax error: Unterminated quoted string


Expected Results:  
sync and update

other eix functions seem normal
# emerge --info
Portage 2.1.5_rc6 (default-bsd/fbsd/6.2/x86, gcc-4.2.3, freebsd-lib-6.2-r3, 6.2-RELEASE i386)
=================================================================
System uname: 6.2-RELEASE i386 i386
Timestamp of tree: Wed, 30 Apr 2008 14:00:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r4, 2.5.2-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.3
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.17-r2
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  6.2-r3
ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd"
CBUILD="i686-gentoo-freebsd6.2"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i686-gentoo-freebsd6.2"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks parallel-fetch sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo http://open-systems.ufl.edu/mirrors/gentoo http://mirror.phy.olemiss.edu/mirror/gentoo"
LDFLAGS=""
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac accessibility acl adns apache2 bash-completion bcmath berkdb bidi bindinst browserplugin bzip2 cairo calendar cli cracklib crypt cups curlwrappers dbus dedicated dga dlloader dri dts emacs emacs-w3 erandom ethereal expat fastcgi font ftp gd gdbm geoip glitz glut gnusetup gnutls gtk gtkhtml hal iconv imap immqt-bc inifile innodb java java5 javascript jp2 jpeg jpeg2k libcaca libclamv live lzo midi mime ming mmap motif mpi ncurses nls nsplugin nvidia oav objc oracle oscar oss pam pcre pdf perl php pic posix ppds python qt3support readline reflection samba session shared spl sqlite sse ssl symlink tcltktcpd tcpd test threads unicode urandom usb usepackagedmakefiles userlocales vcd vhosts x86-fbsd xcomposite xml xorg xpm xprint zeroconf zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="FreeBSD" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="BSD" VIDEO_CARDS="nv vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Martin Väth 2008-05-06 13:43:03 UTC
Somehow the BSD shell behaves in a non-POSIX way (it seems to be different
from ash and all other shells which are available in linux portage, since with
these there is on problem). Is there a way to test this shell without
installing a full BSD system?

Or maybe you can help: I conjecture that lines 54-58 in
/usr/bin/update-eix-functions.sh cause the trouble.
You can verify this by inserting "false &&" at the beginning of line 54 -
then eix-sync should be working. Is this correct?

The purpose of these lines is to find out whether the shell understands the
mathematical expression syntax $(( ... )) and - if yes - to define a function
appropriately. The test is already in a subshell (and hidden in an eval),
so I really cannot understand why this test can stop the whole bsd shell from
continuing. How to program this test so that it works on bsd *and* on POSIX
shells?
Comment 2 Jesus Rivero (RETIRED) gentoo-dev 2008-05-07 15:58:52 UTC
(In reply to comment #1)
Hello, 

    The eval on lines 54 - 58 is being executed correctly. The issue comes from the eval on function Replace() (on line 62). Maybe something expands inside the eval string that makes a quote out of place? 

I'll keep testing..
Comment 3 Jesus Rivero (RETIRED) gentoo-dev 2008-05-07 16:12:39 UTC
I found a solution that may work with all shells. 
Just replacing the quotes (\") around ${2} and it worked for me. I'll attach a patch for it. 

Can anybody assess this gives the same results?

Best regards, 
Comment 4 Jesus Rivero (RETIRED) gentoo-dev 2008-05-07 16:17:52 UTC
Created attachment 152307 [details, diff]
Patch for update-eix-functions.sh (app-portage/eix-0.12.4)

Patch to solve quotes issue in update-eix-functions.sh (for eix-sync) (Gentoo/FreeBSD)
Comment 5 Martin Väth 2008-05-07 17:09:49 UTC
Created attachment 152311 [details, diff]
New patch

Thanks for investigating. Unfortunately, omitting the inner quotes is no
proper solution, because Replace() is used in AddUpdateQuoting() for "quoting"
problematic chars like * or ? in overlay paths - this does not work as
expected when the quotes around ${2} are omitted.
Moreover, $(( ... )) must not be used since it confuses some shells (for
this reason, expr() is defined optionally).
I guess, by all shell standards the _exterior_ quotes can be omitted - I hope
this avoids the confusion with the nested quotes which is probably the reason
for the different behavior of dash/ash/bash/... and bsd shell.
Please test the new patch.
Comment 6 Dan Coats 2008-05-07 17:48:21 UTC
New patch works great thanks.
Comment 7 Martin Väth 2008-05-07 21:44:32 UTC
Fixed in eix svn trunk (>=eix-0.12.5)
Comment 8 Martin Väth 2008-06-25 19:40:54 UTC
Since eix-0.13.0 is now in the tree, I mark the bug as "fixed".