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
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?
(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..
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,
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)
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.
New patch works great thanks.
Fixed in eix svn trunk (>=eix-0.12.5)
Since eix-0.13.0 is now in the tree, I mark the bug as "fixed".