Commit a9da859b authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repo index/add: improvements

parent d306b611
...@@ -73,12 +73,22 @@ __epm_addrepo_etersoft_addon() ...@@ -73,12 +73,22 @@ __epm_addrepo_etersoft_addon()
fi fi
} }
get_archlist()
{
echo "noarch"
echo "$DISTRARCH"
case $DISTRARCH in
x86_64)
echo "i586"
;;
esac
}
__epm_addrepo_altlinux_dir() __epm_addrepo_altlinux_dir()
{ {
local archlist="i586 x86_64 aarch64 noarch"
local dir="$1" local dir="$1"
local arch local arch
for arch in $archlist ; do for arch in $(get_archlist) ; do
local rd="$(echo $dir/$arch/RPMS.*)" local rd="$(echo $dir/$arch/RPMS.*)"
[ -d "$rd" ] || continue [ -d "$rd" ] || continue
local REPO_NAME="$(echo "$rd" | sed -e 's|.*\.||')" local REPO_NAME="$(echo "$rd" | sed -e 's|.*\.||')"
......
...@@ -19,6 +19,18 @@ ...@@ -19,6 +19,18 @@
load_helper epm-sh-altlinux load_helper epm-sh-altlinux
# copied from epm-addrepo
get_archlist()
{
echo "noarch"
echo "$DISTRARCH"
case $DISTRARCH in
x86_64)
echo "i586"
;;
esac
}
# https://www.altlinux.org/APT_%D0%B2_ALT_Linux/CreateRepository # https://www.altlinux.org/APT_%D0%B2_ALT_Linux/CreateRepository
__epm_repoindex_alt() __epm_repoindex_alt()
{ {
...@@ -30,7 +42,7 @@ __epm_repoindex_alt() ...@@ -30,7 +42,7 @@ __epm_repoindex_alt()
shift shift
fi fi
epm assure genbasedir apt-repo-tools epm assure genbasedir apt-repo-tools || fatal
REPO_DIR="$1" REPO_DIR="$1"
# TODO: check if we inside arch dir or RPMS.* # TODO: check if we inside arch dir or RPMS.*
[ -n "$REPO_DIR" ] || REPO_DIR="$(pwd)" [ -n "$REPO_DIR" ] || REPO_DIR="$(pwd)"
...@@ -39,7 +51,7 @@ __epm_repoindex_alt() ...@@ -39,7 +51,7 @@ __epm_repoindex_alt()
if [ -z "$REPO_NAME" ] ; then if [ -z "$REPO_NAME" ] ; then
# default name # default name
REPO_NAME="addon" REPO_NAME="addon"
# detect if already exists # detect name if already exists
for arch in $archlist ; do for arch in $archlist ; do
local rd="$(echo $REPO_DIR/$arch/RPMS.*)" local rd="$(echo $REPO_DIR/$arch/RPMS.*)"
[ -d "$rd" ] && REPO_NAME="$(echo "$rd" | sed -e 's|.*\.||')" && break [ -d "$rd" ] && REPO_NAME="$(echo "$rd" | sed -e 's|.*\.||')" && break
...@@ -47,15 +59,16 @@ __epm_repoindex_alt() ...@@ -47,15 +59,16 @@ __epm_repoindex_alt()
fi fi
if [ -n "$init" ] ; then if [ -n "$init" ] ; then
for arch in $archlist; do for arch in $(get_archlist); do
mkdir -pv "$REPO_DIR/$arch/base/" "$REPO_DIR/$arch/RPMS.$REPO_NAME" mkdir -pv "$REPO_DIR/$arch/base/"
mkdir -pv "$REPO_DIR/$arch/RPMS.$REPO_NAME/"
done done
return return
fi fi
for arch in $archlist; do for arch in $archlist; do
mkdir -pv "$REPO_DIR/$arch/base/"
[ -d "$REPO_DIR/$arch/RPMS.$REPO_NAME" ] || continue [ -d "$REPO_DIR/$arch/RPMS.$REPO_NAME" ] || continue
mkdir -pv "$REPO_DIR/$arch/base/"
sudocmd genbasedir --bloat --progress --topdir=$REPO_DIR $arch $REPO_NAME sudocmd genbasedir --bloat --progress --topdir=$REPO_DIR $arch $REPO_NAME
done done
} }
...@@ -91,8 +104,10 @@ case $PMTYPE in ...@@ -91,8 +104,10 @@ case $PMTYPE in
sudocmd verifytree sudocmd verifytree
;; ;;
dnf-rpm) dnf-rpm)
docmd dnf repolist $verbose epm install --skip-installed yum-utils createrepo || fatal
[ -n "$verbose" ] || info "Use --verbose if you need detail information." sudocmd mkdir -pv "$@"
sudocmd createrepo -v -s md5 "$@"
sudocmd verifytree
;; ;;
eoget) eoget)
docmd eoget index "$@" docmd eoget index "$@"
......
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