Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2013-12-13 12:01:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2013-12-05 07:18:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2013-12-13 12:01:30.000000000 +0100 @@ -1,0 +2,14 @@ +Tue Dec 10 11:40:46 UTC 2013 - [email protected] + +- bnc#851769 + - fixed reading bridge configuration + - thanks to Waldemar Spitz <[email protected]> +- 3.1.10 + +------------------------------------------------------------------- +Tue Dec 10 08:37:31 UTC 2013 - [email protected] + +- add hook file #output method +- 3.1.9 + +------------------------------------------------------------------- Old: ---- yast2-3.1.8.tar.bz2 New: ---- yast2-3.1.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.r5WGWt/_old 2013-12-13 12:01:30.000000000 +0100 +++ /var/tmp/diff_new_pack.r5WGWt/_new 2013-12-13 12:01:30.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.8 +Version: 3.1.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -27,7 +27,7 @@ BuildRequires: perl-XML-Writer BuildRequires: update-desktop-files -BuildRequires: yast2-devtools >= 3.0.6 +BuildRequires: yast2-devtools >= 3.1.10 BuildRequires: yast2-perl-bindings BuildRequires: yast2-testsuite # Needed already in build time ++++++ yast2-3.1.8.tar.bz2 -> yast2-3.1.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/VERSION new/yast2-3.1.10/VERSION --- old/yast2-3.1.8/VERSION 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/VERSION 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -3.1.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/library/general/doc/Hooks.md new/yast2-3.1.10/library/general/doc/Hooks.md --- old/yast2-3.1.8/library/general/doc/Hooks.md 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/library/general/doc/Hooks.md 2013-12-12 11:02:33.000000000 +0100 @@ -1,2 +1,114 @@ -# Detailed manual about hooks for users and customers about how to use hooks -and what they are +# Hooks + +Hooks is the recommended way of executing custom scripts in the context of +some pre-defined workflow, e.g. installation or update process. + + +## What is a hook + +Hook is an action which will be triggered at some predefined checkpoint during +some workflow. The action includes searching for files located in a specific +directory matching some patterns and executing them sequentially. + +The results of the scripts do not affect the workflow, failed script are registered +and logged as well as the succeeded ones. The author of the hook scripts should +however keep in mind that he should not make any changes to the underlying system +that could negatively impact the parent workflow. + + +## What is not a hook + +Hook is not a system extension (an add-on), but a workflow extension. A hook may be +a part of an add-on product, but should not contain logic and code intended for +the add-on. + + +## Requirements + +A hook file must meet following requirements: + +* it must be an executable file with all its dependencies satisfied +* it must follow the hook [file naming convention](#file-name-format) +* it must be an [idempotent script](#script-idempotence) that can be executed multiple times +* it must not be interactive +* it must be located in the [hook search path](#search-path) +* the code within the script must not access the X session + + +### File name format + +The hook script file name consists of 3 parts. + +The first part of the file name is derived from the events significant for the +running workflow, e.g. `installation_start`, `after_setup_dhcp` + +The second part of the file name contains two integers setting up the sequence in +which the scripts will be executed in case you have multiple scripts for a single hook. + +The third part of the file name may be arbitrarily chosen to fit the needs of +the user or admin. + +#### Example + +* `installation_start_00_do_some_things.rb` +* `after_setup_dhcp_00_ping_remote_server.sh` + + +### Script idempotence + +The author of a script code must expect the hook to be executed multiple times +during the workflow for various reasons, e.g. the UI may allow the user to go back +and forth in a wizard, or abort the process and start again. + + +### Search path + +Search path is the the workflow specific directory where the hook scripts are expected +to be stored during its runtime. In general the default search path is +`var/lib/YaST2/hooks`, but this might be altered by the underlying workflow, e.g. +installation will search for hook scripts in path `/var/lib/YaST2/hooks/installation`. + + +## Environment + +The hooks are executed with **root** privileges so it is possible to +perform any maintenance tasks. However, some workflows might you discourage to perform +any such actions as they can corrupt the specific workflow and the results +of the whole process, even if they might not visible instantly. + +### Installation environment + +Keep in mind that the search path for installation hooks `/var/lib/YaST2/hooks/installation` +is read-only. The recommended way of putting the script into the directory is using command +`mount -o bind /some/dir/with/hook/scripts /var/lib/YaST2/hook/installation` . + + +## Anatomy of hook execution + +Let us pretend we are within the installation workflow that has reached the checkpoint +`installation_finish` which means we are right before the system reboot. The workflow +will create and run the hook `installation_finish` which translates to: + +1. The hook `installation_finish` is created; log entry saved. +2. The path `/var/lib/YaST2/hooks/installation` is searched for the files matching + the pattern `installation_finish_[0-9][0-9]_*`. Search results are logged. +3. Have some files been found, they are executed sequentially by the + numbers in their name. Results are saved and logged. +4. Hook is considered as failed if one of the executed files returns non-zero exit code. +5. There will be a window displayed with list of all registered hooks with results + among with files output if any of the file failed. + + +## Debugging + +All important events are logged into the yast log located in `/var/log/YaST2/y2log`. +The installation workflow displays a pop-up at its end if some of the hook files failed. +Beside this no other information is stored for later inspection. + + +## Checkpoints + +The hooks are created and triggered at some specific events - checkpoints - +usually considered important for the workflow. If the hook finds no files in the +search path, the worfkflow process continues its job until the next checkpoint has +been reached. This will repeat for all checkpoints. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/library/general/hooks/README.md new/yast2-3.1.10/library/general/hooks/README.md --- old/yast2-3.1.8/library/general/hooks/README.md 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/library/general/hooks/README.md 2013-12-12 11:02:33.000000000 +0100 @@ -1,3 +1,12 @@ -Hooks document to be put into the directory /var/lib/YaST2/hooks -as a short reference for users and customers who might make use of hooks +# Default hook search path + +This is the default directory used by yast for searching hook scripts if not +specified otherwise by the documentation for a particular workflow using the +hooks feature. + +More information is to be found in the main readme file for hooks in +`/usr/share/doc/packages/yast2/Hooks.md` + +If you are going to make use of the installation hooks, please put you scripts +into the subdirectory `installation`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/library/general/src/modules/Hooks.rb new/yast2-3.1.10/library/general/src/modules/Hooks.rb --- old/yast2-3.1.8/library/general/src/modules/Hooks.rb 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/library/general/src/modules/Hooks.rb 2013-12-12 11:02:33.000000000 +0100 @@ -211,6 +211,14 @@ @content ||= ::File.read(path) end + def output + return '' unless result + output = [] + output << "STDERR: #{result.stderr.strip}" unless result.stderr.empty? + output << "STDOUT: #{result.stdout.strip}" unless result.stdout.empty? + output.join('; ') + end + def succeeded? result.exit.zero? end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/library/general/test/hooks_test.rb new/yast2-3.1.10/library/general/test/hooks_test.rb --- old/yast2-3.1.8/library/general/test/hooks_test.rb 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/library/general/test/hooks_test.rb 2013-12-12 11:02:33.000000000 +0100 @@ -59,10 +59,12 @@ failed_hook_file = Hooks.find('before_hook').results.first expect(failed_hook_file.exit).not_to eq(0) expect(failed_hook_file.stderr).to match(/failure/) + expect(failed_hook_file.output).to match(/failure/) succeeded_hook_file = Hooks.find('before_hook').results.last expect(succeeded_hook_file.exit).to eq(0) expect(succeeded_hook_file.stdout).to match(/success/) + expect(succeeded_hook_file.output).to match(/success/) end it "raises exception if the search path for hooks does not exist" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/library/network/src/modules/NetworkInterfaces.rb new/yast2-3.1.10/library/network/src/modules/NetworkInterfaces.rb --- old/yast2-3.1.8/library/network/src/modules/NetworkInterfaces.rb 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/library/network/src/modules/NetworkInterfaces.rb 2013-12-12 11:02:33.000000000 +0100 @@ -240,7 +240,7 @@ elsif FileUtils.Exists(Ops.add(sys_dir_path, "phy80211")) return "wlan" elsif FileUtils.Exists(Ops.add(sys_dir_path, "bridge")) - return "bridge" + return "br" elsif FileUtils.Exists(Ops.add(sys_dir_path, "bonding")) return "bond" elsif FileUtils.Exists(Ops.add(sys_dir_path, "tun_flags")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/package/yast2.changes new/yast2-3.1.10/package/yast2.changes --- old/yast2-3.1.8/package/yast2.changes 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/package/yast2.changes 2013-12-12 11:02:33.000000000 +0100 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Tue Dec 10 11:40:46 UTC 2013 - [email protected] + +- bnc#851769 + - fixed reading bridge configuration + - thanks to Waldemar Spitz <[email protected]> +- 3.1.10 + +------------------------------------------------------------------- +Tue Dec 10 08:37:31 UTC 2013 - [email protected] + +- add hook file #output method +- 3.1.9 + +------------------------------------------------------------------- Wed Dec 4 12:39:02 UTC 2013 - [email protected] - deprecate yast --install, --upgrade and --remove and use zypper diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.8/package/yast2.spec new/yast2-3.1.10/package/yast2.spec --- old/yast2-3.1.8/package/yast2.spec 2013-12-04 14:36:46.000000000 +0100 +++ new/yast2-3.1.10/package/yast2.spec 2013-12-12 11:02:33.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.8 +Version: 3.1.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -28,7 +28,7 @@ Source1: yast2-rpmlintrc BuildRequires: perl-XML-Writer update-desktop-files yast2-perl-bindings yast2-testsuite -BuildRequires: yast2-devtools >= 3.0.6 +BuildRequires: yast2-devtools >= 3.1.10 # Needed already in build time BuildRequires: yast2-core >= 2.18.12 yast2-pkg-bindings >= 2.20.3 yast2-ycp-ui-bindings >= 2.18.4 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
