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

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

    <bug>
          <bug_id>50275</bug_id>
          
          <creation_ts>2024-05-03 18:09:18 +0300</creation_ts>
          <short_desc>puppet-агент каждый прогон пытается обновить пакет</short_desc>
          <delta_ts>2024-06-01 06:38:55 +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>puppet</component>
          <version>unstable</version>
          <rep_platform>x86_64</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>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Вадим М.">matveevskiy.vadim</reporter>
          <assigned_to name="majioa@altlinux.org">majioa</assigned_to>
          <cc>admsasha</cc>
    
    <cc>cas</cc>
    
    <cc>majioa</cc>
    
    <cc>mike</cc>
    
    <cc>nbr</cc>
    
    <cc>pav</cc>
    
    <cc>rider</cc>
    
    <cc>thatman</cc>
    
    <cc>zurabishvilinn</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>245817</commentid>
    <comment_count>0</comment_count>
    <who name="Вадим М.">matveevskiy.vadim</who>
    <bug_when>2024-05-03 18:09:18 +0300</bug_when>
    <thetext>У нас есть простенький ресурс в puppet, для установки/обновления пакета ca-certificates:

  package{&apos;ca-certificates&apos;:
    ensure =&gt; latest
  }

Но при каждом запуске puppet-агента он выводит уведомление, что пытается обновить этот пакет, хотя указанная версия уже установлена:

Debug: Executing &apos;/bin/rpm -qa --nosignature --nodigest --qf &apos;%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n&apos; | sort&apos;
Debug: Executing: &apos;/usr/bin/apt-cache showpkg ca-certificates&apos;
Debug: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ca-certificates &quot;2022.09.15-alt1&quot; is installed, latest is &quot;2022.09.15-alt1:p10+308004.100.2.1@1665748370&quot;
Debug: Executing: &apos;/usr/bin/apt-get -q -y install ca-certificates&apos;
Debug: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ca-certificates &quot;2022.09.15-alt1&quot; is installed, latest is &quot;2022.09.15-alt1:p10+308004.100.2.1@1665748370&quot;
Notice: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ensure changed &apos;2022.09.15-alt1&apos; to &apos;2022.09.15-alt1:p10+308004.100.2.1@1665748370&apos; (corrective)

[root@d01toolsalt01t ~]# rpm -qa --nosignature --nodigest --qf &apos;%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION}:%{DISTTAG} %{RELEASE} %{ARCH}\n&apos; | grep ca-certificates
ca-certificates 0 2022.09.15:p10+308004.100.2.1 alt1 noarch
[root@d01toolsalt01t ~]# rpm -q puppet
puppet-7.20.0-alt1.noarch
[root@d01toolsalt01t ~]# lsb_release -a
LSB Version:	n/a
Distributor ID:	ALT
Description:	ALT Server 10.1 (Mendelevium)
Release:	10.1
Codename:	Mendelevium


Судя по всему проблема в том, что установленная версия пакета проверяется командой rpm, которая не учитывает %{DISTTAG}.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>246189</commentid>
    <comment_count>1</comment_count>
    <who name="Nikolai Zurabishvili">zurabishvilinn</who>
    <bug_when>2024-05-14 15:21:24 +0300</bug_when>
    <thetext>puppet-8.4.0-alt1.1

Стенды (обновлены до сизифа):

KWorkstation 10.3 x86-64
Workstation 10.2 x86-64
Education 10.2 KDE x86-64
Education 10.2 x86-64
Server 10.2 office x86-64

Шаги:
1. # puppet apply --verbose --debug --execute &quot;package {&apos;neofetch&apos;: ensure =&gt; latest }&quot;


Фактический результат: puppet сравнивает версию без %{DISTTAG} и поэтому считает что новая версия доступна для установки

Debug: Prefetching aptrpm resources for package
Debug: Executing: &apos;/usr/bin/rpm --version&apos;
Debug: Executing &apos;/usr/bin/rpm -qa --nosignature --nodigest --qf &apos;%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n&apos; | sort&apos;
Debug: Executing: &apos;/usr/bin/apt-cache showpkg neofetch&apos;
Debug: /Stage[main]/Main/Package[neofetch]/ensure: neofetch &quot;7.1.0-alt5&quot; is installed, latest is &quot;7.1.0-alt5:sisyphus+342895.100.1.1@1710578036&quot;
Debug: Executing: &apos;/usr/bin/apt-get -q -y install neofetch&apos;
Notice: /Stage[main]/Main/Package[neofetch]/ensure: ensure changed &apos;7.1.0-alt5&apos; to &apos;7.1.0-alt5:sisyphus+342895.100.1.1@1710578036&apos;


Ожидаемый результат: puppet сравнит версию с использованием %{DISTTAG} и не будет пытаться установить новую версию которой еще нет</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>247082</commentid>
    <comment_count>2</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2024-06-01 06:38:55 +0300</bug_when>
    <thetext>gem-puppet-7.20.0-alt2.p10.0 -&gt; p10:

 Wed May 22 2024 Pavel Skrylev &lt;majioa@altlinux&gt; 7.20.0-alt2.p10.0
 - ! proper ALT package version detection without long suffix (closes #50275)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>