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
8e3cf250
Commit
8e3cf250
authored
Oct 24, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use isatty instead tty -s
parent
3314e4dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
epm
bin/epm
+1
-1
epm-sh-functions
bin/epm-sh-functions
+15
-5
No files found.
bin/epm
View file @
8e3cf250
...
@@ -314,7 +314,7 @@ for opt in "$@" ; do
...
@@ -314,7 +314,7 @@ for opt in "$@" ; do
done
done
# if input is not console, get pkg from it too
# if input is not console, get pkg from it too
if
!
tty
-s
;
then
if
!
isatty
;
then
for
opt
in
$(
cat
)
;
do
for
opt
in
$(
cat
)
;
do
check_filenames
$opt
check_filenames
$opt
done
done
...
...
bin/epm-sh-functions
View file @
8e3cf250
...
@@ -18,18 +18,28 @@
...
@@ -18,18 +18,28 @@
#
#
# copied from /etc/init.d/outformat (ALT Linux)
# copied from /etc/init.d/outformat (ALT Linux)
isatty
()
isatty
()
{
{
# Set a sane TERM required for tput
# check stdout
[
-n
"
$TERM
"
]
||
TERM
=
dumb
# CHECKME: use tty -s?
export
TERM
test
-t
1
}
isatty2
()
{
# check stderr
# check stderr
test
-t
2
test
-t
2
}
}
check_tty
()
check_tty
()
{
{
isatty
||
return
isatty2
||
return
# Set a sane TERM required for tput
[
-n
"
$TERM
"
]
||
TERM
=
dumb
export
TERM
which tput
>
/dev/null 2>/dev/null
||
return
which tput
>
/dev/null 2>/dev/null
||
return
# FreeBSD does not support tput -S
# FreeBSD does not support tput -S
echo
| tput
-S
>
/dev/null 2>/dev/null
||
return
echo
| tput
-S
>
/dev/null 2>/dev/null
||
return
...
@@ -230,7 +240,7 @@ set_eatmydata()
...
@@ -230,7 +240,7 @@ set_eatmydata()
# use if possible
# use if possible
which eatmydata
>
/dev/null 2>/dev/null
||
return
which eatmydata
>
/dev/null 2>/dev/null
||
return
SUDO
=
"
$SUDO
eatmydata"
SUDO
=
"
$SUDO
eatmydata"
tty
-s
&&
echo
"Uwaga! eatmydata is installed, we will use it for disable all sync operations."
>
&2
isatty
&&
echo
"Uwaga! eatmydata is installed, we will use it for disable all sync operations."
>
&2
return
0
return
0
}
}
...
...
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