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

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

    <bug>
          <bug_id>48551</bug_id>
          
          <creation_ts>2023-11-22 18:46:34 +0300</creation_ts>
          <short_desc>Команда вида &quot;apt-repo add &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos;&quot; ломает файл репозиториев</short_desc>
          <delta_ts>2026-09-06 13:13:58 +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>apt-repo</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolay Strelkov">n.strelkov</reporter>
          <assigned_to name="Andrey Cherepanov">cas</assigned_to>
          <cc>cas</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>237660</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolay Strelkov">n.strelkov</who>
    <bug_when>2023-11-22 18:46:34 +0300</bug_when>
    <thetext>Шаги для повторения:
1. Запустить чистый Docker-конейнер командой
   docker run -it --rm alt:sisyphus
2. Обновить все пакеты в контейенере и установить пакет apt-repo
   apt-get update &amp;&amp; apt-get dist-upgrade -y &amp;&amp; apt-get install -y apt-repo
3. Вывести список репозиториев, добавить репозиторий исходного кода, посмотреть новый список репозиториев, обновить списки пакетов с помощью команд:
   apt-repo -v
   apt-repo
   apt-repo add &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos;
   apt-repo
   apt-get update

Ожидаемый результат: 
* строка &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos; добавлена в файл /etc/apt/sources.list без изменений, списки пакетов обновлены без ошибок.

Реальный результат:
* строка &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos; добавлена в файл /etc/apt/sources.list в сломанном виде (а именно с пробелом не в том месте - &apos;rpm-src [alt] http://ftp.altlinux.org/pub distributions/ALTLinux/Sisyphus/x86_64 classic&apos;), команда `apt-get update` завершается ошибкой. См. полный лог по п.3 ниже:

```
[root@04154fa94cd9 /]# apt-repo -v
1.4.1
[root@04154fa94cd9 /]# apt-repo
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64-i586 classic
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/noarch classic
[root@04154fa94cd9 /]# apt-repo add &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos;
[root@04154fa94cd9 /]# apt-repo
rpm-src [alt] http://ftp.altlinux.org/pub distributions/ALTLinux/Sisyphus/x86_64 classic
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64-i586 classic
rpm [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/noarch classic
[root@04154fa94cd9 /]# apt-get update
Get:1 http://ftp.altlinux.org distributions/ALTLinux/Sisyphus/x86_64 release [4238B]
Get:2 http://ftp.altlinux.org Sisyphus/x86_64 release [4238B]
Get:3 http://ftp.altlinux.org Sisyphus/x86_64-i586 release [1680B]
Get:4 http://ftp.altlinux.org Sisyphus/noarch release [2859B]
Err http://ftp.altlinux.org Sisyphus/x86_64 release
  no signatures in file /var/lib/apt/lists/partial/ftp.altlinux.org_pub_distributions_ALTLinux_Sisyphus_x86%5f64_base_release
Fetched 8778B in 0s (140kB/s)
W: Release files for some repositories could not be retrieved or authenticated. Such repositories are being ignored.
E: Failed to fetch http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/x86_64/base/release  no signatures in file /var/lib/apt/lists/partial/ftp.altlinux.org_pub_distributions_ALTLinux_Sisyphus_x86%5f64_base_release
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
E: Tried to dequeue a fetching object
[root@04154fa94cd9 /]# 
```

Строка &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/noarch classic&apos; тоже ломается.

Аналогичное происходит и в p10.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>296117</commentid>
    <comment_count>1</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2026-09-06 13:13:58 +0300</bug_when>
    <thetext>Проверка актуальности на apt-repo 1.5.3-alt1 (запуск скрипта в --dry-run):

$ apt-repo --dry-run add &apos;rpm-src [alt] http://ftp.altlinux.org/pub/distributions/ALTLinux Sisyphus/x86_64 classic&apos;
/etc/apt/sources.list:+rpm-src [alt] http://ftp.altlinux.org/pub distributions/ALTLinux/Sisyphus/x86_64 classic

То же для noarch. Причина в new_format(): для строки, переданной в формате sources.list, она безусловно переносит два последних компонента URL в поле архитектуры, хотя строка уже в новом формате (компонент «Sisyphus/x86_64» уже отделён). Баг актуален.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>