[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Signaling a file will be edited at post installation



Hello.

What is the best way to tell RPM that an installed file will be
edited by a post install script, therefore it will not verify
correctly because its contents and timestamps will have been
changed.

This situation arises in a relocatable package I am building, where
there is a script file (which can be relocated) which references another
file of the package that can be relocated. The installed script file
uses a special word (@PREFIX@) to indicate the relocation prefix when
refering to the other file and a post install script just substitutes
the @PREFIX@ word by the prefix used at installation time. This changes
some properties of the script file, making later RPM verification
failure.

Exerpt from an example SPEC file showing of the situation:

      # test.spec

      Prefix: %{_prefix}
      [...]

      %install
      [...]
      ed -s $RPM_BUILD_ROOT%{_bindir}/test.sh <<EOF
      ,s|%{_prefix}|@PREFIX@|g
      wq
      EOF
      
      %post
      ed -s $(echo %{_bindir}/test.sh | sed "s|^%{_prefix}|$RPM_INSTALL_PREFIX|g") <<EOF
      ,s|@PREFIX@|$RPM_INSTALL_PREFIX0|g
      wq
      EOF

      %files
      %{_bindir}/test.sh

After installing the package and verifying it one would get inconsistences:

      # rpm -Uvh --prefix /usr/local test-1-1.i386.rpm
      [...]

      # rpm -V test
      S.5....T   /usr/local/bin/test.sh

How can I handle this situation?

Romildo
-- 
Prof. José Romildo Malaquias               Departamento de Computação
http://iceb.ufop.br/~romildo       Universidade Federal de Ouro Preto
romildo@iceb.ufop.br                                           Brasil
romildo@uber.com.br





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []