ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Michael Shigorin <mike@osdn.org.ua>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] Получение списка файлов из post/preun-скрипта (macro hack works)
Date: Sat, 16 Sep 2006 10:13:30 +0300
Message-ID: <20060916071330.GW25214@osdn.org.ua> (raw)
In-Reply-To: <450B23B3.5000709@altlinux.org>


[-- Attachment #1.1: Type: text/plain, Size: 1119 bytes --]

On Sat, Sep 16, 2006 at 02:05:39AM +0400, Alexey Rusakov wrote:
> > Может, получится хакнуть это дело методом %define в install и
> > раскрытия полученного в %post, но если и, то это слабочитаемо
> > (хотя... если выйдет всунуть в левые два макроса и пинать их,
> > то какая разница).
> Уже думал. Не получится, потому что нужный мне список можно
> получить только в %install, то есть записать результат нужно
> именно в этот момент. Сделать такую вещь при помощи макросов
> RPM - насколько я понимаю, невозможно, потому что макросы RPM
> раскрываются при препроцессинге спека.

Лёш, а давай поставим эксперимент?

Собери и поставь аттач, завтра удали и поставь опять.

$ rpm -qp --scripts /home/mike/RPM/RPMS/noarch/test-0-alt0.noarch.rpm
postinstall scriptlet (through /bin/sh):
echo    "Built on: 20060916"
echo -n "Current:  "; date +%Y%m%d

QED -- сперва там достаточно тупой препроцессор
(в том плане, что и комментарии не воспринимает;
сейчас это хорошо тем, что секции не изолированы).

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/

[-- Attachment #1.2: test.spec --]
[-- Type: text/plain, Size: 414 bytes --]

Name: test
Version: 0
Release: alt0

Summary: test
License: GPL
Group: Games/Educational

Packager: Michael Shigorin <mike@altlinux.org>
BuildArch: noarch

%description
macro test

%install
mkdir %buildroot
%define bdate %(date +%%Y%%m%%d)

%post
echo    "Built on: %bdate"
echo -n "Current:  "; date +%%Y%%m%%d

%files

%changelog
* Sat Sep 16 2006 Michael Shigorin <mike@altlinux.org> 0-alt0
- initial re-lease


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-09-16  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-10 21:31 [devel] Получение списка файлов из post/preun-скрипта Alexey Rusakov
2006-09-11  7:32 ` Led
2006-09-11 20:42   ` Alexey Rusakov
2006-09-12  6:33     ` Led
2006-09-14  6:22       ` Alexey Rusakov
2006-09-14 20:23         ` Michael Shigorin
2006-09-14 22:08           ` Alexey Rusakov
2006-09-15  6:41             ` Michael Shigorin
2006-09-15 22:05               ` Alexey Rusakov
2006-09-16  7:13                 ` Michael Shigorin [this message]
2006-09-16 14:54                 ` Sergey Vlasov
2006-09-11  7:43 ` Alexey Tourbin
2006-09-11 20:47   ` Alexey Rusakov

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=20060916071330.GW25214@osdn.org.ua \
    --to=mike@osdn.org.ua \
    --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