Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1479818 Details for
Bug 1200302
dnf reinstall breaks alternatives
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Spec of testpkg which handles upgrades/reinstall with alternatives.
testpkg.spec (text/plain), 3.25 KB, created by
Severin Gehwolf
on 2018-08-30 13:51:58 UTC
(
hide
)
Description:
Spec of testpkg which handles upgrades/reinstall with alternatives.
Filename:
MIME Type:
Creator:
Severin Gehwolf
Created:
2018-08-30 13:51:58 UTC
Size:
3.25 KB
patch
obsolete
>%global uniqueprefix %{name}-%{version}-%{release}.%{_arch} >%global bindir %{_datadir}/%{uniqueprefix}/bin >%global major 1 ># priority must be 7 digits in total ># setting to 1, so debug ones can have 0 >%global priority 000000%{major} >%global rpm_state_dir %{_localstatedir}/lib/rpm-state/%{name} > >Name: testpkg >Version: %{major}.0 >Release: 4%{?dist} >Summary: Test package for re-install > >License: GPL >URL: https://fedoraproject.org > >%description >A test package > >%prep ># nothing > >%build >cat > %{name}-script <<END >#!/bin/bash >echo %{name}-script from %{uniqueprefix} >exit 0 >END > >%install >mkdir -p %{buildroot}%{bindir} >install -m 755 %{name}-script %{buildroot}%{bindir}/%{name}-script > >%post >echo post: %{uniqueprefix} - $1 >alternatives \ > --install %{_bindir}/%{name}-script %{name}-script %{bindir}/%{name}-script %{priority} --family %{name}.%{_arch} ># Leave some trace for posttrans. posttrans will handle upgrade/reinstall ># cases with traces from post and postun. Note: $1 will be > 1 for ># upgrade/reinstall/parallel install. ># We don't need traces for other cases. Write the ># NVRA to the file so as to be (potentially) able to ># later use it for removing the alternative in posttrans. >if [ $1 -gt 1 ]; then > mkdir %{rpm_state_dir} || : > echo %{uniqueprefix} > %{rpm_state_dir}/upgrade >fi > ># Note: posttrans isn't run on pkg deletion. Hence we need postun ># for this case. Guard it with $1 -eq 0 so as to not run it ># for upgrades/reinstall. Only provide a NVRA trace for the ># upgrade/reinstall case. Write the NVRA to file 'upgrade' ># so as to be able to use that info in posttrans. >%postun >echo postun: %{uniqueprefix} - $1 >if [ $1 -eq 0 ]; then > echo removing alternative for pkg deletion > alternatives --remove %{name}-script %{bindir}/%{name}-script >else > # Might exist on re-install > if [ ! -e %{rpm_state_dir} ]; then > mkdir %{rpm_state_dir} || : > fi > echo %{uniqueprefix} > %{rpm_state_dir}/upgrade >fi > >%posttrans >echo posttrans: %{uniqueprefix} - $1 >if [ -e %{rpm_state_dir}/upgrade ]; then > echo upgrade or re-install > upgrade_nvr=$(cat %{rpm_state_dir}/upgrade) > # If we have a different NVRA written to the upgrade file in > # RPM state dir, we know this is an upgrade. Remember for an > # upgrade the order is: post(new) => postun(old) => posttrans(new) > # Since we want to remove the old alternative NVRA, postun(old) > # will overwrite it with the right NRVA in file 'upgrade'. Use > # that NVRA so as to remove the right alternative. > if [ "%{uniqueprefix}" != "${upgrade_nvr}" ]; then > echo upgrade, removing old alternative ${upgrade_nvr} > alternatives --remove %{name}-script %{_datadir}/${upgrade_nvr}/bin/%{name}-script > else > echo reinstall of %{uniqueprefix} > fi >fi >rm -rf %{rpm_state_dir} > >%files >%{bindir} > >%changelog >* Thu Aug 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1.0-4 >- Attempt approach with rpm state and posttrans. > >* Thu Aug 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1.0-3 >- rebuilt > >* Thu Aug 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1.0-2 >- Proposed solution with $1 -eq 0 check. > >* Thu Aug 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 1.0-1 >- Initial test pkg
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1200302
:
1063275
|
1072210
| 1479818