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

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

    <bug>
          <bug_id>22596</bug_id>
          
          <creation_ts>2009-12-22 09:22:45 +0300</creation_ts>
          <short_desc>Неверный путь к noarch-каталогу</short_desc>
          <delta_ts>2010-01-29 15:26:02 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>python-base</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>18211</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="real@altlinux.org">real.altlinux.org</reporter>
          <assigned_to name="Vladimir D. Seleznev">vseleznv</assigned_to>
          <cc>evg</cc>
    
    <cc>mike</cc>
    
    <cc>vseleznv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>104659</commentid>
    <comment_count>0</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2009-12-22 09:22:45 +0300</bug_when>
    <thetext>В некоторых ситуациях питон возвращает неверный путь до noarch-каталога. В качестве примера пострадавшего:

http://sisyphus.ru/ru/srpm/Sisyphus/python-module-Pyrex/spec

В качестве решения использован костыль:
if [ -d %archdir ]; then
mv %buildroot%archdir/Pyrex/Compiler/Lexicon.pickle \
%buildroot%python_sitelibdir/Pyrex/Compiler/
fi

Но хотелось бы видеть вылеченной причину, а не её следствие.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104662</commentid>
    <comment_count>1</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2009-12-22 10:53:41 +0300</bug_when>
    <thetext>от rider@:

$ python
Python 2.6.4 (r264:75706, Dec 21 2009, 02:00:41)
[GCC 4.4.2 20091027 (ALT Linux 4.4.2-alt1)] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import distutils
&gt;&gt;&gt; from distutils.sysconfig import get_python_lib
&gt;&gt;&gt; get_python_lib();
&apos;/usr/lib/python2.6/site-packages&apos;

get_python_lib() в Pyrex используется в setup.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104665</commentid>
    <comment_count>2</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2009-12-22 10:58:48 +0300</bug_when>
    <thetext>Если приведённый rider@ код запустить на x86_64, результат будет:
