diff --git a/package/yast2.spec b/package/yast2.spec index 8909b6578..4b4091a56 100644 --- a/package/yast2.spec +++ b/package/yast2.spec @@ -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 diff --git a/scripts/yast2 b/scripts/yast2 index bb67ebb6a..ac37225d8 100755 --- a/scripts/yast2 +++ b/scripts/yast2 @@ -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 @@ -203,7 +203,7 @@ 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) @@ -211,7 +211,7 @@ chef_warning_continue () # (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 @@ -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) @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/test/test_y2dir/clients/args_test_client.rb b/test/test_y2dir/clients/args_test_client.rb index 9c3a9ea8c..71c16a368 100644 --- a/test/test_y2dir/clients/args_test_client.rb +++ b/test/test_y2dir/clients/args_test_client.rb @@ -2,5 +2,5 @@ args = Yast::WFM.Args -puts args +Yast.y2milestone args.inspect exit 66 if args != ['abc"\'\\|;&<>! ', "second"]