ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Alexey V. Vissarionov" <gremlin@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] %post considered harmful
Date: Tue, 5 May 2026 06:48:01 +0300
Message-ID: <20260505034801.GA29579@altlinux.org> (raw)
In-Reply-To: <87f0dfca56e69e9daf8179b0f2d3b242@altlinux.org>

Good ${greeting_time}!

On 2026-05-05 05:05:10 +0300, Aleksandr Shamaraev wrote:

 >>> после обновления они сбросятся, следовательно на вторую
 >>> транзакцию apt-get не будет знать где смотреть.
 >> %config(noreplace) ... ?
 > Попробую, спасибо.

Если интересно, я в подобных случаях пишу примерно так:

%post
test -f %_sysconfdir/%name.conf \
|| cp -af %_sysconfdir/%name-example.conf %_sysconfdir/%name.conf

%files
%config %verify(not md5 mtime size) %_sysconfdir/%name-example.conf
%config(noreplace) %ghost %_sysconfdir/%name.conf

(вместо MD5 уже давно используется SHA2-512, но ключевое слово
осталось).


-- 
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net


      reply	other threads:[~2026-05-05  3:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  2:05 Aleksandr Shamaraev
2026-05-05  3:48 ` Alexey V. Vissarionov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260505034801.GA29579@altlinux.org \
    --to=gremlin@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git