* [devel] rpm upgrade, install or remove check?
@ 2006-03-02 9:40 Epiphanov Sergei
2006-03-02 10:30 ` Alexey I. Froloff
2006-03-02 12:03 ` Sergey V Turchin
0 siblings, 2 replies; 4+ messages in thread
From: Epiphanov Sergei @ 2006-03-02 9:40 UTC (permalink / raw)
To: Рассылка Devel
Подскажите, как можно отличить ситуации:
1) пакет ставится в систему в первый раз
2) пакет обновляется (удаляется старый и ставится одновременно новый)
3) пакет вообще удаляется из системы
?
Нужно для того, чтобы при первой установке динамически создать файл в
системе, между обновлениями его не трогать, а при удалении пакета его
удалить.
--
С уважением, Епифанов Сергей
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] rpm upgrade, install or remove check?
2006-03-02 9:40 [devel] rpm upgrade, install or remove check? Epiphanov Sergei
@ 2006-03-02 10:30 ` Alexey I. Froloff
2006-03-02 14:03 ` Epiphanov Sergei
2006-03-02 12:03 ` Sergey V Turchin
1 sibling, 1 reply; 4+ messages in thread
From: Alexey I. Froloff @ 2006-03-02 10:30 UTC (permalink / raw)
To: ALT Devel discussion list
[-- Attachment #1: Type: text/plain, Size: 843 bytes --]
* Epiphanov Sergei <serpiph@> [060302 13:12]:
> Подскажите, как можно отличить ситуации:
Параметры для post скриптов.
* @param arg1 no. instances of package installed after scriptlet exec
* (-1 is no arg)
* @param arg2 ditto, but for the target package
> 1) пакет ставится в систему в первый раз
[ $1 -eq 1 ] в %post и наверно [ $1 -eq 0 ] в %pre
> 2) пакет обновляется (удаляется старый и ставится одновременно новый)
[ $1 -eq 2 ] в %post и [ $1 -eq 1 ] в %postun и %pre
> 3) пакет вообще удаляется из системы
[ $1 -eq 0 ] в %postun
> Нужно для того, чтобы при первой установке динамически создать файл в
> системе, между обновлениями его не трогать, а при удалении пакета его
> удалить.
Удалять наверно лучше в %pre, особенно если файл создаётся в
каталоге, принадлежащем пакету.
--
Regards,
Sir Raorn.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] rpm upgrade, install or remove check?
2006-03-02 10:30 ` Alexey I. Froloff
@ 2006-03-02 14:03 ` Epiphanov Sergei
0 siblings, 0 replies; 4+ messages in thread
From: Epiphanov Sergei @ 2006-03-02 14:03 UTC (permalink / raw)
To: ALT Devel discussion list
В сообщении от Thursday 02 March 2006 13:30 Alexey I. Froloff написал(a):
> > Нужно для того, чтобы при первой установке динамически создать файл в
> > системе, между обновлениями его не трогать, а при удалении пакета его
> > удалить.
>
> Удалять наверно лучше в %pre, особенно если файл создаётся в
> каталоге, принадлежащем пакету.
Файл замещает имеющийся в системе (приходится так делать) и сохраняет
предыдущий. После удаления предыдущий файл должен вернуться обратно. При
обновлении файлы трогать не надо.
--
С уважением, Епифанов Сергей
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] rpm upgrade, install or remove check?
2006-03-02 9:40 [devel] rpm upgrade, install or remove check? Epiphanov Sergei
2006-03-02 10:30 ` Alexey I. Froloff
@ 2006-03-02 12:03 ` Sergey V Turchin
1 sibling, 0 replies; 4+ messages in thread
From: Sergey V Turchin @ 2006-03-02 12:03 UTC (permalink / raw)
To: ALT Devel discussion list
On Thursday 02 March 2006 12:40, Epiphanov Sergei wrote:
> Подскажите, как можно отличить ситуации:
>
> 1) пакет ставится в систему в первый раз
> 2) пакет обновляется (удаляется старый и ставится одновременно
> новый) 3) пакет вообще удаляется из системы
> ?
>
> Нужно для того, чтобы при первой установке динамически создать
> файл в системе, между обновлениями его не трогать, а при удалении
> пакета его удалить.
Можно сделать его %ghost. Если не создан, создать. Удалиться сам.
--
Regards, Sergey, ALT Linux Team, http://www.altlinux.ru
http://stinkfoot.org:11371/pks/lookup?op=get&search=0x1C2A3F08
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-02 14:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-02 9:40 [devel] rpm upgrade, install or remove check? Epiphanov Sergei
2006-03-02 10:30 ` Alexey I. Froloff
2006-03-02 14:03 ` Epiphanov Sergei
2006-03-02 12:03 ` Sergey V Turchin
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