rpm5 triggers

Jan Rękorajski baggins at pld-linux.org
Wed Nov 28 19:51:54 CET 2012


On Wed, 28 Nov 2012, Jeffrey Johnson wrote:

> 
> On Nov 28, 2012, at 12:53 PM, Jan Rękorajski <baggins at pld-linux.org> wrote:
> 
> > On Wed, 28 Nov 2012, Jeffrey Johnson wrote:
> > 
> >> 
> >> On Nov 28, 2012, at 12:16 PM, Jan Rękorajski <baggins at pld-linux.org> wrote:
> >> 
> >>> 
> >>> Nothing in those patches touch execution of triggers, so it must be
> >>> something in rpm5 itself that changed.
> >> 
> >> The diagnostic reasoning is faulty because it doesn't lead anywhere.
> >> 
> >> I have yet to hear what the test is/was.
> > 
> > Test is simple:
> > 
> > test.spec contains:
> > 
> > %triggerin -- lighttpd
> > set -x
> > echo "#: $#"
> > echo "1: $1"
> > echo "2: $2"
> > 
> > Now if lighttpd is already installed then when installing test package
> > $1 and $2 should be 1, but $1 is 0 in rpm5 (contrary to documentation).
> > Same if test is already installed and installing lighttpd package, this
> > time $2 is 0 in rpm5.
> > 
> > Looks like those args are calculated incorrectly.
> 
> The test is _NOT_ simple because triggers fire depending
> on what is installed and present in an rpmdb.
> 
> There are also failure modes when the retrieval, not
> the calculation, are incorrect.
> 
> Again the starting point is -vv output, and then verifying
> the retrievals are actually correct by adding "debug" to the
> Triggername index:
> 	%_dbi_config_3_Triggername %{_dbi_btconfig} %{?_bt_dupsort}
> 
> Premature guessing isn't going to solve any RPM problems. And I
> have no idea what your rpmdb contains.
> 

Ok, so here come attachments (gzipped due to list limits):
- test.spec with triggers
- lighttpd-install, -vvv output of installing target package (lighttpd)
  when source package (test) is already installed
- lighttpd-uninstall, -vvv output of removing target package (lighttpd)
  when source package (test) is already installed
- test-install, -vvv output of installing source package (test) when
  target package (lighttpd) is already installed
- test-uninstall, -vvv output of removing source package (test) when
  target package (lighttpd) is already installed

Numbers passed as arguments to triggers in test.spec are incorrect
according to docs.

-- 
Jan Rękorajski                                 | PLD/Linux
SysAdm                                         | http://www.pld-linux.org/
baggins<at>mimuw.edu.pl
baggins<at>pld-linux.org
-------------- next part --------------
Summary:	webapp test
Name:		test
Version:	0.1
Release:	0.1
License:	GPL
Group:		Applications/System
BuildRequires:	rpmbuild(macros) >= 1.268
Requires:	webapps
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define		_webapps	/etc/webapps
%define		_webapp		%{name}
%define		_sysconfdir	%{_webapps}/%{_webapp}

%description
zz

%prep
%setup -qcT
touch lighttpd.conf

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}
cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf

%triggerin -- lighttpd
set -x
echo "#: $#"
echo "1: $1"
echo "2: $2"
echo triggerin:%{name}-%{version}-%{release}

%triggerun -- lighttpd
set -x
echo "#: $#"
echo "1: $1"
echo "2: $2"
echo triggerun:%{name}-%{version}-%{release}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%dir %attr(750,root,http) %{_sysconfdir}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-install.gz
Type: application/x-gzip
Size: 2277 bytes
Desc: not available
URL: </mailman/pipermail/pld-devel-en/attachments/20121128/eafaddde/attachment.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-uninstall.gz
Type: application/x-gzip
Size: 1900 bytes
Desc: not available
URL: </mailman/pipermail/pld-devel-en/attachments/20121128/eafaddde/attachment-0001.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lighttpd-install.gz
Type: application/x-gzip
Size: 6553 bytes
Desc: not available
URL: </mailman/pipermail/pld-devel-en/attachments/20121128/eafaddde/attachment-0002.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lighttpd-uninstall.gz
Type: application/x-gzip
Size: 3770 bytes
Desc: not available
URL: </mailman/pipermail/pld-devel-en/attachments/20121128/eafaddde/attachment-0003.gz>


More information about the pld-devel-en mailing list