Hi,
I'm using rpmbuild 4.8.0 to build my rpm package on RHEL6. The spec file works just fine with any other Linux Releases, including RHEL5. But at the end, build failed with:
"shell-init error retrieving current directory: getcwd: cannot access parent directories: No such file or directory"
I found that rpmbuild tried to compare the BUILD directory with the root filesystem, it will delete the BUILD directory if it's not '/'. My working directory is /tmp/test, so something like this in the /var/tmp/rpm-tmp file:
Code:
cd "/tmp/test/BUILD"
[ "RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
I think this is the reason why the command failed.
And I can't find the two lines of similar code in an earlier version of rpmbuild on RHEL5.
Why rpmbuild does this?
THANKS!