<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>5505</bug_id>
          
          <creation_ts>2004-11-15 02:33:28 +0300</creation_ts>
          <short_desc>alternatives-helper: interpreter errors on some unexpected input options</short_desc>
          <delta_ts>2005-09-04 22:04:04 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>alternatives</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>at</cc>
    
    <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>19795</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2004-11-15 02:33:28 +0300</bug_when>
    <thetext>alternatives-0.2.0-alt0.11

The script contains unquoted variable substitutions, which lead to errors on
unexpected options because the variables expand then to unsuitable values.

A workaround:

*** alternatives-helper	2004/11/14 23:12:31	1.1
--- alternatives-helper	2004/11/14 23:18:39	1.2
***************
*** 34,41 ****
  	    mode=2; shift; continue
  	fi
  
! 	[ $mode -eq 1 ] &amp;&amp; alternatives-install $1
! 	[ $mode -eq 2 ] &amp;&amp; alternatives-uninstall $1
  
  	shift
  done
--- 34,41 ----
  	    mode=2; shift; continue
  	fi
  
! 	[ &quot;${mode:-0}&quot; -eq 1 ] &amp;&amp; alternatives-install &quot;$1&quot;
! 	[ &quot;${mode:-0}&quot; -eq 2 ] &amp;&amp; alternatives-uninstall &quot;$1&quot;
  
  	shift
  done

Steps to Reproduce:
/usr/sbin/alternatives-helper -h

Actual Results:  
/usr/sbin/alternatives-helper: line 37: [: : integer expression expected
/usr/sbin/alternatives-helper: line 38: [: : integer expression expected


Expected Results:  
At least, no sh errors.
But would like to see a usage message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19796</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2004-11-15 02:39:34 +0300</bug_when>
    <thetext>No, actual actual results were:

# /usr/sbin/alternatives-helper -h
/usr/sbin/alternatives-helper: line 37: [: -eq: unary operator expected
/usr/sbin/alternatives-helper: line 38: [: -eq: unary operator expected

(What I pasted before were the results of the 1st work-around attempt.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19894</commentid>
    <comment_count>2</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2004-11-18 12:56:07 +0300</bug_when>
    <thetext>Спасибо за замечания, патч обязательно приложу. 
 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23096</commentid>
    <comment_count>3</comment_count>
    <who name="inger@altlinux.org">inger</who>
    <bug_when>2005-04-07 14:48:42 +0400</bug_when>
    <thetext>давно</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>