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
b8c923db
Commit
b8c923db
authored
Apr 10, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update which replacement code
parent
a57a12b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
aimp.sh
play.d/aimp.sh
+1
-1
common.sh
play.d/common.sh
+27
-0
common.sh
repack.d/common.sh
+6
-5
No files found.
play.d/aimp.sh
View file @
b8c923db
...
...
@@ -8,7 +8,7 @@ DESCRIPTION="AIMP (Wine based audio player) from the official site"
pkgtype
=
"
$(
epm print info
-p
)
"
if
!
which
wine
;
then
if
!
is_command
wine
;
then
epm play wine
||
fatal
fi
...
...
play.d/common.sh
View file @
b8c923db
...
...
@@ -6,6 +6,33 @@ fatal()
exit
1
}
# print a path to the command if exists in $PATH
if
a
=
which which 2>/dev/null
>
/dev/null
;
then
# the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command
print_command_path
()
{
a
=
which
--
"
$1
"
2>/dev/null
}
elif
a
=
type
-a
type
2>/dev/null
>
/dev/null
;
then
print_command_path
()
{
a
=
type
-fpP
--
"
$1
"
2>/dev/null
}
else
print_command_path
()
{
a
=
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
}
fi
# check if <arg> is a real command
is_command
()
{
print_command_path
"
$1
"
>
/dev/null
}
eget
()
{
epm tool eget
"
$@
"
...
...
repack.d/common.sh
View file @
b8c923db
...
...
@@ -8,22 +8,22 @@ fatal()
# compatibility layer
# print a path to the command if exists in $PATH
if
which which 2>/dev/null
>
/dev/null
;
then
if
a
=
which which 2>/dev/null
>
/dev/null
;
then
# the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command
print_command_path
()
{
which
--
"
$1
"
2>/dev/null
a
=
which
--
"
$1
"
2>/dev/null
}
elif
type
-a
type
2>/dev/null
>
/dev/null
;
then
elif
a
=
type
-a
type
2>/dev/null
>
/dev/null
;
then
print_command_path
()
{
type
-fpP
--
"
$1
"
2>/dev/null
a
=
type
-fpP
--
"
$1
"
2>/dev/null
}
else
print_command_path
()
{
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
a
=
type
"
$1
"
2>/dev/null |
sed
-e
's|.* /|/|'
}
fi
...
...
@@ -33,6 +33,7 @@ is_command()
print_command_path
"
$1
"
>
/dev/null
}
# compatibility layer
# add realpath if missed
...
...
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