<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>162018</bug_id>
          
          <creation_ts>2007-01-14 11:07 0000</creation_ts>
          <short_desc>app-text/acroread-7.0.9 fails to install</short_desc>
          <delta_ts>2007-01-16 10:54:34 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://lists.gnu.org/archive/html/bug-bash/2007-01/msg00035.html</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>163527</dependson>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>nelchael@gentoo.org</reporter>
          <assigned_to>kevquinn@gentoo.org</assigned_to>
          <cc>askwar@digitalprojects.com</cc>
    
    <cc>printing@gentoo.org</cc>
    
    <cc>r02662733@yahoo.com</cc>
    
    <cc>samuel.robyr@gmail.com</cc>
    
    <cc>syntaxerrormmm@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>nelchael@gentoo.org</who>
            <bug_when>2007-01-14 11:07:07 0000</bug_when>
            <thetext>&gt;&gt;&gt; Unpacking source...
&gt;&gt;&gt; Unpacking AdobeReader_enu-7.0.9-1.i386.tar.gz to /var/tmp/portage/app-text/acroread-7.0.9/work
mv: cannot stat `/var/tmp/portage/app-text/acroread-7.0.9/work/AdobeReader/bin/acroread.&apos;: No such file or directory

!!! ERROR: app-text/acroread-7.0.9 failed.
Call stack:
  ebuild.sh, line 1611:   Called dyn_unpack
  ebuild.sh, line 751:   Called qa_call &apos;src_unpack&apos;
  environment, line 2961:   Called src_unpack
  acroread-7.0.9.ebuild, line 126:   Called die

!!! Failed to put acroread. back to acroread; please report


nelchael ~ # ll /var/tmp/portage/app-text/acroread-7.0.9/work/AdobeReader/
total 111M
6.6M -rw-r--r-- 1 root root 6.6M Jan  5 20:57 COMMON.TAR
104M -rw-r--r-- 1 root root 104M Jan  5 20:57 ILINXR.TAR
 36K -rwxr-xr-x 1 root root  34K Jan  5 20:56 INSTALL
 32K -rw-r--r-- 1 root root  29K Feb 23  2005 LICREAD.TXT
 80K -rw-r--r-- 1 root root  78K May  5  2006 ReadMe.htm
nelchael ~ #</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Patrick.Fourniols@wanadoo.fr</who>
            <bug_when>2007-01-14 11:51:34 0000</bug_when>
            <thetext>in french AdobeReader_fra-7.0.9-1.i386.tar.gz unpack to AdobeReader and no more in AdobeReader_fra so reming off two lines solve th pb, like this:

#               if [[ ${pkg} =~ &quot;^AdobeReader_&quot; ]]; then
                        cd ${S}
                        tar xf ILINXR.TAR ||
                                die &quot;Failed to unpack ILINXR.TAR; is distfile co
rrupt?&quot;
                        tar xf COMMON.TAR ||
                                die &quot;Failed to unpack COMMON.TAR; is distfile co
rrupt?&quot;
                        epatch ${FILESDIR}/acroread-scim.patch
                        epatch ${FILESDIR}/acroread-low-startup-fontissue.patch
                        epatch ${FILESDIR}/acroread-expr.patch
                        ll=$(acroread_get_ll ${pkg})
                        mv bin/acroread bin/acroread.${ll}
                        if [[ -z ${fl} ]]; then
                                fl=${ll}
                                linguas=&quot;${ll}&quot;
                        else
                                linguas=&quot;${linguas} ${ll}&quot;
                        fi
#               fi</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>yahoo@l61.de</who>
            <bug_when>2007-01-14 13:49:46 0000</bug_when>
            <thetext>This problem occurs if you are using bash version &gt;=3.2. The syntax of the [[ .. =~ .. ]] construct has changed:

# pre 3.2
# if [[ ${pkg} =~ &quot;^AdobeReader_&quot; ]]; then

# new syntax
if [[ ${pkg} =~ ^AdobeReader_ ]]; then

Maybe we need a test here like
[ ${BASH_VERSINFO[0]} == 3 ] &amp;&amp; [ ${BASH_VERSINFO[1]} -gt 1 ] &amp;&amp; ...
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-14 16:39:05 0000</bug_when>
            <thetext>(In reply to comment #2)

&gt; Maybe we need a test here like
&gt; [ ${BASH_VERSINFO[0]} == 3 ] &amp;&amp; [ ${BASH_VERSINFO[1]} -gt 1 ] &amp;&amp; ...

Hm, wouldn&apos;t it be better to replace this with a standard compliant syntax? Like:

[ AdobeReader_${pkg#AdobeReader_} ] &amp;&amp; echo String in pkg \&quot;$pkg\&quot; begins with AdobeReader_

IMO it&apos;s bad style to rely on non-standard compliant code, if there are easy alternatives available.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-14 17:35:56 0000</bug_when>
            <thetext>(In reply to comment #3)

&gt; [ AdobeReader_${pkg#AdobeReader_} ] &amp;&amp; echo String in pkg \&quot;$pkg\&quot; begins with
&gt; AdobeReader_

Darn. Copy&apos;n&apos;paste error :(

Make that:

[ &quot;AdobeReader_${pkg#AdobeReader_}&quot; = &quot;${pkg}&quot; ]</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 18:17:07 0000</bug_when>
            <thetext>The code in the ebuild is currently:

       if [[ &quot;${pkg}&quot; =~ &quot;^AdobeReader_&quot; ]]; then

I put the quotes around the lhs thinking this would satisfy bash 3.2.  Does it not?  Looks like a bug in bash if this fails.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 18:21:45 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; This problem occurs if you are using bash version &gt;=3.2. The syntax of the [[
&gt; .. =~ .. ]] construct has changed:
&gt; 
&gt; # pre 3.2
&gt; # if [[ ${pkg} =~ &quot;^AdobeReader_&quot; ]]; then
&gt; 
&gt; # new syntax
&gt; if [[ ${pkg} =~ ^AdobeReader_ ]]; then

FI this syntax works with bash pre-3.2 as well.  However I don&apos;t like having literal strings unquoted.  Could you try the following on bash 3.2, and report the results back?

[[ ${pkg} =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
[[ &quot;${pkg}&quot; =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
[[ ${pkg} =~ &apos;^AdobeReader_&apos; ]] &amp;&amp; echo ok

All report &quot;ok&quot; for bash 3.1.  Thanks.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 18:24:18 0000</bug_when>
            <thetext>er, and of course do:

pkg=&quot;AdobeReader_blah&quot;

first...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-14 18:27:01 0000</bug_when>
            <thetext>(In reply to comment #6)

&gt; [[ ${pkg} =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
&gt; [[ &quot;${pkg}&quot; =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
&gt; [[ ${pkg} =~ &apos;^AdobeReader_&apos; ]] &amp;&amp; echo ok

askwar@hetzner ~ $ pkg=&quot;AdobeReader_blah&quot;
askwar@hetzner ~ $ [[ ${pkg} =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
askwar@hetzner ~ $ [[ &quot;${pkg}&quot; =~ &quot;^AdobeReader_&quot; ]] &amp;&amp; echo ok
askwar@hetzner ~ $ [[ ${pkg} =~ &apos;^AdobeReader_&apos; ]] &amp;&amp; echo ok
askwar@hetzner ~ $ bash --version
GNU bash, version 3.2.9(1)-release (i686-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

None report ok for 3.2.9.

However, the standard compliant syntax I posted works just fine. Why not simply use that? Why rely on some non-standard, bash-only feature?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 18:40:56 0000</bug_when>
            <thetext>(In reply to comment #8)

&gt; None report ok for 3.2.9.

Thanks.

&gt; However, the standard compliant syntax I posted works just fine. Why not simply
&gt; use that? Why rely on some non-standard, bash-only feature?

All ebuilds are bash scripts, not sh.  &apos;[[&apos; is bash-only, for a start.  It seems odd to me that &apos;[[ ${pkg} =~ &quot;^AdobeReader_&quot; ]]&apos; fails - and I need convincing it&apos;s not a bug in gcc-3.2.

What does bash-3.2 do if other match operators are used - for example:

pkg=&quot;AdobeReader&quot;
[[ ${pkg} == &quot;AdobeReader&quot; ]] &amp;&amp; echo ok

etc?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 19:29:02 0000</bug_when>
            <thetext>actually - don&apos;t bother - I&apos;ve built 3.2_p9 locally so I can test myself.

I&apos;ve emailed the bash mailing list, see what the maintainers say.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-01-14 21:00:19 0000</bug_when>
            <thetext>*** Bug 162075 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>syntaxerrormmm@gmail.com</who>
            <bug_when>2007-01-14 21:05:58 0000</bug_when>
            <thetext>The problem exists also with acroread-7.0.8-r1.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-14 21:20:14 0000</bug_when>
            <thetext>oh; and in the meantime I&apos;m committing the no-quotes version for now, as it works on both bash-3.1 and 3.2 (with a comment about the inconsistent behaviour to prevent someone &apos;fixing&apos; it again).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-15 08:27:03 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; 
&gt; &gt; None report ok for 3.2.9.
&gt; 
&gt; Thanks.
&gt; 
&gt; &gt; However, the standard compliant syntax I posted works just fine. Why not simply
&gt; &gt; use that? Why rely on some non-standard, bash-only feature?
&gt; 
&gt; All ebuilds are bash scripts, not sh.

Yep, bad.

&gt;  &apos;[[&apos; is bash-only, for a start.

Yep. As you might have noticed, I did not use [[, as it&apos;s a bash&apos;ism and not standards compliant.

Anyway, good luck with your non-standard code. Guess you&apos;ll run into problems soon, when they change behaviour again.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-15 11:16:57 0000</bug_when>
            <thetext>(In reply to comment #14)
&gt; &gt; All ebuilds are bash scripts, not sh.
&gt; 
&gt; Yep, bad.

Nope, good; it makes our code tidier and easier to read and maintain.  Bash is standard on all Gentoo systems, so there&apos;s no need to restrict ourselves unnecessarily to sh syntax.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-16 08:00:32 0000</bug_when>
            <thetext>(In reply to comment #15)
&gt; (In reply to comment #14)
&gt; &gt; &gt; All ebuilds are bash scripts, not sh.
&gt; &gt; 
&gt; &gt; Yep, bad.
&gt; 
&gt; Nope, good; it makes our code tidier and easier to read and maintain.

As we just saw, right? ;)

&gt;  Bash is
&gt; standard on all Gentoo systems, so there&apos;s no need to restrict ourselves
&gt; unnecessarily to sh syntax.

Other than that POSIX compliant code will always work. Why use non-standard compliant code, when there&apos;s no reason to do so? Like it was in the case of this bug (which would not have existed, if standard compliant code would have been used)? Or like it is with the unnceccessary use of [[ instead of [ (yes, I know about the advantages of [[ over [, but the code in question doesn&apos;t make use of this).

BTW: I wouldn&apos;t say that [[ &quot;${pkg}&quot; =~ &quot;^AdobeReader_&quot; ]] really is easier to read, compared to eg. [ &quot;AdobeReader_${pkg#AdobeReader_}&quot; = &quot;${pkg}&quot; ]. I&apos;m also not saying that [ &quot;AdobeReader_${pkg#AdobeReader_}&quot; = &quot;${pkg}&quot; ] is easier to read, though.

Oh well, you&apos;ll run into another problem like this soon again, I suppose. But that&apos;s not an issue, as bash is &quot;standard&quot; (as in: MS Word is standard) and there&apos;s no need to use standard-compliant code, right?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-16 08:10:04 0000</bug_when>
            <thetext>(In reply to comment #16)
&gt; (In reply to comment #15)
&gt; &gt; (In reply to comment #14)
&gt; &gt; &gt; &gt; All ebuilds are bash scripts, not sh.
&gt; &gt; &gt; 
&gt; &gt; &gt; Yep, bad.
&gt; &gt; 
&gt; &gt; Nope, good; it makes our code tidier and easier to read and maintain.
&gt; 
&gt; As we just saw, right? ;)

Compare and contrast:

  if [[ ${pkg} =~ ^AdobeReader_ ]]; then

  if [ &quot;AdobeReader_${pkg#AdobeReader_}&quot; = &quot;${pkg}&quot; ]; then

I know which I find easiest to read.

&gt; 
&gt; &gt;  Bash is
&gt; &gt; standard on all Gentoo systems, so there&apos;s no need to restrict ourselves
&gt; &gt; unnecessarily to sh syntax.
&gt; 
&gt; Other than that POSIX compliant code will always work. Why use non-standard
&gt; compliant code, when there&apos;s no reason to do so?

Because the bash code has several advantages.  If we follow your argument to the logical conclusion, we&apos;d remove bash completely, along with all the other GNU extensions in sed (no &apos;-i&apos;, which we use everywhere), diff (no &apos;-u&apos;) etc - and that&apos;s patently silly.  Gentoo is a GNU system, not a pure POSIX system (if such a thing exists).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-16 08:33:37 0000</bug_when>
            <thetext>(In reply to comment #17)
&gt; (In reply to comment #16)
&gt; &gt; (In reply to comment #15)
&gt; &gt; &gt; (In reply to comment #14)
&gt; &gt; &gt; &gt; &gt; All ebuilds are bash scripts, not sh.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Yep, bad.
&gt; &gt; &gt; 
&gt; &gt; &gt; Nope, good; it makes our code tidier and easier to read and maintain.
&gt; &gt; 
&gt; &gt; As we just saw, right? ;)
&gt; 
&gt; Compare and contrast:
&gt; 
&gt;   if [[ ${pkg} =~ ^AdobeReader_ ]]; then
&gt; 
&gt;   if [ &quot;AdobeReader_${pkg#AdobeReader_}&quot; = &quot;${pkg}&quot; ]; then
&gt; 
&gt; I know which I find easiest to read.

Yep, the 2nd one, correct? ;)

&gt; &gt; Other than that POSIX compliant code will always work. Why use non-standard
&gt; &gt; compliant code, when there&apos;s no reason to do so?
&gt; 
&gt; Because the bash code has several advantages.

Not in the way it&apos;s used HERE. Another example:

[[ -z ${fl} ]]

Why use [[ here and not [? Why use GNUisms, even if they don&apos;t provide an advantage?

&gt;  If we follow your argument to
&gt; the logical conclusion, we&apos;d remove bash completely, 

You&apos;d remove bash completely, because you&apos;d use bash only where it&apos;s necessary?

Hm.

&gt;   Gentoo is a GNU system, not a pure POSIX system (if
&gt; such a thing exists).

And why would it be bad to use GNUisms only where necessary? Why is it bad to try to use standard compliant code whereever possible and refrain to use GNUisms?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-16 09:59:43 0000</bug_when>
            <thetext>(In reply to comment #18)
&gt; Not in the way it&apos;s used HERE. Another example:
&gt; 
&gt; [[ -z ${fl} ]]
&gt; 
&gt; Why use [[ here and not [? Why use GNUisms, even if they don&apos;t provide an
&gt; advantage?

&apos;[[&apos; is internal bash syntax, whereas &apos;[&apos; is a separate executable.  Thus using &apos;[&apos; costs a new process, &apos;[[&apos; doesn&apos;t.  Do some timing comparisons, you&apos;ll see the difference - it&apos;s significant when it accumulates; especially when used in global scope.

&gt; &gt;  If we follow your argument to
&gt; &gt; the logical conclusion, we&apos;d remove bash completely, 
&gt; 
&gt; You&apos;d remove bash completely, because you&apos;d use bash only where it&apos;s necessary?

Well, none of the bash syntax is strictly necessary - you can always find a way of writing stuff using only POSIX code, it&apos;s just that it can be messy.

&gt; &gt;   Gentoo is a GNU system, not a pure POSIX system (if
&gt; &gt; such a thing exists).
&gt; 
&gt; And why would it be bad to use GNUisms only where necessary? Why is it bad to
&gt; try to use standard compliant code whereever possible and refrain to use
&gt; GNUisms?

I would argue that a restriction to POSIX code should be just for code that is expected to be used on non-GNU systems.

Anyway, this is not a discussion forum, so I won&apos;t discuss it further here.  Take it up on one of the mailing lists if you really think we should stop using &apos;[[&apos; in ebuilds.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>askwar@digitalprojects.com</who>
            <bug_when>2007-01-16 10:13:33 0000</bug_when>
            <thetext>(In reply to comment #19)
&gt; (In reply to comment #18)
&gt; &gt; Not in the way it&apos;s used HERE. Another example:
&gt; &gt; 
&gt; &gt; [[ -z ${fl} ]]
&gt; &gt; 
&gt; &gt; Why use [[ here and not [? Why use GNUisms, even if they don&apos;t provide an
&gt; &gt; advantage?
&gt; 
&gt; &apos;[[&apos; is internal bash syntax, whereas &apos;[&apos; is a separate executable.  Thus using
&gt; &apos;[&apos; costs a new process, &apos;[[&apos; doesn&apos;t.  

You&apos;re wrong. At least in bash, [ is also a builtin.

askwar@winds06 ~ $ type [
[ is a shell builtin
askwar@winds06 ~ $ echo $BASH_VERSION
3.00.16(1)-release

Granted, that&apos;s not a Gentoo bash - but for sure, you haven&apos;t patched out [ out of the Gentoo bash, have you?

&gt; Do some timing comparisons, you&apos;ll see
&gt; the difference - it&apos;s significant when it accumulates; especially when used in
&gt; global scope.

Well, in that case - use standard compliant code and use a faster shell (eg. dash). If you&apos;re after speed, then you should stop using bash. It&apos;s simply too slow. The &quot;problem&quot; with dash is, that it &quot;only&quot; supports POSIX; but that&apos;s good enough.

Also, in how far is speed relevant regarding THIS bug?

&gt; Well, none of the bash syntax is strictly necessary - you can always find a way
&gt; of writing stuff using only POSIX code, it&apos;s just that it can be messy.

Yes, you&apos;re right. POSIX code can be messier. But that&apos;s also true wrt. bash code.

&gt; I would argue that a restriction to POSIX code should be just for code that is
&gt; expected to be used on non-GNU systems.

Fine. I&apos;d argue, that non-POSIX code should not be used, if there are easy alternatives available. As is with [[ compared to [ (as long as the advantages aren&apos;t used); as is now with the code that broke because of bash 3.2, which caused this bug.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kevquinn@gentoo.org</who>
            <bug_when>2007-01-16 10:54:34 0000</bug_when>
            <thetext>(In reply to comment #20)
&gt; You&apos;re wrong. At least in bash, [ is also a builtin.

You&apos;re right.  However &apos;[&apos; is still 50% more expensive than &apos;[[&apos;, on timing tests I have run.

re. bash 3.2 (which is still ~, btw) - I&apos;m waiting to hear what upstream say about the change in behaviour from 3.1 to 3.2.
</thetext>
          </long_desc>
      
    </bug>

</bugzilla>