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
0aa44339
Commit
0aa44339
authored
May 13, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm pack: refactoring, move script runnning to a seprate func
parent
3ab97a11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
epm-pack
bin/epm-pack
+17
-8
No files found.
bin/epm-pack
View file @
0aa44339
...
...
@@ -23,9 +23,9 @@ load_helper epm-repack
[
-n
"
$EPM_PACK_SCRIPTS_DIR
"
]
||
EPM_PACK_SCRIPTS_DIR
=
"
$CONFIGDIR
/pack.d"
#
we run this function in a tmpdir
__epm_pack
()
# <packname> <abstarname> [packversion]
#
fills returntarname with returned tar name or empty
__epm_pack
_run_handler
()
{
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
...
...
@@ -33,7 +33,7 @@ __epm_pack()
returntarname
=
''
local
repackcode
=
"
$EPM_PACK_SCRIPTS_DIR
/
$packname
.sh"
[
-x
"
$repackcode
"
]
||
fatal
"Can't find script
$repackcode
for packname
$packname
"
[
-x
"
$repackcode
"
]
||
return
[
-f
"
$repackcode
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$EPM_PACK_SCRIPTS_DIR
dir. The pack script can be outdated."
# a file to keep filename of generated tarball
...
...
@@ -43,10 +43,19 @@ __epm_pack()
local
bashopt
=
''
[
-n
"
$debug
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
(
unset
EPMCURDIR
;
export
PATH
=
$SCPATH
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
)
||
fatal
(
unset
EPMCURDIR
;
export
PATH
=
$SCPATH
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
)
||
fatal
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
[
-s
"
$returntarname
"
]
||
fatal
"pack script for
$packname
return unexist
$returntarname
file"
return
0
}
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
return unexist
$returntarname
file"
# we run this function in a tmpdir
__epm_pack
()
{
local
packname
=
"
$1
"
# fills returntarname with packed tar
__epm_pack_run_handler
"
$@
"
||
fatal
"Can't find pack script for packname
$packname
"
if
[
-n
"
$download_only
"
]
;
then
mv
$returntarname
$EPMCURDIR
...
...
@@ -64,6 +73,7 @@ __epm_pack()
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't repack
$returntarname
"
fi
local
pkgname
if
[
-n
"
$repacked_pkgs
"
]
;
then
# remove packed file if we have repacked one
rm
-v
"
$returntarname
"
...
...
@@ -128,16 +138,15 @@ epm_pack()
tarname
=
"
$(
realpath
"
$pkg_files
"
)
"
elif
[
-d
"
$tarname
"
]
;
then
tarname
=
"
$(
realpath
"
$tarname
"
)
"
cd
$tmpdir
||
fatal
elif
[
-s
"
$tarname
"
]
;
then
# get full path for real name
tarname
=
"
$(
realpath
"
$tarname
"
)
"
cd
$tmpdir
||
fatal
else
# just pass name
true
fi
cd
$tmpdir
||
fatal
__epm_pack
"
$packname
"
"
$tarname
"
"
$packversion
"
}
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