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
62bbe429
Commit
62bbe429
authored
May 25, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erc: add support for repack zip->tar with 7z
parent
08868772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
tools_erc
bin/tools_erc
+26
-7
No files found.
bin/tools_erc
View file @
62bbe429
...
@@ -116,7 +116,7 @@ extract_archive()
...
@@ -116,7 +116,7 @@ extract_archive()
fi
fi
arc
=
"
$(
realpath
-s
"
$arc
"
)
"
arc
=
"
$(
realpath
-s
"
$arc
"
)
"
tdir
=
$(
mktemp
-d
$(
pwd
)
/UXXXXXXXX
)
&&
cd
"
$tdir
"
||
fatal
tdir
=
"
$(
mktemp
-d
"
$(
pwd
)
/UXXXXXXXX"
)
"
&&
cd
"
$tdir
"
||
fatal
local
TSUBDIR
=
"
$(
basename
"
$arc
"
.
$type
|
sed
-e
's|^tar\.||'
)
"
local
TSUBDIR
=
"
$(
basename
"
$arc
"
.
$type
|
sed
-e
's|^tar\.||'
)
"
...
@@ -148,14 +148,17 @@ extract_archive()
...
@@ -148,14 +148,17 @@ extract_archive()
;;
;;
esac
esac
local
res
=
$?
cd
-
>
/dev/null
cd
-
>
/dev/null
# if only one dir in the subdir
# if only one dir in the subdir
if
[
-e
"
$(
echo
$tdir
/
*)
"
]
;
then
if
[
-e
"
$(
echo
$tdir
/
*)
"
]
;
then
mv
$tdir
/
*
.
mv
"
$tdir
"
/
*
.
rmdir
$tdir
rmdir
"
$tdir
"
else
else
mv
$tdir
"
$TSUBDIR
"
mv
"
$tdir
"
"
$TSUBDIR
"
fi
fi
return
$res
}
}
list_archive
()
list_archive
()
...
@@ -210,6 +213,19 @@ test_archive()
...
@@ -210,6 +213,19 @@ test_archive()
}
}
__repack_zip_tar
()
{
sfile
=
"
$(
realpath
-s
"
$1
"
)
"
dfile
=
"
$(
realpath
-s
"
$2
"
)
"
ddir
=
"
$(
dirname
"
$dfile
"
)
"
tdir
=
"
$(
mktemp
-d
"
$ddir
/UXXXXXXXX"
)
"
&&
cd
"
$tdir
"
||
fatal
trap
"rm -fr
$tdir
"
EXIT
extract_archive
"
$sfile
"
||
fatal
create_archive
"
$dfile
"
"."
#cd - >/dev/null
#rm -fr "$tdir"
}
repack_archive
()
repack_archive
()
{
{
if
have_patool
;
then
if
have_patool
;
then
...
@@ -231,8 +247,11 @@ repack_archive()
...
@@ -231,8 +247,11 @@ repack_archive()
tar.
*
-tar
.
*
)
tar.
*
-tar
.
*
)
docmd
$HAVE_7Z
x
-so
"
$1
"
|
$HAVE_7Z
a
-si
"
$2
"
docmd
$HAVE_7Z
x
-so
"
$1
"
|
$HAVE_7Z
a
-si
"
$2
"
;;
;;
zip-tar
)
__repack_zip_tar
"
$1
"
"
$2
"
;;
*
)
*
)
fatal
"Not yet supported repack
of
$ftype
-
$ttype
archives in 7z mode (try install patool)"
fatal
"Not yet supported repack
$ftype
to
$ttype
archives in 7z mode (try install patool)"
;;
;;
esac
esac
...
@@ -263,7 +282,7 @@ $(get_help HELPOPT)
...
@@ -263,7 +282,7 @@ $(get_help HELPOPT)
print_version
()
print_version
()
{
{
echo
"Etersoft archive manager version @VERSION@"
echo
"Etersoft archive manager version @VERSION@"
echo
"Copyright (c) Etersoft 2013-202
3
"
echo
"Copyright (c) Etersoft 2013-202
5
"
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
echo
"This program may be freely redistributed under the terms of the GNU AGPLv3."
}
}
...
@@ -410,7 +429,7 @@ case $cmd in
...
@@ -410,7 +429,7 @@ case $cmd in
exit
exit
fi
fi
# add support for target zip:
# add support for target
like
zip:
for
i
in
"
$@
"
;
do
for
i
in
"
$@
"
;
do
[
"
$i
"
=
"
$lastarg
"
]
&&
continue
[
"
$i
"
=
"
$lastarg
"
]
&&
continue
target
=
"
$(
build_target_name
"
$i
"
"
$lastarg
"
)
"
target
=
"
$(
build_target_name
"
$i
"
"
$lastarg
"
)
"
...
...
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