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
18db2f92
Commit
18db2f92
authored
Mar 31, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm pack: rewrite
parent
a7fbc3fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
30 deletions
+54
-30
epm-pack
bin/epm-pack
+54
-30
No files found.
bin/epm-pack
View file @
18db2f92
...
...
@@ -19,6 +19,7 @@
load_helper epm-sh-altlinux
load_helper epm-assure
load_helper epm-repack
[
-n
"
$EPM_PACK_SCRIPTS_DIR
"
]
||
EPM_PACK_SCRIPTS_DIR
=
"
$CONFIGDIR
/pack.d"
...
...
@@ -39,37 +40,74 @@ __epm_pack()
set_sudo
export
SUDO
local
bashopt
=
''
[
-n
"
$verbose
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
# TODO: inside () ?
export
PATH
=
$PROGDIR
:
$PATH
local
bashopt
=
''
[
-n
"
$verbose
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
)
||
fatal
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
rm
-rf
$tmpdir
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
didn't return tarname"
#local newname="$(basename "$returntarname")"
# now it is by default in the current dir
#if [ "$returntarname" != "$(realpath $newname)" ; then
# # repack put its result to the current dir
# mv -v $returntarname . || fatal
#fi
if
[
-n
"
$download_only
"
]
;
then
echo
mv
-v
$returntarname
.
return
fi
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
didn't return tarname"
trap
"rm -v
$returntarname
"
EXIT
# FIXME: __epm_repack will drop trap
repacked_pkgs
=
''
# repack to our target
if
__epm_repack_if_needed
$returntarname
;
then
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't repack
$returntarname
"
# if repack is forced or repack rule (not disabled) is exists
elif
[
-n
"
$repack
"
]
||
[
-z
"
$norepack
"
]
&&
__epm_have_repack_rule
$returntarname
;
then
__epm_repack
"
$returntarname
"
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't repack
$returntarname
"
fi
if
[
-n
"
$repacked_pkgs
"
]
;
then
rm
-v
$returntarname
mv
-v
$repacked_pkgs
.
||
fatal
pkgname
=
$(
pwd
)
/
"
$(
basename
$repacked_pkgs
)
"
else
pkgname
=
"
$returntarname
"
fi
if
[
-n
"
$install
"
]
;
then
trap
"rm -v
$pkgname
"
EXIT
docmd epm
install
$pkgname
return
fi
trap
""
EXIT
# FIXME: it is better use current dir, but there will troubles with epm install --download-only later
mv
$returntarname
$tmpdir
/
||
fatal
cd
$tmpdir
||
fatal
(
unset
EPMCURDIR
;
docmd epm repack
--quiet
"
$(
basename
"
$returntarname
"
)
"
)
packed_pkgs
=
"
$tmpdir
/
$(
echo
*
.
$PKGFORMAT
)
"
}
epm_pack_help
()
{
cat
<<
EOF
epm pack - create rpm package from files
Usage: epm pack <packname> <tar|url|dir>
Usage: epm pack
[options]
<packname> <tar|url|dir>
Options:
<packname> - receipt
packanme
<packname> - receipt
<dir> - create tarball from the dir before
<url> - download tar from url
--install - install after create
--install - install after pack result
--repack - force repack ever if returned package can be installed without repack
--download-only - save pack result and exit
--save-only - save repacked packages and exit (this is default behaviour)
EOF
}
...
...
@@ -107,20 +145,6 @@ epm_pack()
true
fi
if
__epm_pack
"
$packname
"
"
$tarname
"
&&
[
-n
"
$packed_pkgs
"
]
;
then
#FIXME
if
[
-n
"
$install
"
]
;
then
docmd epm
install
$packed_pkgs
return
fi
cp
$packed_pkgs
"
$EPMCURDIR
"
if
[
-z
"
$quiet
"
]
;
then
echo
echo
"Packed packages:"
for
i
in
$packed_pkgs
;
do
echo
"
$EPMCURDIR
/
$(
basename
"
$i
"
)
"
done
fi
fi
__epm_pack
"
$packname
"
"
$tarname
"
}
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