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
b752a4f1
Commit
b752a4f1
authored
Jun 26, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-simulate: rewrite check yum result with store_output
parent
569173ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
epm-simulate
bin/epm-simulate
+20
-12
No files found.
bin/epm-simulate
View file @
b752a4f1
...
...
@@ -31,9 +31,22 @@ __use_yum_assumeno()
a
=
yum
--help
2>&1 |
grep
-q
--
"--assumeno"
}
__check_yum_result
()
{
grep
"^No package"
$1
&&
return
1
grep
"^Complete!"
$1
&&
return
0
grep
"^Exiting on user Command"
$1
&&
return
0
grep
"^Exiting on user command"
$1
&&
return
0
# return default result by default
return
$2
}
_epm_do_simulate
()
{
local
CMD
local
RES
=
0
local
filenames
=
"
$*
"
case
$PMTYPE
in
...
...
@@ -42,20 +55,15 @@ _epm_do_simulate()
;;
yum-rpm
)
if
__use_yum_assumeno
;
then
LC_ALL
=
C sudocmd yum
--assumeno
install
$filenames
# FIXME: check only error output
LC_ALL
=
C sudocmd yum
--assumeno
install
$filenames
2>&1 |
grep
"^No package"
&&
return
1
LC_ALL
=
C sudocmd yum
--assumeno
install
$filenames
2>&1 |
grep
"^Complete!"
&&
return
0
LC_ALL
=
C sudocmd yum
--assumeno
install
$filenames
2>&1 |
grep
"^Exiting on user Command"
&&
return
0
LC_ALL
=
C sudocmd yum
--assumeno
install
$filenames
>
/dev/null 2>&1
||
return
LC_ALL
=
C store_output sudocmd yum
--assumeno
install
$filenames
__check_yum_result
$RC_STDOUT
$?
else
LC_ALL
=
C
echo
n | sudocmd yum
install
$filenames
# FIXME: check only error output
LC_ALL
=
C
echo
n | sudocmd yum
install
$filenames
2>&1 |
grep
"^No package"
&&
return
1
LC_ALL
=
C
echo
n | sudocmd yum
install
$filenames
2>&1 |
grep
"^Complete!"
&&
return
0
LC_ALL
=
C
echo
n | sudocmd yum
install
$filenames
>
/dev/null 2>&1
||
return
LC_ALL
=
C
echo
n | store_output sudocmd yum
install
$filenames
__check_yum_result
$RC_STDOUT
$?
fi
return
0
;;
RES
=
$?
clean_store_output
return
$RES
;;
urpm-rpm
)
CMD
=
"urpmi --test --auto"
;;
...
...
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