&apos;/usr/lib64/python2.6/site-packages&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105474</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2010-01-13 04:31:55 +0300</bug_when>
    <thetext>(In reply to comment #0)
&gt; В некоторых ситуациях питон возвращает неверный путь до noarch-каталога.

Может быть, это путь до arch-каталога?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105476</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2010-01-13 04:47:40 +0300</bug_when>
    <thetext>(In reply to comment #1)
&gt; от rider@:
&gt; 
&gt; $ python
&gt; Python 2.6.4 (r264:75706, Dec 21 2009, 02:00:41)
&gt; [GCC 4.4.2 20091027 (ALT Linux 4.4.2-alt1)] on linux2
&gt; Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt; &gt;&gt;&gt; import distutils
&gt; &gt;&gt;&gt; from distutils.sysconfig import get_python_lib
&gt; &gt;&gt;&gt; get_python_lib();
&gt; &apos;/usr/lib/python2.6/site-packages&apos;
&gt; 
&gt; get_python_lib() в Pyrex используется в setup.py
(In reply to comment #2)
&gt; Если приведённый rider@ код запустить на x86_64, результат будет:
&gt; &apos;/usr/lib64/python2.6/site-packages&apos;

В реализации get_python_lib() почему-то игнорируется документированный параметр plat_specific.  Исправление, видимо, тривиальное.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105477</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2010-01-13 04:49:40 +0300</bug_when>
    <thetext>(In reply to comment #4)
&gt; В реализации get_python_lib() почему-то игнорируется документированный параметр
&gt; plat_specific.  Исправление, видимо, тривиальное.

С другой стороны, неизвестно, сколько пакетов сломается, если get_python_lib() починить.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105478</commentid>
    <comment_count>6</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-13 06:06:20 +0300</bug_when>
    <thetext>Не знаю, как Вам, Дмитрий, а мне ситуация видится так:

лучше всё же починить (сам я это, наверно, быстро сделать не смогу, а у кого можно попросить? Вас? at@?), а что сломается, я готов починить сам (благо, недавно этот пусть уже проходил, но в значительно бОльших масштабах).

В конце концов, бранч 5.1 создан недавно, так что следующее отбранчевание, где окажется новый питон, будет ещё очень нескоро, за это время можно всё это перечинить по нескольку раз.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105597</commentid>
    <comment_count>7</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-15 08:48:44 +0300</bug_when>
    <thetext>Поправил так:

From: Eugeny A. Rostovtsev (REAL) real at altlinux.org &lt;real@altlinux.org&gt;
Date: Thu, 14 Jan 2010 21:48:07 +0000 (+0700)
Subject: Fix get_python_lib
X-Git-Tag: 2.6.4-alt3~1
X-Git-Url: http://git.altlinux.org/people/real/packages/python.git?p=python.git;a=commitdiff_plain;h=22265349065b8a586a525c5cc69e4d7dd352ddc9

Fix get_python_lib
---

diff --git a/Python/Lib/distutils/sysconfig.py b/Python/Lib/distutils/sysconfig.py
index 44ae992..05daa02 100644
--- a/Python/Lib/distutils/sysconfig.py
+++ b/Python/Lib/distutils/sysconfig.py
@@ -15,6 +15,7 @@ import os
 import re
 import string
 import sys
+import platform
 
 from distutils.errors import DistutilsPlatformError
 
@@ -115,8 +116,18 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
         prefix = plat_specific and EXEC_PREFIX or PREFIX
 
     if os.name == &quot;posix&quot;:
-        libpython = os.path.join(prefix,
-                                 &quot;lib&quot;, &quot;python&quot; + get_python_version())
+        if plat_specific == 0:
+          libpython = os.path.join(prefix,
+            &quot;lib&quot;, &quot;python&quot; + get_python_version())
+        elif plat_specific == 1 and platform.architecture()[0] == &quot;32bit&quot;:
+          libpython = os.path.join(prefix,
+            &quot;lib&quot;, &quot;python&quot; + get_python_version())
+        elif plat_specific == 1 and platform.architecture()[0] != &quot;32bit&quot;:
+          libpython = os.path.join(prefix,
+            &quot;lib64&quot;, &quot;python&quot; + get_python_version())
+        else:
+          libpython = os.path.join(prefix,
+            &quot;lib&quot;, &quot;python&quot; + get_python_version())
         if standard_lib:
             return libpython
         else:
diff --git a/python-2.6-alt-lib64.patch b/python-2.6-alt-lib64.patch
index b4110b0..08da7c5 100644
--- a/python-2.6-alt-lib64.patch
+++ b/python-2.6-alt-lib64.patch
@@ -17,17 +17,6 @@
          &apos;headers&apos;: &apos;$base/include/python/$dist_name&apos;,
          &apos;scripts&apos;: &apos;$base/bin&apos;,
          &apos;data&apos;   : &apos;$base&apos;,
---- a/Python/Lib/distutils/sysconfig.py
-+++ b/Python/Lib/distutils/sysconfig.py
-@@ -100,7 +100,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
- 
-     if os.name == &quot;posix&quot;:
-         libpython = os.path.join(prefix,
--                                 &quot;lib&quot;, &quot;python&quot; + get_python_version())
-+                                 &quot;lib64&quot;, &quot;python&quot; + get_python_version())
-         if standard_lib:
-             return libpython
-         else:
 --- a/Python/Lib/site.py
 +++ b/Python/Lib/site.py
 @@ -265,9 +265,13 @@ def addsitepackages(known_paths):



см. http://git.altlinux.org/people/real/packages/python.git?p=python.git;a=commitdiff;h=22265349065b8a586a525c5cc69e4d7dd352ddc9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105606</commentid>
    <comment_count>8</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2010-01-15 12:50:31 +0300</bug_when>
    <thetext>(В ответ на комментарий №7)
&gt; Поправил так:
Тогда это не WORKSFORME</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105609</commentid>
    <comment_count>9</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-15 13:24:34 +0300</bug_when>
    <thetext>Просто это ни на чём ещё не отразилось, собрал парочку arch и многострадальный python-module-Pirex.

Но может вылезти при очередной тестовой пересборке сизифа на каком-то другом пакете, и в нём нужно будет использовать функцию так, как она сама же и описана.

Но раз FIXED, спорить не буду ;)
Пострадавшие переоткроют.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105610</commentid>
    <comment_count>10</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2010-01-15 13:33:23 +0300</bug_when>
    <thetext>Статус относится к состоянию баги, а не Сизифа.
WORKSFORME - это значит, вы решили ничего не делать, вас и так всё устроило :)
Пересборка покажет? :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105611</commentid>
    <comment_count>11</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-15 13:45:18 +0300</bug_when>
    <thetext>&quot;Пересборка покажет? :)&quot;

Обязательно. Некоторые пакеты, будучи arch, валили свои файлы в %_libexecdir, и в спеках приходилось делать хак: перенос в %_libdir.

