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
e354aac9
Commit
e354aac9
authored
Apr 06, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: move packing code to pack.d generic
parent
e3cd1d04
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
16 deletions
+68
-16
epm-pack
bin/epm-pack
+14
-10
epm-repack
bin/epm-repack
+12
-6
generic-appimage.sh
pack.d/generic-appimage.sh
+42
-0
No files found.
bin/epm-pack
View file @
e354aac9
...
...
@@ -23,15 +23,16 @@ load_helper epm-repack
[
-n
"
$EPM_PACK_SCRIPTS_DIR
"
]
||
EPM_PACK_SCRIPTS_DIR
=
"
$CONFIGDIR
/pack.d"
__epm_pack
()
# <packname> <abstarname>
# fills returntarname with returned tar name or empty
__epm_pack_run_handler
()
{
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
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."
tmpdir
=
$(
mktemp
-d
)
...
...
@@ -51,15 +52,18 @@ __epm_pack()
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
rm
-rf
$tmpdir
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
didn't return tarname"
return
0
}
#local newname="$(basename "$returntarname")"
__epm_pack
()
{
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
# 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
# will run pack script and check the result
__epm_pack_run_handler
$packname
$tarname
||
fatal
"Can't find script
$repackcode
for packname
$packname
"
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
didn't return tarname"
if
[
-n
"
$download_only
"
]
;
then
return
...
...
bin/epm-repack
View file @
e354aac9
...
...
@@ -92,13 +92,17 @@ __set_version_pkgname()
}
#
AppImage version
#
hack for ktalk2.4.2 -> ktalk 2.4.2
__
set_version_apppkgname
()
#
TODO: pack
#
args: pkgname buildroot spec
__
try_generic_handler
()
{
local
alpkg
=
"
$1
"
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.a-zA-Z]([0-9])([0-9])*([.]*[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.a-zA-Z]||'
-e
's|--|-|g'
)
"
#"
[
-n
"
$VERSION
"
]
&&
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
local
repackcode
=
"
$EPM_REPACK_SCRIPTS_DIR
/
$1
.sh"
[
-s
"
$repackcode
"
]
||
return
shift
export
PATH
=
$PROGDIR
:
$PATH
local
bashopt
=
''
[
-n
"
$verbose
"
]
&&
bashopt
=
'-x'
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$1
"
"
$2
"
"
$3
"
)
||
fatal
"There is an error from
$repackcode
script"
}
...
...
@@ -123,6 +127,8 @@ __prepare_source_package()
VERSION
=
''
SUBGENERIC
=
''
# convert tarballs to tar (for alien)
if
rhas
"
$alpkg
"
"
\.
(rpm|deb)$"
;
then
return
...
...
pack.d/generic-appimage.sh
0 → 100755
View file @
e354aac9
#!/bin/sh
TAR
=
"
$1
"
#VERSION="$2"
RETURNTARNAME
=
"
$2
"
.
$(
dirname
$0
)
/common.sh
# ignore archive not for us
rhas
"
$TAR
"
"
\.
AppImage$"
||
exit
1
CURDIR
=
"
$(
pwd
)
"
PKGDIR
=
"
$(
mktemp
-d
)
"
trap
"rm -fr
$PKGDIR
"
EXIT
cd
$PKGDIR
||
fatal
# AppImage version
__set_version_apppkgname
()
{
local
alpkg
=
"
$1
"
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.a-zA-Z]([0-9])([0-9])*([.]*[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.a-zA-Z]||'
-e
's|--|-|g'
)
"
#"
[
-n
"
$VERSION
"
]
&&
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
}
alpkg
=
$(
basename
$TAR
)
__set_version_apppkgname
$alpkg
[
-n
"
$VERSION
"
]
||
fatal
"Can't get version from
$alpkg
."
# TODO: move repack archive to erc?
[
-x
"
$alpkg
"
]
||
docmd
chmod
u+x
$verbose
"
$alpkg
"
./
$alpkg
--appimage-extract
||
fatal
alpkg
=
$CURDIR
/
$PKGNAME
-
$VERSION
.tar
# make a tar for alien
erc a
$alpkg
squashfs-root
||
fatal
return_tar
"
$alpkg
"
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