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
etersoft
eepm
Commits
6d6a2a01
Commit
6d6a2a01
authored
Mar 11, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm repack: rewrite __epm_repack() via __epm_repack_single(), fix repack rule detection
parent
9387be94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
30 deletions
+39
-30
epm-repack
bin/epm-repack
+21
-14
epm-repack-deb
bin/epm-repack-deb
+11
-8
epm-repack-rpm
bin/epm-repack-rpm
+7
-8
No files found.
bin/epm-repack
View file @
6d6a2a01
...
...
@@ -132,31 +132,26 @@ __prepare_source_package()
# FIXME: Нужно как-то обеспечить непродолжение выполнения.
# used in epm install
# fill repacked_pkgs
__epm_repack
()
__epm_repack_single
()
{
repacked_pkgs
=
''
local
pkg
=
"
$1
"
case
$PKGFORMAT
in
rpm
)
load_helper epm-repack-rpm
__epm_repack_to_rpm
"
$
@
"
||
return
__epm_repack_to_rpm
"
$
pkg
"
||
return
;;
deb
)
# FIXME: only one package in $@ is supported
#local pkgname="$(epm print name from "$@")"
#__set_version_pkgname "$1"
local
repackcode
=
"
$EPM_REPACK_SCRIPTS_DIR
/
$PKGNAME
.sh"
if
[
-x
"
$repackcode
"
]
;
then
if
__epm_have_repack_rule
"
$pkg
"
;
then
# we have repack rules only for rpm, so use rpm step in any case
load_helper epm-repack-rpm
load_helper epm-repack-deb
__epm_repack_to_rpm
"
$
@
"
||
return
[
-n
"
$repacked_pkg
s
"
]
||
return
__epm_repack_to_deb
$repacked_pkg
s
__epm_repack_to_rpm
"
$
pkg
"
||
return
[
-n
"
$repacked_pkg
"
]
||
return
__epm_repack_to_deb
$repacked_pkg
||
return
else
load_helper epm-repack-deb
__epm_repack_to_deb
"
$
@
"
||
return
__epm_repack_to_deb
"
$
pkg
"
||
return
fi
;;
*
)
...
...
@@ -167,6 +162,18 @@ __epm_repack()
return
0
}
# fill repacked_pkgs
__epm_repack
()
{
local
pkg
repacked_pkgs
=
''
for
pkg
in
$*
;
do
__epm_repack_single
"
$pkg
"
||
fatal
"Error with
$pkg
repacking."
[
-n
"
$repacked_pkgs
"
]
&&
repacked_pkgs
=
"
$repacked_pkgs
$repacked_pkg
"
||
repacked_pkgs
=
"
$repacked_pkg
"
done
}
__epm_repack_if_needed
()
{
# return 1 if there is a package in host package format
...
...
bin/epm-repack-deb
View file @
6d6a2a01
...
...
@@ -18,17 +18,16 @@
#
# fills repacked_pkg
s
# fills repacked_pkg
__epm_repack_to_deb
()
{
local
pkg
local
pkgs
=
"
$*
"
local
pkg
=
"
$1
"
assure_exists alien
assure_exists fakeroot
assure_exists rpm
repacked_pkg
s
=
''
repacked_pkg
=
''
local
TDIR
TDIR
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
...
...
@@ -36,7 +35,10 @@ __epm_repack_to_deb()
umask
022
for
pkg
in
$pkgs
;
do
if
echo
"
$pkg
"
|
grep
-q
"
\.
deb"
;
then
warning
"Repack deb to deb is not supported yet."
fi
abspkg
=
"
$(
realpath
"
$pkg
"
)
"
info
"Repacking
$abspkg
to local deb format (inside
$TDIR
) ..."
...
...
@@ -47,15 +49,16 @@ __epm_repack_to_deb()
cd
$TDIR
||
fatal
__prepare_source_package
"
$pkg
"
showcmd_store_output fakeroot alien
-d
-k
$scripts
"
$alpkg
"
showcmd_store_output fakeroot alien
-d
-k
$
verbose
$
scripts
"
$alpkg
"
local
DEBCONVERTED
=
$(
grep
"deb generated"
$RC_STDOUT
|
sed
-e
"s| generated||g"
)
if
[
-n
"
$DEBCONVERTED
"
]
;
then
repacked_pkg
s
=
"
$repacked_pkgs
$(
realpath
$DEBCONVERTED
)
"
repacked_pkg
=
"
$repacked_pkg
$(
realpath
$DEBCONVERTED
)
"
remove_on_exit
"
$(
realpath
$DEBCONVERTED
)
"
else
warning
"Can't find converted deb for source binary package '
$pkg
'"
fi
clean_store_output
cd
-
>
/dev/null
done
return
0
}
...
...
bin/epm-repack-rpm
View file @
6d6a2a01
...
...
@@ -124,10 +124,10 @@ __try_install_eepm_rpmbuild()
RPMBUILD
=
/usr/bin/rpmbuild
}
# will fill repacked_pkg
s
var
# will fill repacked_pkg var
__epm_repack_to_rpm
()
{
local
pkg
s
=
"
$*
"
local
pkg
=
"
$1
"
# Note: install epm-repack for static (package based) dependencies
assure_exists alien
||
fatal
...
...
@@ -151,18 +151,18 @@ __epm_repack_to_rpm()
umask
022
# TODO: improve
if
echo
"
$pkg
s
"
|
grep
-q
"
\.
deb"
;
then
if
echo
"
$pkg
"
|
grep
-q
"
\.
deb"
;
then
assure_exists dpkg
||
fatal
# TODO: Для установки требует: /usr/share/debconf/confmodule но пакет не может быть установлен
# assure_exists debconf
fi
local
pkg
local
alpkg
local
abspkg
local
tmpbuilddir
repacked_pkgs
=
''
for
pkg
in
$pkgs
;
do
repacked_pkg
=
''
# TODO: keep home?
HOME
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
remove_on_exit
$HOME
...
...
@@ -236,12 +236,11 @@ __epm_repack_to_rpm()
local
repacked_rpm
=
"
$(
realpath
$tmpbuilddir
/../
*
.rpm
)
"
if
[
-s
"
$repacked_rpm
"
]
;
then
remove_on_exit
"
$repacked_rpm
"
[
-n
"
$repacked_pkgs
"
]
&&
repacked_pkgs
=
"
$repacked_pkgs
$repacked_rpm
"
||
repacked_pkgs
=
"
$repacked_rpm
"
repacked_pkg
=
"
$repacked_rpm
"
else
warning
"Can't find converted rpm for source binary package '
$pkg
' (got
$repacked_rpm
)"
fi
cd
$EPMCURDIR
>
/dev/null
done
true
}
...
...
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