Commit d5aa1284 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: fix repack/install rpm on a deb system

parent feda0cd9
...@@ -32,7 +32,7 @@ __epm_split_by_pkg_type() ...@@ -32,7 +32,7 @@ __epm_split_by_pkg_type()
for pkg in "$@" ; do for pkg in "$@" ; do
[ "$(get_package_type "$pkg")" = "$type" ] || return 1 [ "$(get_package_type "$pkg")" = "$type" ] || return 1
[ -e "$pkg" ] || fatal "Can't read $pkg" [ -e "$pkg" ] || fatal "Can't read $pkg"
split_replaced_pkgs="$split_target_pkgs $(realpath "$pkg")" split_replaced_pkgs="$split_target_pkgs $pkg"
done done
[ -n "$split_replaced_pkgs" ] [ -n "$split_replaced_pkgs" ]
...@@ -42,6 +42,7 @@ __epm_split_by_pkg_type() ...@@ -42,6 +42,7 @@ __epm_split_by_pkg_type()
__epm_repack_rpm_to_deb() __epm_repack_rpm_to_deb()
{ {
local pkg local pkg
local rpmpkgs="$1"
assure_exists alien assure_exists alien
assure_exists fakeroot assure_exists fakeroot
...@@ -50,25 +51,27 @@ __epm_repack_rpm_to_deb() ...@@ -50,25 +51,27 @@ __epm_repack_rpm_to_deb()
repacked_debs='' repacked_debs=''
local TDIR=$(mktemp -d) local TDIR=$(mktemp -d)
cd $TDIR || fatal
for pkg in $rpmpkgs ; do for pkg in $rpmpkgs ; do
pkg="$(realpath "$pkg")"
cd $TDIR || fatal
showcmd_store_output fakeroot alien -d -k $scripts "$pkg" showcmd_store_output fakeroot alien -d -k $scripts "$pkg"
local DEBCONVERTED=$(grep "deb generated" $RC_STDOUT | sed -e "s| generated||g") local DEBCONVERTED=$(grep "deb generated" $RC_STDOUT | sed -e "s| generated||g")
repacked_debs="$repacked_rpms $(realpath $DEBCONVERTED)" repacked_debs="$repacked_rpms $(realpath $DEBCONVERTED)"
to_remove_pkg_files="$to_remove_pkg_files $(realpath $DEBCONVERTED)" to_remove_pkg_files="$to_remove_pkg_files $(realpath $DEBCONVERTED)"
clean_store_output clean_store_output
cd - >/dev/null
done done
# TODO: move it to exit handler # TODO: move it to exit handler
if [ -z "$DEBUG" ] ; then #if [ -z "$DEBUG" ] ; then
# TODO: reinvent # # TODO: reinvent
[ -n "$to_remove_pkg_files" ] && rm -f $to_remove_pkg_files # [ -n "$to_remove_pkg_files" ] && rm -f $to_remove_pkg_files
[ -n "$to_remove_pkg_files" ] && rmdir $(dirname $to_remove_pkg_files | head -n1) 2>/dev/null # [ -n "$to_remove_pkg_files" ] && rmdir $(dirname $to_remove_pkg_files | head -n1) 2>/dev/null
[ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs # [ -n "$to_remove_pkg_dirs" ] && rmdir $to_remove_pkg_dirs
fi #fi
cd - >/dev/null #cd - >/dev/null
return 0 return 0
} }
......
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