Commit acf7c7cd authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-repack: don't intersect with source rpm package

parent 675c1be6
...@@ -160,7 +160,7 @@ __epm_repack_rpm() ...@@ -160,7 +160,7 @@ __epm_repack_rpm()
local abspkg local abspkg
repacked_rpms='' repacked_rpms=''
for pkg in $* ; do for pkg in $* ; do
local tmpbuilddir=$HOME/repack-$(basename $pkg) local tmpbuilddir=$HOME/$(basename $pkg).tmpdir
mkdir $tmpbuilddir mkdir $tmpbuilddir
abspkg="$(realpath $pkg)" abspkg="$(realpath $pkg)"
info "" info ""
...@@ -168,6 +168,7 @@ __epm_repack_rpm() ...@@ -168,6 +168,7 @@ __epm_repack_rpm()
# alien failed with spaced names # alien failed with spaced names
# alpkg=$abspkg # alpkg=$abspkg
alpkg=$(basename $pkg) alpkg=$(basename $pkg)
# don't use abs package path: copy package to temp dir and use there
cp -v $pkg $tmpbuilddir/../$alpkg cp -v $pkg $tmpbuilddir/../$alpkg
cd $tmpbuilddir || fatal cd $tmpbuilddir || fatal
docmd fakeroot alien --generate --to-rpm $verbose $scripts "../$alpkg" || fatal docmd fakeroot alien --generate --to-rpm $verbose $scripts "../$alpkg" || fatal
...@@ -191,8 +192,9 @@ __epm_repack_rpm() ...@@ -191,8 +192,9 @@ __epm_repack_rpm()
else else
a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec >/dev/null || fatal a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec >/dev/null || fatal
fi fi
mv $tmpbuilddir/../*.rpm $tmpbuilddir/ # remove copy of source binary package (don't mix with generated)
local repacked_rpm="$(realpath $tmpbuilddir/*.rpm)" rm -f $tmpbuilddir/../$alpkg
local repacked_rpm="$(realpath $tmpbuilddir/../*.rpm)"
if [ -s "$repacked_rpm" ] ; then if [ -s "$repacked_rpm" ] ; then
repacked_rpms="$repacked_rpms $repacked_rpm" repacked_rpms="$repacked_rpms $repacked_rpm"
to_remove_pkg_files="$to_remove_pkg_files $repacked_rpm" to_remove_pkg_files="$to_remove_pkg_files $repacked_rpm"
...@@ -201,7 +203,6 @@ __epm_repack_rpm() ...@@ -201,7 +203,6 @@ __epm_repack_rpm()
fi fi
cd - >/dev/null cd - >/dev/null
rm -rf $tmpbuilddir/$subdir/ rm -rf $tmpbuilddir/$subdir/
#rm -rf $tmpbuilddir/../*.rpm
rm -rf $spec rm -rf $spec
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment