Hello community,
here is the log from the commit of package yast2-core
checked in at Fri Sep 12 01:55:19 CEST 2008.
--------
--- yast2-core/yast2-core.changes 2008-09-05 14:00:02.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-core/yast2-core.changes 2008-09-10 16:07:12.100687000 +0200
@@ -1,0 +2,11 @@
+Tue Sep 9 15:49:07 CEST 2008 - visnov@suse.cz
+
+- Added y2useritem and y2usernote builtins for user-level
+ action log (Fate #100386)
+
+-------------------------------------------------------------------
+Tue Sep 9 11:39:07 CEST 2008 - locilka@suse.cz
+
+- Adjusted STDOUT in ycp.pm to use 'utf8'.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-core.spec ++++++
--- /var/tmp/diff_new_pack.X31261/_old 2008-09-12 01:55:09.000000000 +0200
+++ /var/tmp/diff_new_pack.X31261/_new 2008-09-12 01:55:09.000000000 +0200
@@ -20,7 +20,7 @@
Name: yast2-core
Version: 2.17.10
-Release: 1
+Release: 6
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -177,7 +177,13 @@
%doc %{prefix}/share/doc/packages/yast2-core
%doc %{_datadir}/doc/yastdoc
/usr/share/YaST2/data/devtools/bin/generateYCPWrappers
+
%changelog
+* Tue Sep 09 2008 visnov@suse.cz
+- Added y2useritem and y2usernote builtins for user-level
+ action log (Fate #100386)
+* Tue Sep 09 2008 locilka@suse.cz
+- Adjusted STDOUT in ycp.pm to use 'utf8'.
* Fri Sep 05 2008 locilka@suse.cz
- Added WFM::ClientExists function (needed for installation).
- 2.17.10
++++++ yast2-core-2.17.10.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/agents-perl/lib/ycp.pm new/yast2-core-2.17.10/agents-perl/lib/ycp.pm
--- old/yast2-core-2.17.10/agents-perl/lib/ycp.pm 2008-05-15 17:03:03.000000000 +0200
+++ new/yast2-core-2.17.10/agents-perl/lib/ycp.pm 2008-09-09 14:21:41.000000000 +0200
@@ -18,7 +18,7 @@
# Purpose: Call a perl script within a YCP script
#
#----------------------------------------------------------------------
-# $Id: ycp.pm 32969 2006-09-19 12:21:30Z mvidner $
+# $Id: ycp.pm 50880 2008-09-09 09:45:29Z locilka $
package ycp;
@@ -79,6 +79,9 @@
use Time::localtime;
use Sys::Hostname;
+# needed for printing character (>255)
+binmode STDOUT, ':utf8';
+
@ISA = qw(Exporter);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/configure new/yast2-core-2.17.10/configure
--- old/yast2-core-2.17.10/configure 2008-09-05 14:00:31.000000000 +0200
+++ new/yast2-core-2.17.10/configure 2008-09-04 12:54:00.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-core 2.17.10.
+# Generated by GNU Autoconf 2.61 for yast2-core 2.17.9.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -728,8 +728,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-core'
PACKAGE_TARNAME='yast2-core'
-PACKAGE_VERSION='2.17.10'
-PACKAGE_STRING='yast2-core 2.17.10'
+PACKAGE_VERSION='2.17.9'
+PACKAGE_STRING='yast2-core 2.17.9'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1472,7 +1472,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-core 2.17.10 to adapt to many kinds of systems.
+\`configure' configures yast2-core 2.17.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1543,7 +1543,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-core 2.17.10:";;
+ short | recursive ) echo "Configuration of yast2-core 2.17.9:";;
esac
cat <<\_ACEOF
@@ -1660,7 +1660,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-core configure 2.17.10
+yast2-core configure 2.17.9
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1674,7 +1674,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-core $as_me 2.17.10, which was
+It was created by yast2-core $as_me 2.17.9, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2495,7 +2495,7 @@
# Define the identity of the package.
PACKAGE='yast2-core'
- VERSION='2.17.10'
+ VERSION='2.17.9'
cat >>confdefs.h <<_ACEOF
@@ -2723,7 +2723,7 @@
-VERSION="2.17.10"
+VERSION="2.17.9"
RPMNAME="yast2-core"
MAINTAINER="Martin Vidner "
@@ -24383,7 +24383,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-core $as_me 2.17.10, which was
+This file was extended by yast2-core $as_me 2.17.9, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -24436,7 +24436,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-core config.status 2.17.10
+yast2-core config.status 2.17.9
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/configure.in new/yast2-core-2.17.10/configure.in
--- old/yast2-core-2.17.10/configure.in 2008-09-05 14:00:23.000000000 +0200
+++ new/yast2-core-2.17.10/configure.in 2008-09-04 12:53:43.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-core, 2.17.10, http://bugs.opensuse.org/, yast2-core)
+AC_INIT(yast2-core, 2.17.9, http://bugs.opensuse.org/, yast2-core)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.17.10"
+VERSION="2.17.9"
RPMNAME="yast2-core"
MAINTAINER="Martin Vidner "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.am new/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.am
--- old/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.am 2008-05-15 17:03:24.000000000 +0200
+++ new/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.am 2008-09-09 15:23:14.000000000 +0200
@@ -19,7 +19,8 @@
Y2SLog.h \
miniini.h \
stringutil.h \
- y2log.h
+ y2log.h \
+ y2changes.h
#<INSTALL-HEADER-TARGET>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.in new/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.in
--- old/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.in 2008-09-05 14:00:38.000000000 +0200
+++ new/yast2-core-2.17.10/liby2util-r/src/include/y2util/Makefile.in 2008-09-09 15:35:52.000000000 +0200
@@ -246,7 +246,8 @@
Y2SLog.h \
miniini.h \
stringutil.h \
- y2log.h
+ y2log.h \
+ y2changes.h
all: all-am
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/include/y2util/y2changes.h new/yast2-core-2.17.10/liby2util-r/src/include/y2util/y2changes.h
--- old/yast2-core-2.17.10/liby2util-r/src/include/y2util/y2changes.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-core-2.17.10/liby2util-r/src/include/y2util/y2changes.h 2008-09-09 15:46:39.000000000 +0200
@@ -0,0 +1,33 @@
+/* y2changes.h
+ *
+ * YaST2: Core system
+ *
+ * YaST2 user-level logging implementation
+ *
+ * Authors: Mathias Kettner
+ * Michal Svec
+ * Stanislav Visnovsky
+ */
+
+#ifndef _y2changes_h
+#define _y2changes_h
+
+#include <string>
+#include
+
+using std::string;
+
+/* Logging functions */
+
+enum logcategory_t {
+ CHANGES_ITEM = 0, // system view, typically execution of a file
+ CHANGES_NOTE = 1, // additional information for the user, e.g. start of a module
+};
+
+// Implements y2changes_function
+void y2changes_function (logcategory_t category, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+
+#define y2useritem(format, args...) y2changes_function(CHANGES_ITEM, format,##args)
+#define y2usernote(format, args...) y2changes_function(CHANGES_NOTE, format,##args)
+
+#endif /* _y2changes_h */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/Makefile.am new/yast2-core-2.17.10/liby2util-r/src/Makefile.am
--- old/yast2-core-2.17.10/liby2util-r/src/Makefile.am 2008-05-15 17:03:24.000000000 +0200
+++ new/yast2-core-2.17.10/liby2util-r/src/Makefile.am 2008-09-09 14:50:45.000000000 +0200
@@ -22,7 +22,8 @@
Y2SLog.cc \
miniini.cc \
stringutil.cc \
- y2log.cc
+ y2log.cc \
+ y2changes.cc
liby2util_la_LDFLAGS = -version-info 4:0:0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/Makefile.in new/yast2-core-2.17.10/liby2util-r/src/Makefile.in
--- old/yast2-core-2.17.10/liby2util-r/src/Makefile.in 2008-09-05 14:00:38.000000000 +0200
+++ new/yast2-core-2.17.10/liby2util-r/src/Makefile.in 2008-09-09 14:50:50.000000000 +0200
@@ -58,7 +58,7 @@
liby2util_la_DEPENDENCIES =
am_liby2util_la_OBJECTS = ExternalDataSource.lo ExternalProgram.lo \
MemUsage.lo PathInfo.lo Pathname.lo Rep.lo Y2SLog.lo \
- miniini.lo stringutil.lo y2log.lo
+ miniini.lo stringutil.lo y2log.lo y2changes.lo
liby2util_la_OBJECTS = $(am_liby2util_la_OBJECTS)
liby2util_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
@@ -275,7 +275,8 @@
Y2SLog.cc \
miniini.cc \
stringutil.cc \
- y2log.cc
+ y2log.cc \
+ y2changes.cc
liby2util_la_LDFLAGS = -version-info 4:0:0
liby2util_la_LIBADD = -lutil
@@ -357,6 +358,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Y2SLog.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miniini.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringutil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y2changes.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y2log.Plo@am__quote@
.cc.o:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/liby2util-r/src/y2changes.cc new/yast2-core-2.17.10/liby2util-r/src/y2changes.cc
--- old/yast2-core-2.17.10/liby2util-r/src/y2changes.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-core-2.17.10/liby2util-r/src/y2changes.cc 2008-09-09 15:48:48.000000000 +0200
@@ -0,0 +1,306 @@
+/* y2changes.cc
+ *
+ * YaST2: Core system
+ *
+ * YaST2 user-level logging implementation (based on y2log.cc)
+ *
+ * Authors: Mathias Kettner
+ * Thomas Roelz
+ * Michal Svec
+ * Arvin Schnell
+ * Martin Vidner
+ * Stanislav Visnovsky
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include <limits>
+#include <list>
+
+#include "y2util/y2changes.h"
+#include "y2util/stringutil.h"
+#include "y2util/PathInfo.h"
+#include
+
+/* Defines */
+
+#define _GNU_SOURCE 1 /* Needed for vasprintf below */
+
+#define Y2CHANGES_DATE "%Y-%m-%d %H:%M:%S" /* The date format */
+
+// 1 timestamp, 2 level, 3 hostname
+#define Y2CHANGES_FORMAT "%s <%s> %s "
+// 1 level, 2 common part
+#define Y2CHANGES_SYSLOG "<%d>%s "
+
+#define Y2CHANGES_MAXSIZE 10* 1024 * 1024 /* Maximal logfile size */
+#define Y2CHANGES_MAXNUM 10 /* Maximum logfiles number */
+
+#define LOGDIR "/var/log/YaST2"
+
+#define Y2CHANGES_ROOT LOGDIR "/y2changes"
+#define Y2CHANGES_USER "/.y2changes" /* Relative to $HOME */
+#define Y2CHANGES_FALLBACK "/y2changes"
+
+#define Y2CHANGES_VAR_SIZE "Y2MAXLOGSIZE"
+#define Y2CHANGES_VAR_NUM "Y2MAXLOGNUM"
+
+#define Y2CHANGES_FACILITY "yast2"
+
+static bool did_set_logname = false;
+
+static const char *logname;
+
+static off_t maxlogsize;
+static int maxlognum;
+
+static bool log_to_file = true;
+static bool log_to_syslog = false;
+
+static FILE *Y2CHANGES_STDERR = stderr; /* Default output */
+
+/* static prototypes */
+static void do_log_syslog( const char* logmessage );
+static void do_log_yast( const char* logmessage );
+static void shift_log_files(string filename);
+
+static const char *log_messages[] = {
+ "item",
+ "note",
+};
+
+/**
+ * y2changes must use a private copy of stderr, esp. in case we're always logging
+ * to it (option "-l -"). Some classes like liby2(ExternalProgram) redirect
+ * stderr in order to redirect an external programs error output. As a side
+ * effect Y2CHANGES output done after the redirection would show up in the external
+ * programs output file instead of yast2's stderr.
+ */
+static int dup_stderr()
+{
+ int dupstderr = dup( 2 );
+ if ( dupstderr != -1 ) {
+ FILE * newstderr = fdopen( dupstderr, "a" );
+
+ if ( newstderr == NULL ) {
+ fprintf( Y2CHANGES_STDERR, "y2log: Can't fdopen new stderr: %s.\n", strerror (errno) );
+ }
+ else {
+ fcntl (fileno (newstderr), F_SETFD, fcntl (fileno (newstderr), F_GETFD) | FD_CLOEXEC);
+ Y2CHANGES_STDERR = newstderr;
+ }
+ }
+ else {
+ fprintf( Y2CHANGES_STDERR, "y2log: Can't dup stderr: %s.\n", strerror (errno) );
+ }
+ return 1;
+}
+static int variable_not_used = dup_stderr();
+
+static FILE * open_logfile()
+{
+ FILE *logfile = Y2CHANGES_STDERR;
+ if (*logname != '-') {
+ logfile = fopen (logname, "a");
+ // try creating the directory if it may be missing
+ if (!logfile && errno == ENOENT) {
+ PathInfo::assert_dir (Pathname::dirname(logname), 0700);
+ // and retry
+ logfile = fopen (logname, "a");
+ }
+ if (!logfile) {
+ fprintf (Y2CHANGES_STDERR, "y2log: Error opening logfile '%s': %s.\n",
+ logname, strerror (errno));
+ return NULL;
+ }
+ }
+ return logfile;
+}
+
+string y2_changesfmt_prefix (logcategory_t category)
+{
+ /* Prepare the host name */
+ char hostname[1024];
+ if (gethostname(hostname, 1024))
+ strncpy(hostname, "unknown", 1024);
+
+ // just 1 second precision
+ time_t timestamp = time (NULL);
+ struct tm *brokentime = localtime (×tamp);
+ char date[50]; // that's big enough
+ strftime (date, sizeof (date), Y2CHANGES_DATE, brokentime);
+
+ char * result_c = NULL;
+ asprintf (&result_c, Y2CHANGES_FORMAT, date, log_messages[category], hostname );
+ string result = result_c;
+ free (result_c);
+
+ return result;
+}
+
+/**
+ * The universal logger function
+ */
+void y2changes_function (logcategory_t category, const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+
+ /* Prepare the log text */
+ char *logtext = NULL;
+ vasprintf(&logtext, format, ap); /* GNU extension needs the define above */
+ string common = logtext;
+ common += '\n';
+ free (logtext);
+
+ if(log_to_syslog) {
+ syslog (LOG_NOTICE, Y2CHANGES_SYSLOG, category, common.c_str ());
+ }
+
+ if(log_to_file) {
+ string tolog = y2_changesfmt_prefix (category) + common;
+ do_log_yast (tolog.c_str ());
+ }
+
+ va_end(ap);
+}
+
+
+static
+void do_log_syslog( const char* logmessage )
+{
+ syslog (LOG_NOTICE, "%s", logmessage);
+}
+
+/**
+ * Logfile name initialization
+ */
+static void set_log_filename (string fname)
+{
+ did_set_logname = true;
+
+ if(log_to_syslog) openlog("yast2", LOG_PID, LOG_DAEMON);
+ if(!log_to_file) return;
+
+ struct passwd *pw = getpwuid( geteuid() );
+ const char *filename = fname.c_str();
+
+ char *env_maxlogsize = getenv(Y2CHANGES_VAR_SIZE);
+ if ( env_maxlogsize ) {
+ stringutil::strtonum( env_maxlogsize, maxlogsize );
+ // prevent overflow (#156149)
+ const off_t limit = std::numeric_limits::max();
+ const off_t limit_k = limit / 1024;
+ if (maxlogsize <= limit_k)
+ maxlogsize *= 1024;
+ else
+ maxlogsize = limit;
+ } else
+ maxlogsize = Y2CHANGES_MAXSIZE;
+
+ char *env_maxlognum = getenv(Y2CHANGES_VAR_NUM);
+ maxlognum = env_maxlognum ? atoi(env_maxlognum) : Y2CHANGES_MAXNUM;
+
+ /* Assign logfile name */
+
+ if ((filename == 0) || (*filename == 0))
+ { /* No filename --> use defaults */
+ if (geteuid()) { /* Non root */
+ if (!pw)
+ {
+ fprintf( Y2CHANGES_STDERR,
+ "Cannot read pwd entry of user id %d. Logfile will be '%s'.\n",
+ geteuid(), Y2CHANGES_FALLBACK );
+
+ logname = Y2CHANGES_FALLBACK;
+ }
+ else
+ {
+ // never freed
+ char * my_logname = (char *)malloc (strlen (pw->pw_dir) + strlen (Y2CHANGES_USER) + 1);
+ strcpy (my_logname, pw->pw_dir);
+ logname = strcat (my_logname, Y2CHANGES_USER);
+ }
+ }
+ else /* Root */
+ logname = Y2CHANGES_ROOT;
+ }
+ else
+ logname = strdup (filename); /* Explicit assignment */
+}
+
+
+static
+void do_log_yast( const char* logmessage )
+{
+ /* Prepare the logfile name */
+ if(!did_set_logname) set_log_filename("");
+
+ /* Prepare the logfile */
+ shift_log_files (string (logname));
+
+ FILE *logfile = open_logfile ();
+ if (!logfile)
+ return;
+
+ fprintf (logfile, "%s", logmessage);
+
+ /* Clean everything */
+ if (logfile && logfile != Y2CHANGES_STDERR)
+ fclose (logfile);
+ else
+ fflush (logfile);
+}
+
+static string old (const string & filename, int i, const char * suffix) {
+ char numbuf[8];
+ sprintf (numbuf, "%d", i);
+ return filename + "-" + numbuf + suffix;
+}
+
+/**
+ * Maintain logfiles
+ * We do all of this ourselves because during the installation
+ * logrotate does not run
+ */
+static void shift_log_files(string filename)
+{
+ struct stat buf;
+
+ if( stat(filename.c_str(), &buf) )
+ return;
+
+ if( buf.st_size <= maxlogsize )
+ return;
+
+ static const char * gz = ".gz";
+ // Delete the last logfile
+ remove (old (filename, maxlognum - 1, "" ).c_str());
+ remove (old (filename, maxlognum - 1, gz).c_str());
+
+ // rename existing ones
+ for( int f = maxlognum-2; f > 0; f-- )
+ {
+ rename (old (filename, f, "").c_str(), old (filename, f+1, "").c_str());
+ rename (old (filename, f, gz).c_str(), old (filename, f+1, gz).c_str());
+ }
+
+ // rename and compress first one
+ rename( filename.c_str(), old (filename, 1, "").c_str() );
+ // fate#300637: compress!
+ // may fail, but so what
+ system( ("nice -n 20 gzip " + old (filename, 1, "") + " &").c_str());
+}
+
+
+/* EOF */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-core-2.17.10/libycp/src/YCPBuiltinMisc.cc new/yast2-core-2.17.10/libycp/src/YCPBuiltinMisc.cc
--- old/yast2-core-2.17.10/libycp/src/YCPBuiltinMisc.cc 2008-08-27 12:12:30.000000000 +0200
+++ new/yast2-core-2.17.10/libycp/src/YCPBuiltinMisc.cc 2008-09-09 15:35:02.000000000 +0200
@@ -35,6 +35,7 @@
#include "ycp/StaticDeclaration.h"
#include "ycp/y2log.h"
+#include "y2util/y2changes.h"
#include "ycp/ExecutionEnvironment.h"
extern StaticDeclaration static_declarations;
@@ -614,6 +615,64 @@
}
+static YCPValue
+Y2UserItem (const YCPString & format, const YCPList & args)
+{
+ /**
+ * @builtin y2useritem
+ * @short Log an user-level system message to the y2changes
+ *
+ * @param string FORMAT
+ * @param any PAR1
+ * @param any PAR2
+ * @param any ...
+ * @return void
+ * @see sformat
+ *
+ * @usage y2useritem("Executing reboot")
+ */
+
+ YCPString arg = s_sformat (format, args);
+ if (arg.isNull () || !arg->isString ())
+ {
+ return YCPNull ();
+ }
+
+ y2useritem ("%s", arg->value().c_str());
+
+ return YCPVoid();
+}
+
+
+static YCPValue
+Y2UserNote (const YCPString & format, const YCPList & args)
+{
+ /**
+ * @builtin y2usernote
+ * @short Log an user-level addional message to the y2changes
+ *
+ * @param string FORMAT
+ * @param any PAR1
+ * @param any PAR2
+ * @param any ...
+ * @return void
+ * @see sformat
+ *
+ * @usage y2usernote("Starting module Bee")
+ */
+
+ YCPString arg = s_sformat (format, args);
+ if (arg.isNull () || !arg->isString ())
+ {
+ return YCPNull ();
+ }
+
+ y2usernote ("%s", arg->value().c_str());
+
+ return YCPVoid();
+}
+
+
YCPBuiltinMisc::YCPBuiltinMisc ()
{
// must be static, registerDeclarations saves a pointer to it!
@@ -643,6 +702,9 @@
{ "y2error", "void (integer, string, ...)", (void *)Y2FError, DECL_NIL|DECL_WILD },
{ "y2security", "void (integer, string, ...)", (void *)Y2FSecurity, DECL_NIL|DECL_WILD },
{ "y2internal", "void (integer, string, ...)", (void *)Y2FInternal, DECL_NIL|DECL_WILD },
+ // user-level logging
+ { "y2useritem", "void (string, ...)", (void *)Y2UserItem, DECL_NIL|DECL_WILD|DECL_FORMATTED },
+ { "y2usernote", "void (string, ...)", (void *)Y2UserNote, DECL_NIL|DECL_WILD|DECL_FORMATTED },
{ 0 }
};
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org