3
# Copyright (C) 2023 Etersoft
4
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
load_helper epm-sh-altlinux
22
# copied from epm-addrepo
34
# https://www.altlinux.org/APT_%D0%B2_ALT_Linux/CreateRepository
37
local archlist="i586 x86_64 x86_64-i586 aarch64 noarch"
40
if [ "$1" = "--init" ] ; then
45
epm assure genbasedir apt-repo-tools || fatal
47
# TODO: check if we inside arch dir or RPMS.*
48
[ -n "$REPO_DIR" ] || REPO_DIR="$(pwd)"
49
if [ -z "$init" ] ; then
50
[ -d "$REPO_DIR" ] || fatal "Repo dir $REPO_DIR does not exist"
54
if [ -z "$REPO_NAME" ] ; then
57
# detect name if already exists
58
for arch in $archlist ; do
59
local rd="$(echo $REPO_DIR/$arch/RPMS.*)"
60
[ -d "$rd" ] && REPO_NAME="$(echo "$rd" | sed -e 's|.*\.||')" && break
64
if [ -n "$init" ] ; then
65
for arch in $(get_archlist); do
66
mkdir -pv "$REPO_DIR/$arch/base/"
67
mkdir -pv "$REPO_DIR/$arch/RPMS.$REPO_NAME/"
72
for arch in $archlist; do
73
[ -d "$REPO_DIR/$arch/RPMS.$REPO_NAME" ] || continue
74
mkdir -pv "$REPO_DIR/$arch/base/"
75
docmd genbasedir --bloat --progress --topdir=$REPO_DIR $arch $REPO_NAME
82
if [ "$1" = "--init" ] ; then
88
docmd mkdir -pv "$dir" || fatal
90
docmd dpkg-scanpackages -t deb "$dir" | gzip | cat > "$dir/Packages.gz"
99
__epm_repoindex_alt "$@"
101
apt-dpkg|aptitude-dpkg)
102
__epm_repoindex_deb "$@"
105
epm install --skip-installed yum-utils createrepo || fatal
107
docmd createrepo -v -s md5 "$@"
111
epm install --skip-installed yum-utils createrepo || fatal
113
docmd createrepo -v -s md5 "$@"
117
docmd eoget index "$@"
120
fatal "Have no suitable command for $PMTYPE"
129
epm_repoindex --init "$@"