Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
eepm
Commits
bee33d3f
Commit
bee33d3f
authored
Mar 26, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm repo: implement initial support for create local repo (index,pkgadd,pkgdel,pkgupdate)
parent
17e6fe10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
261 additions
and
0 deletions
+261
-0
epm-repo
bin/epm-repo
+17
-0
epm-repoindex
bin/epm-repoindex
+106
-0
epm-repopkg
bin/epm-repopkg
+138
-0
No files found.
bin/epm-repo
View file @
bee33d3f
...
...
@@ -60,6 +60,22 @@ epm_repo()
load_helper epm-repofix
epm_reposwitch
"
$@
"
;;
index
)
# HELPCMD: index repo: [--init] [path] [name]
load_helper epm-repoindex
epm_repoindex
"
$@
"
;;
pkgadd
)
# HELPCMD: add to <dir> applied <package-filename1> [<package-filename2>...]
load_helper epm-repopkg
epm_repo_pkgadd
"
$@
"
;;
pkgupdate
)
# HELPCMD: replace in <dir> with new <package-filename1> [<package-filename2>...]
load_helper epm-repopkg
epm_repo_pkgupdate
"
$@
"
;;
pkgdel
)
# HELPCMD: del from <dir> <package1> [<package2>...]
load_helper epm-repopkg
epm_repo_pkgdel
"
$@
"
;;
enable
)
# HELPCMD: enable <repo>
load_helper epm-repoenable
epm_repoenable
"
$@
"
...
...
@@ -67,6 +83,7 @@ epm_repo()
disable
)
# HELPCMD: disable <repo>
load_helper epm-repodisable
epm_repodisable
"
$@
"
;;
clean
)
# HELPCMD: remove temp. repos (tasks and CD-ROMs)
# TODO: check for ALT
sudocmd apt-repo
$dryrun
clean
...
...
bin/epm-repoindex
0 → 100644
View file @
bee33d3f
#!/bin/sh
#
# Copyright (C) 2023 Etersoft
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-sh-altlinux
# https://www.altlinux.org/APT_%D0%B2_ALT_Linux/CreateRepository
__epm_repoindex_alt
()
{
local
archlist
=
"i586 x86_64 aarch64 noarch"
local
init
=
''
if
[
"
$1
"
=
"--init"
]
;
then
init
=
'--init'
shift
fi
epm assure genbasedir apt-repo-tools
REPO_DIR
=
"
$1
"
# TODO: check if we inside arch dir or RPMS.*
[
-n
"
$REPO_DIR
"
]
||
REPO_DIR
=
"
$(
pwd
)
"
[
-d
"
$REPO_DIR
"
]
||
fatal
"Repo dir
$REPO_DIR
does not exist"
REPO_NAME
=
"
$2
"
if
[
-z
"
$REPO_NAME
"
]
;
then
# default name
REPO_NAME
=
"addon"
# detect if already exists
for
arch
in
$archlist
;
do
local
rd
=
"
$(
echo
$REPO_DIR
/
$arch
/RPMS.
*)
"
[
-d
"
$rd
"
]
&&
REPO_NAME
=
"
$(
echo
"
$rd
"
|
sed
-e
's|.*\.||'
)
"
&&
break
done
fi
if
[
-n
"
$init
"
]
;
then
for
arch
in
$archlist
;
do
mkdir
-pv
"
$REPO_DIR
/
$arch
/base/"
"
$REPO_DIR
/
$arch
/RPMS.
$REPO_NAME
"
done
return
fi
for
arch
in
$archlist
;
do
mkdir
-pv
"
$REPO_DIR
/
$arch
/base/"
[
-d
"
$REPO_DIR
/
$arch
/RPMS.
$REPO_NAME
"
]
||
continue
sudocmd genbasedir
--bloat
--progress
--topdir
=
$REPO_DIR
$arch
$REPO_NAME
done
}
__epm_repoindex_deb
()
{
local
init
=
''
if
[
"
$1
"
=
"--init"
]
;
then
init
=
'--init'
shift
fi
local dir
=
"
$1
"
sudocmd
mkdir
-pv
"
$dir
"
||
fatal
sudocmd dpkg-scanpackages
-t
deb
"
$dir
"
|
gzip
|
cat
>
"
$dir
/Packages.gz"
}
epm_repoindex
()
{
case
$PMTYPE
in
apt-rpm
)
__epm_repoindex_alt
"
$@
"
;;
apt-dpkg|aptitude-dpkg
)
__epm_repoindex_deb
"
$@
"
;;
yum-rpm
)
epm
install
--skip-installed
yum-utils createrepo
||
fatal
sudocmd
mkdir
-pv
"
$@
"
sudocmd createrepo
-v
-s
md5
"
$@
"
sudocmd verifytree
;;
dnf-rpm
)
docmd dnf repolist
$verbose
[
-n
"
$verbose
"
]
||
info
"Use --verbose if you need detail information."
;;
eoget
)
docmd eoget index
"
$@
"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
bin/epm-repopkg
0 → 100644
View file @
bee33d3f
#!/bin/sh
#
# Copyright (C) 2023 Etersoft
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-sh-altlinux
__epm_repo_pkgadd_alt
()
{
local
archlist
=
"i586 x86_64 aarch64 noarch"
local
REPO_DIR
=
"
$1
"
shift
[
-d
"
$REPO_DIR
"
]
||
fatal
"Can't find repo dir
$REPO_DIR
."
# default name
REPO_NAME
=
"addon"
# detect if already exists
for
arch
in
$archlist
;
do
local
rd
=
"
$(
echo
$REPO_DIR
/
$arch
/RPMS.
*)
"
[
-d
"
$rd
"
]
&&
REPO_NAME
=
"
$(
echo
"
$rd
"
|
sed
-e
's|.*\.||'
)
"
&&
break
done
[
-n
"
$1
"
]
||
fatal
"Missed package name"
while
[
-s
"
$1
"
]
;
do
arch
=
"
$(
epm print
arch
from filename
"
$1
"
)
"
||
fatal
epm checkpkg
"
$1
"
||
fatal
cp
-v
"
$1
"
$REPO_DIR
/
$arch
/RPMS.
$REPO_NAME
||
fatal
shift
done
}
__epm_repo_pkgdel_alt
()
{
local
archlist
=
"i586 x86_64 aarch64 noarch"
local
REPO_DIR
=
"
$1
"
shift
[
-d
"
$REPO_DIR
"
]
||
fatal
"Can't find repo dir
$REPO_DIR
."
[
-n
"
$1
"
]
||
fatal
"Missed package name"
# default name
REPO_NAME
=
"addon"
# detect if already exists
for
arch
in
$archlist
;
do
local
rd
=
"
$(
echo
$REPO_DIR
/
$arch
/RPMS.
*)
"
[
-d
"
$rd
"
]
&&
REPO_NAME
=
"
$(
echo
"
$rd
"
|
sed
-e
's|.*\.||'
)
"
&&
break
done
while
[
-s
"
$1
"
]
;
do
for
arch
in
$archlist
;
do
local
rd
=
"
$REPO_DIR
/
$arch
/RPMS.
$REPO_NAME
"
for
i
in
$rd
/
$1
*
;
do
[
"
$1
"
=
"
$(
epm print pkgname from
$i
)
"
||
continue
rm
-v
$rd
/
$1
*
done
done
shift
done
}
__epm_repo_pkgupdate_alt
()
{
local dir
=
"
$1
"
shift
for
i
in
"
$@
"
;
do
pkg
=
"
$(
epm print pkgname from
$i
)
"
||
fatal
__epm_repo_pkgdel_alt
"
$dir
"
$pkg
done
__epm_repo_pkgadd_alt
"
$dir
"
"
$@
"
}
epm_repo_pkgadd
()
{
case
$PMTYPE
in
apt-rpm
)
__epm_repo_pkgadd_alt
"
$@
"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_repo_pkgupdate
()
{
case
$PMTYPE
in
apt-rpm
)
__epm_repo_pkgupdate_alt
"
$@
"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_repo_pkgdel
()
{
case
$PMTYPE
in
apt-rpm
)
__epm_repo_pkgdel_alt
"
$@
"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment