From: Aleksey Avdeev <solo@solin.spb.ru> To: ALT Linux Team development discussions <devel@lists.altlinux.org> Subject: [devel] Q: Нужен триггер срабатывающий на замещение конкретных версий пакета. Date: Thu, 12 May 2011 13:24:01 +0400 Message-ID: <4DCBA731.4080709@solin.spb.ru> (raw) [-- Attachment #1: Type: text/plain, Size: 3260 bytes --] Приветствую. Как правильно сделать триггер, срабатывающий на обновление с конкретных версий пакета? Подробно: В целях закрытия <https://bugzilla.altlinux.org/show_bug.cgi?id=24960>, по аналогии с <http://www.altlinux.org/SpecTips/triggers#.D0.9F.D1.80.D0.B8.D0.BC.D0.B5.D1.80.D1.8B> я нарисовал следующий триггер (не знаю как отключить автоперенос строк в Thunderbird): %triggerun base -- %name-base < 2.2.16 if [ $2 -gt 0 ]; then pushd %apache2_confdir for conffile in `egrep -Rsm1 '^[[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]+(%apache2_basedir/|)%apache2_confdir_name/extra-available/Directory_(root|html|cgibin)_default\.conf' *-available/*.conf|cut -sd: -f1` do echo "Warning: configuration files %apache2_confdir$conffile" echo " uses %apache2_extra_available/Directory_(root|html|cgibin)_default.conf," echo " moved to the %apache2_confdir_inc!" echo " The original file is saved as %apache2_confdir$conffile.rpmold" cp -fa --backup=t "$conffile" "$conffile.rpmold" sed -ri 's@^([[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]+(%apache2_basedir/|)%apache2_confdir_name)/extra-available/(Directory_(root|html|cgibin)_default\.conf([[:space:]].*|)$)@\1/include/\3@' "$conffile" done for conffile in `cd %apache2_extra_available/ && \ find -maxdepth 1 -regextype posix-egrep -regex '\./Directory_(root|html|cgibin)_default.conf$' -printf '%f\n'` do diff -q "%apache2_extra_available/$conffile" "%apache2_confdir_inc/$conffile" >/dev/null` || { echo "Warning: config files %apache2_extra_available/$conffile" echo " and %apache2_confdir_inc/$conffile are different!" echo " %apache2_confdir_inc/$conffile file is saved as" echo " %apache2_confdir_inc/$conffile.rpmnew and replaced by" echo " %apache2_extra_available/$conffile." cp -fa --backup=t "%apache2_confdir_inc/$conffile" "%apache2_confdir_inc/$conffile.rpmnew" cp -fa "%apache2_extra_available/$conffile" "%apache2_confdir_inc/$conffile" } echo "Warning: config file %apache2_extra_available/$conffile" echo " saved as %apache2_extra_available/$conffile.rpmold!" cp -fa --backup=t "%apache2_extra_available/$conffile" "%apache2_extra_available/$conffile.rpmold" rm -f "%apache2_extra_available/$conffile" done popd fi exit 0 Суть: 1. Заменить пути к перемещённым файлам (дабы httpd2 мог стартовать). 2. Заменить новые файлы старыми, если их содержимое отличается (дабы не потерять ручные правки). Вопросы следующие: 1. Стоит ли вообще связываться с %triggerun? Судя по прядку применения скриптов (см. <http://www.altlinux.org/SpecTips/triggers#.D0.9F.D0.BE.D1.80.D1.8F.D0.B4.D0.BE.D0.BA_.D0.B2.D1.8B.D0.BF.D0.BE.D0.BB.D0.BD.D0.B5.D0.BD.D0.B8.D1.8F_.D1.81.D0.BA.D1.80.D0.B8.D0.BF.D1.82.D0.BE.D0.B2>) мне может подойти и %post. Но я не знаю как в нём указать на обновление каких версий пакетов он должен отрабатывать. 2. Помимо отработки на замещение apache2-base < 2.2.16 мне желательно выполнять данный скрипт и при замещении apache2 < 2.2.9-alt10. Можно ли это сделать без копипаста и не вынося тело скрипта в макрос? -- С уважением. Алексей. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 900 bytes --]
next reply other threads:[~2011-05-12 9:24 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-12 9:24 Aleksey Avdeev [this message] 2011-05-27 22:39 ` Aleksey Avdeev
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=4DCBA731.4080709@solin.spb.ru \ --to=solo@solin.spb.ru \ --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