Commit 954bae9a authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-repack: fix link support

parent 53a8041f
......@@ -67,7 +67,7 @@ __epm_repack_to_deb()
for pkg in $pkgs ; do
abspkg="$(realpath "$pkg")"
info "Repacking $abspkg to local deb format ..."
info "Repacking $abspkg to local deb format (inside $TDIR) ..."
alpkg=$(basename $pkg)
# don't use abs package path: copy package to temp dir and use there
......@@ -170,7 +170,7 @@ EOF
# args: pkgname buildroot spec
__apply_fix_code()
{
local repackcode="$(realpath $EPM_REPACK_SCRIPTS_DIR/$1.sh)"
local repackcode="$EPM_REPACK_SCRIPTS_DIR/$1.sh"
[ -x "$repackcode" ] || return
shift
export PATH=$PROGDIR:$PATH
......@@ -313,7 +313,7 @@ __epm_repack_to_rpm()
mkdir $tmpbuilddir
abspkg="$(realpath $pkg)"
info ""
info "Repacking $abspkg to local rpm format ..."
info "Repacking $abspkg to local rpm format (inside $tmpbuilddir) ..."
alpkg=$(basename $pkg)
# don't use abs package path: copy package to temp dir and use there
......
......@@ -67,11 +67,24 @@ EOF
# move files to $PRODUCTDIR
move_to_opt()
{
local from="$1"
local from="$@"
[ -n "$from" ] || from="/usr/share/$PRODUCT"
mkdir -p $BUILDROOT$PRODUCTDIR/
mv $BUILDROOT/$from/* $BUILDROOT$PRODUCTDIR/
subst "s|$from|$PRODUCTDIR|g" $SPEC
local sdir rdir i
for i in $from ; do
# workaround for wildcards in from
sdir="$(echo $BUILDROOT$i)"
[ -d "$sdir" ] || continue
rdir="$(echo $sdir | sed -e "s|^$BUILDROOT||")"
[ -n "$rdir" ] || return 1 #fatal "Can't resolve $from in $BUILDROOT"
[ -d "$BUILDROOT$rdir" ] || fatal "Can't resolve $from in $BUILDROOT"
break
done
[ -d "$sdir" ] || return 1 #fatal "Can't find any dir from $from list"
mv $BUILDROOT$rdir/* $BUILDROOT$PRODUCTDIR/
subst "s|$rdir|$PRODUCTDIR|g" $SPEC
}
......
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