Такие пакеты придётся чинить.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105641</commentid>
    <comment_count>12</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2010-01-16 01:55:09 +0300</bug_when>
    <thetext>(In reply to comment #11)
&gt; &quot;Пересборка покажет? :)&quot;
&gt; 
&gt; Обязательно. Некоторые пакеты, будучи arch, валили свои файлы в %_libexecdir, и
&gt; в спеках приходилось делать хак: перенос в %_libdir.
&gt; 
&gt; Такие пакеты придётся чинить.

Видимо, не один десяток пакетов придётся чинить.  Вот, например, свежепострадавший fetchmailconf:
http://git.altlinux.org/tasks/18725/build/1/x86_64/log

Просьба анонсировать факт починки одного, разлома другого и методы исправления последствий последнего.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105645</commentid>
    <comment_count>13</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-16 10:21:36 +0300</bug_when>
    <thetext>&quot;Видимо, не один десяток пакетов придётся чинить.  Вот, например,
свежепострадавший fetchmailconf:
http://git.altlinux.org/tasks/18725/build/1/x86_64/log&quot;

Я предлагаю такое решение. Здесь идёт речь о пакете, часть подпакетов которых на самом деле noarch. Питону это просто так не объяснишь, он если в самом начале не встречает BuildArch: noarch, то дальше уже поздно. Сделал новый макрос: %_python_set_noarch
Его нужно использовать перед любым другим питоньим макросом.

С fetchmailconf получилось совсем просто:
http://git.altlinux.org/people/real/packages/fetchmail.git?p=fetchmail.git;a=commitdiff;h=e3422fb6834f6a340671afe04c628036fac4b095

Предлагаю принять такой вариант. Проверил, собирается.

&quot;Просьба анонсировать факт починки одного, разлома другого и методы исправления
последствий последнего.&quot;

Тут разломы могут быть разными, это бы лучше на вики сразу. Но в devel@ пару строк черкну.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105672</commentid>
    <comment_count>14</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-17 06:05:31 +0300</bug_when>
    <thetext>#18725 FAILED #2 sisyphus/mike fetchmail.git=6.3.13-alt4

Миш, у тебя нет ключевого фикса, о котором я говорил: в спеке после BuildPreReq: rpm-build-python отсутствует макрос %_python_set_noarch


Потому и FAILED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105693</commentid>
    <comment_count>15</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2010-01-17 20:27:07 +0300</bug_when>
    <thetext>(In reply to comment #13)
&gt; С fetchmailconf получилось совсем просто:
&gt; http://git.altlinux.org/people/real/packages/fetchmail.git?p=fetchmail.git;a=commitdiff;h=e3422fb6834f6a340671afe04c628036fac4b095
&gt; Предлагаю принять такой вариант. Проверил, собирается.
Спасибо, смержил и отправил.

&gt; &quot;Просьба анонсировать факт починки одного, разлома другого и методы исправления
&gt; последствий последнего.&quot;
&gt; Тут разломы могут быть разными, это бы лучше на вики сразу. Но в devel@ пару
&gt; строк черкну.
Анонсировать стоит и если не вся картинка сразу выяснилась.

(In reply to comment #14)
&gt; #18725 FAILED #2 sisyphus/mike fetchmail.git=6.3.13-alt4
&gt; Миш, у тебя нет ключевого фикса, о котором я говорил: в спеке после
&gt; BuildPreReq: rpm-build-python отсутствует макрос %_python_set_noarch
&gt; Потому и FAILED.
Дело в том, что этот alt4 моложе твоего alt4, на полсуток раньше сделан. :)  Отправил alt5.

PS: посмотри у меня в girar-utils утилитку girar-download, вдруг пригодится:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105697</commentid>
    <comment_count>16</comment_count>
    <who name="real@altlinux.org">real.altlinux.org</who>
    <bug_when>2010-01-17 21:42:35 +0300</bug_when>
    <thetext>&quot;Анонсировать стоит и если не вся картинка сразу выяснилась.

А такой анонс уже был: что сборка части пакетов сломается. Фраза слишком общая, согласен, но я не ясновидящий, чтобы видеть всё наперёд. У меня собралось, а то, что кое-что может и не собраться, здесь же, выше по обсуждению говорилось.

Согласен, после исправления get_python_lib нужно было сразу в devel@ написать. Но сейчас все и так уже в курсе:
http://lists.altlinux.org/pipermail/devel/2010-January/179244.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>