1. rpmbuild --with=sbinsymlinks -bb test.spec
```
[root@localhost SPECS]# cat test.spec
%bcond_without sbinsymlinks
Name: test
Version: 1.0
Release: 1
License: MIT
Summary: Test
BuildArch: noarch
%description
Test
%prep
%build
%install
mkdir -p %{buildroot}/usr/sbin/
touch %{buildroot}/usr/sbin/aaa
%if %{with sbinsymlinks}
mkdir %{buildroot}/sbin/
cd %{buildroot}/sbin/
ln -sv ..%{_sbindir}/aaa .
%endif
%post
%files
/usr/sbin/aaa
%if %{with sbinsymlinks}
/sbin/aaa
%endif
```
2. rpm -i /root/rpmbuild/RPMS/noarch/test-1.0-1.noarch.rpm --force
when `sbin -> usr/sbin` soft link exists, according to the preceding steps, the
following error information is displayed:
```
[root@localhost SPECS]# rpm -i /root/rpmbuild/RPMS/noarch/test-1.0-1.noarch.rpm
--force
error: unpacking of archive failed on file /usr/sbin/aaa;636c693f: cpio: open
failed - No such file or directory
error: test-1.0-1.noarch: install failed
```
The problem is caused by the a82251b44ee2d2802ee8aea1b3d89f88beee4bad
submission. The cause is that a temporary file /usr/sbin/aaa;xxx is created
using openat(), and then the file /sbin/aaa;xxx is created using openat(),
openat() failed because the file already exists. Before the
a82251b44ee2d2802ee8aea1b3d89f88beee4bad is integrated, the temporary file is
renamed and then the next temporary file is generated. Therefore, there's no
open same files case.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2273
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/2...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint