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

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

    <bug>
          <bug_id>27915</bug_id>
          
          <creation_ts>2012-11-02 15:39:43 +0400</creation_ts>
          <short_desc>Табуляция в начале строки в ini_config_set</short_desc>
          <delta_ts>2012-11-14 17:37:25 +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>libshell</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>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrey Cherepanov">cas</reporter>
          <assigned_to name="Alexey Gladkov">legion</assigned_to>
          <cc>glebfm</cc>
    
    <cc>legion</cc>
    
    <cc>mike</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>134393</commentid>
    <comment_count>0</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2012-11-02 15:39:43 +0400</bug_when>
    <thetext>$ . /bin/shell-ini-config
$ echo &quot;[global]&quot; &gt; t
$ ini_config_set t global &apos;param&apos; &quot;val&quot;
$ cat t
[global]
$ echo &quot;exist_param = yes&quot; &gt;&gt; t
$ ini_config_set t global &apos;param&apos; &quot;val&quot;
$ cat t
[global]
exist_param = yes
 param = val

Проблемы:
1. Если нет ни одного параметра в секции, то ничего не добавляется.
2. Добавляемая строка имеет пробел в начале строки.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134394</commentid>
    <comment_count>1</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2012-11-02 15:41:02 +0400</bug_when>
    <thetext>При изменения значения существующего параметра пробел не добавляется.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134396</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Gladkov">legion</who>
    <bug_when>2012-11-02 15:59:53 +0400</bug_when>
    <thetext>У меня не воспроизводится. Я сделал:

. ./shell-ini-config
echo &quot;[global]&quot; &gt; ./test.ini
ini_config_set ./test.ini global &apos;param&apos; &quot;val&quot;
cat ./test.ini

Получил:

&lt;=== test.ini ===
[global]

&lt;---&gt;param = val
================&gt;

Если сделать &quot;echo -n ...&quot;, то будет:

&lt;=== test.ini ===
[global]
&lt;---&gt;param = val
================&gt;

Там не пробел, а табуляция. У меня в примере она отмечена как &apos;&lt;---&gt;&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134397</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2012-11-02 17:32:45 +0400</bug_when>
    <thetext>По-моему, это был максимум FR на стилевой вопрос -- сделать ручку для выбора, ставить или нет leading \t (добавление которого перед новыми записями для libshell-0.1.7-alt1 подтверждаю).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134398</commentid>
    <comment_count>4</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2012-11-02 17:33:28 +0400</bug_when>
    <thetext>Алексей, а это можно переназначить переменной в 
http://git.altlinux.org/gears/l/libshell.git?p=libshell.git;a=blob;f=libshell/shell-ini-config;h=ea11aecdfdc71377f46f0b769013699f9b5a78ff;hb=sisyphus#l81

Чтобы табуляция не была прибита явно для тех файлов, где отступов обычно нет (например, smb.conf, *.desktop)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134400</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Gladkov">legion</who>
    <bug_when>2012-11-02 18:18:04 +0400</bug_when>
    <thetext>Аааа... Понял. Я согласен. Я сделаю как с комментариями.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134518</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Gladkov">legion</who>
    <bug_when>2012-11-06 00:00:31 +0400</bug_when>
    <thetext>Прошу проверить 0.1.7-alt1-1-g71fd341</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134836</commentid>
    <comment_count>7</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2012-11-14 13:22:35 +0400</bug_when>
    <thetext>(В ответ на комментарий №6)
&gt; Прошу проверить 0.1.7-alt1-1-g71fd341
Прекрасно работает при 
export shell_ini_config_prefix=&apos;&apos;

Ещё и сразу переформатирует файл в зависимости от установленного отступа. Думаю, можно отправлять.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>134853</commentid>
    <comment_count>8</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2012-11-14 17:37:25 +0400</bug_when>
    <thetext>libshell-0.1.8-alt1 -&gt; sisyphus:

* Wed Nov 14 2012 Alexey Gladkov &lt;legion@altlinux&gt; 0.1.8-alt1
- shell-ini-config changes:
  + Fix empty lines at EOF (ALT#27974).
  + Indentation in the ini-file can be configured by
    shell_ini_config_prefix (ALT#27915).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>