Skip to content

Commit

Permalink
use y2start
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Apr 7, 2017
1 parent 2e4b6d2 commit 1a1ca34
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion package/yast2.spec
Expand Up @@ -76,7 +76,8 @@ Requires: yast2-hardware-detection
Requires: yast2-perl-bindings
# changed StartPackage callback signature
Requires: yast2-pkg-bindings >= 2.20.3
Requires: yast2-ruby-bindings >= 3.2.8
# for y2start
Requires: yast2-ruby-bindings >= 3.2.10
Requires: yast2-xml
# new UI::SetApplicationIcon
Requires: yast2-ycp-ui-bindings >= 3.1.8
Expand Down
26 changes: 16 additions & 10 deletions scripts/yast2
Expand Up @@ -56,7 +56,7 @@ mount_ok=1;
test -z `ls /proc |head -n1` && echo "The /proc filesystem is not mounted." && mount_ok=0;
test -z `ls /sys |head -n1` && echo "The /sys filesystem is not mounted." && mount_ok=0;
test -z `ls /dev |head -n1` && echo "The /dev filesystem is not mounted." && mount_ok=0;
if test $mount_ok -eq 0 ; then
if test $mount_ok -eq 0 -a -z "$TESTING_YAST2" ; then
echo "If you are running in a chroot environment, bind-mount missing filesystems.";
exit 1;
fi
Expand Down Expand Up @@ -203,15 +203,15 @@ chef_is_running ()
# return 0 if user decided to continue
chef_warning_continue ()
{
$ybindir/y2base other_tools_warning --arg chef "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS
$ybindir/y2start other_tools_warning --arg chef "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS
}

# Check if chef-client is running and warn user about it (bnc#803358)
# Returns 0 if user confirmed the conflict and wants to exit before starting YaST.
# (check for other tools (like puppet) may be added here)
other_tools_are_conflicting ()
{
# - no need to check for installation/firstboot, they are started directly with y2base
# - no need to check for installation/firstboot, they are started directly with y2start

if ! chef_is_running; then
return 1
Expand Down Expand Up @@ -290,11 +290,12 @@ fi
if [ -n "$CMDLINE_HELP" ]; then
set -- $@ help;
fi
ARGS=""
ARGS=( )
for i in "$@"; do
ARGS="$ARGS --arg `printf %q "$i"`"
ARGS+=( "--arg" )
ARGS+=( "$i" )
done
set -- $ARGS
set -- "${ARGS[@]}"

case "`basename $0`" in
YaST|yast|yast1|zast)
Expand Down Expand Up @@ -336,6 +337,10 @@ if [ -n "$DISPLAY" ]; then
select_gui_frontend
fi

if [ -n "$TESTING_YAST2" ]; then
SELECTED_GUI="UI"
fi

if [ "$SELECTED_GUI" = "ncurses" ]; then
if check_ncurses ; then
TTY=$(/usr/bin/tty)
Expand Down Expand Up @@ -376,12 +381,12 @@ if [ "$SELECTED_GUI" = "ncurses" ]; then
else
rpm -V yast2-core yast2-ncurses yast2-qt yast2-gtk >&2
echo "Something is wrong with the YaST user interface." >&2
exit_code=1 # also skips y2base later
exit_code=1 # also skips y2start later
fi
if [ -n "$DISPLAY" -a ! -t 0 ]; then
rpm -V yast2-core yast2-ncurses yast2-qt yast2-gtk >&2
echo "Something is wrong with the YaST user interface, NCurses selected but no terminal available." >&2
exit_code=1 # also skips y2base later
exit_code=1 # also skips y2start later
fi
elif [ "$SELECTED_GUI" = "qt" ]; then

Expand All @@ -393,7 +398,8 @@ elif [ "$SELECTED_GUI" = "qt" ]; then
if [ $module == "menu" ]; then
select_control_center
fi

elif [ "$SELECTED_GUI" = "UI" ]; then
echo "Testing UI only"
else
echo >&2 "Internal error, unhandled '$SELECTED_GUI'"
fi
Expand Down Expand Up @@ -425,7 +431,7 @@ else

# break out on errors, #343258
while [ $exit_code = 0 ]; do
$ybindir/y2base $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS
$ybindir/y2start $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS
exit_code=$?
if [ -z "$REDO_FILE" -o ! -f "$REDO_FILE" ]; then
break
Expand Down
2 changes: 1 addition & 1 deletion test/test_y2dir/clients/args_test_client.rb
Expand Up @@ -2,5 +2,5 @@

args = Yast::WFM.Args

puts args
Yast.y2milestone args.inspect
exit 66 if args != ['abc"\'\\|;&<>! ', "second"]

0 comments on commit 1a1ca34

Please sign in to comment.