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
3be67002
Commit
3be67002
authored
Aug 15, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools_erc: update to erc 1.1.3
parent
40db80a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
12 deletions
+47
-12
erc-sh-archive
bin/erc-sh-archive
+13
-0
tools_erc
bin/tools_erc
+34
-12
No files found.
bin/erc-sh-archive
View file @
3be67002
...
@@ -74,6 +74,8 @@ pax
...
@@ -74,6 +74,8 @@ pax
zst
zst
zstd
zstd
exe
exe
AppImage
appimage
EOF
EOF
}
}
...
@@ -155,3 +157,14 @@ get_archive_type()
...
@@ -155,3 +157,14 @@ get_archive_type()
fi
fi
return
1
return
1
}
}
extract_command
()
{
local
cmd
=
"
$1
"
local
archive
=
"
$2
"
if
is_command
tar
;
then
docmd
$cmd
"
$archive
"
else
docmd
$HAVE_7Z
x
-so
"
$archive
"
| docmd
$HAVE_7Z
x
-y
-si
-ttar
fi
}
bin/tools_erc
View file @
3be67002
...
@@ -65,6 +65,8 @@ create_archive()
...
@@ -65,6 +65,8 @@ create_archive()
;;
;;
*
)
*
)
# TODO: fix symlinks support
# TODO: fix symlinks support
# https://bugzilla.altlinux.org/49852
# FIXME: creating .tar.* (.tar.gz) is not supported
docmd
$HAVE_7Z
a
-l
"
$arc
"
"
$@
"
docmd
$HAVE_7Z
a
-l
"
$arc
"
"
$@
"
#fatal "Not yet supported creating of $type archives"
#fatal "Not yet supported creating of $type archives"
;;
;;
...
@@ -76,24 +78,49 @@ extract_archive()
...
@@ -76,24 +78,49 @@ extract_archive()
local
arc
=
"
$1
"
local
arc
=
"
$1
"
shift
shift
local type
=
"
$(
get_archive_type
"
$arc
"
)
"
[
-n
"
$type
"
]
||
fatal
"Can't recognize type of
$arc
."
# TODO: move to patool
if
[
"
$type
"
=
"exe"
]
;
then
docmd
$HAVE_7Z
x
"
$arc
"
exit
fi
if
[
"
$type
"
=
"AppImage"
]
||
[
"
$type
"
=
"appimage"
]
;
then
docmd
chmod
u+x
"
$arc
"
||
fatal
"Can't set executable permission"
docmd
"
$(
realpath
$arc
)
"
--appimage-extract
mv
squashfs-root
"
$(
basename
"
$(
basename
"
$arc
"
.AppImage
)
"
.appimage
)
"
exit
fi
if
have_patool
;
then
if
have_patool
;
then
docmd patool
$verbose
extract
"
$arc
"
"
$@
"
docmd patool
$verbose
extract
"
$arc
"
"
$@
"
return
return
fi
fi
local type
=
"
$(
get_archive_type
"
$arc
"
)
"
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
)
"
local
TSUBDIR
=
"
$(
basename
"
$arc
"
.
$type
|
sed
-e
's|^tar\.||'
)
"
case
"
$type
"
in
tar.
*
|
tgz
)
# TODO: check if there is only one file?
# TODO: check if there is only one file?
# use subdir if there is no subdir in archive
# use subdir if there is no subdir in archive
TSUBDIR
=
"
$(
basename
"
$arc
"
.
$(
echo
$type
|
sed
-e
's|^tar\.||'
)
)
"
case
"
$type
"
in
docmd
$HAVE_7Z
x
-so
"
$arc
"
| docmd
$HAVE_7Z
x
-y
-si
-ttar
tar.gz|tgz
)
is_command
gzip
||
fatal
"Could not find gzip package. Please install gzip package and retry."
extract_command
"tar -xhzf"
"
$arc
"
;;
tar.xz|txz|tar.lzma
)
is_command xz
||
fatal
"Could not find xz package. Please install xz package and retry."
extract_command
"tar -xhJf"
"
$arc
"
;;
tar.zst
)
is_command zstd
||
fatal
"Could not find zstd package. Please install zstd package and retry."
extract_command
"tar -I zstd -xhf"
"
$arc
"
;;
tar
)
extract_command
"tar -xhf"
"
$arc
"
;;
;;
*
)
*
)
docmd
$HAVE_7Z
x
-y
"
$arc
"
"
$@
"
docmd
$HAVE_7Z
x
-y
"
$arc
"
"
$@
"
...
@@ -325,11 +352,6 @@ case $cmd in
...
@@ -325,11 +352,6 @@ case $cmd in
create_archive
"
$target
"
"
$@
"
create_archive
"
$target
"
"
$@
"
;;
;;
e|x|-e|-x|u|-u|extract|unpack
)
# HELPCMD: extract files from archive
e|x|-e|-x|u|-u|extract|unpack
)
# HELPCMD: extract files from archive
# TODO: move to patool
if
[
"
$(
get_archive_type
"
$1
"
2>/dev/null
)
"
=
"exe"
]
;
then
docmd
$HAVE_7Z
x
"
$1
"
exit
fi
extract_archive
"
$@
"
extract_archive
"
$@
"
;;
;;
# TODO: implement deletion
# TODO: implement deletion
...
...
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