YaST Commits
Threads by month
- ----- 2024 -----
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
January 2009
- 24 participants
- 819 discussions
[yast-commit] r55135 - /trunk/storage/package/yast2-storage.changes
by aschnell@svn.opensuse.org 29 Jan '09
by aschnell@svn.opensuse.org 29 Jan '09
29 Jan '09
Author: aschnell
Date: Thu Jan 29 10:33:17 2009
New Revision: 55135
URL: http://svn.opensuse.org/viewcvs/yast?rev=55135&view=rev
Log:
- fixed ordering
Modified:
trunk/storage/package/yast2-storage.changes
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Jan 29 10:33:17 2009
@@ -6,7 +6,6 @@
- 2.18.2
-------------------------------------------------------------------
-
Mon Jan 26 12:22:36 CET 2009 - aschnell(a)suse.de
- fixed udev partition postfix for dm based devices (bnc #468786)
@@ -44,20 +43,6 @@
- redesigned resize dialog (bnc #456816 and #456816)
-------------------------------------------------------------------
-Tue Dec 16 17:12:18 CET 2008 - aschnell(a)suse.de
-
-- escape HTML tags (bnc #450496)
-- replaced getCommitActions and getCommitInfo by getCommitInfos
-
--------------------------------------------------------------------
-Mon Dec 15 14:19:57 CET 2008 - aschnell(a)suse.de
-
-- fixed typo (bnc #450455)
-- removed outdated text (bnc #450792)
-- removed obsolete inst_do_resize.ycp
-- 2.18.0
-
--------------------------------------------------------------------
Fri Dec 19 11:50:11 CET 2008 - aschnell(a)suse.de
- don't check swap partitions on disks used by BIOS RAID or
@@ -80,6 +65,12 @@
Points" (bnc #453746)
-------------------------------------------------------------------
+Tue Dec 16 17:12:18 CET 2008 - aschnell(a)suse.de
+
+- escape HTML tags (bnc #450496)
+- replaced getCommitActions and getCommitInfo by getCommitInfos
+
+-------------------------------------------------------------------
Tue Dec 16 10:40:10 CET 2008 - aschnell(a)suse.de
- start yast2-multipath in running system if available (bnc
@@ -87,6 +78,14 @@
- fixed popup message (bnc #458972)
-------------------------------------------------------------------
+Mon Dec 15 14:19:57 CET 2008 - aschnell(a)suse.de
+
+- fixed typo (bnc #450455)
+- removed outdated text (bnc #450792)
+- removed obsolete inst_do_resize.ycp
+- 2.18.0
+
+-------------------------------------------------------------------
Thu Dec 11 16:37:11 CET 2008 - aschnell(a)suse.de
- fixed reading of udev links for cciss devices (bnc #449110)
@@ -5062,4 +5061,3 @@
- initial version
--------------------------------------------------------------------
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55134 - /tags/branch-Code-11-2_17_53/bootloader/
by juhliarik@svn.opensuse.org 29 Jan '09
by juhliarik@svn.opensuse.org 29 Jan '09
29 Jan '09
Author: juhliarik
Date: Thu Jan 29 10:22:02 2009
New Revision: 55134
URL: http://svn.opensuse.org/viewcvs/yast?rev=55134&view=rev
Log:
Created tag branch-Code-11-2_17_53 for bootloader
Added:
tags/branch-Code-11-2_17_53/bootloader/
- copied from r55133, branches/SuSE-Code-11-Branch/bootloader/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55133 - in /branches/SuSE-Code-11-Branch/bootloader: VERSION package/yast2-bootloader.changes src/generic/sections_widget.ycp
by juhliarik@svn.opensuse.org 29 Jan '09
by juhliarik@svn.opensuse.org 29 Jan '09
29 Jan '09
Author: juhliarik
Date: Thu Jan 29 10:19:34 2009
New Revision: 55133
URL: http://svn.opensuse.org/viewcvs/yast?rev=55133&view=rev
Log:
added fix for using translated text for Image, Other
Modified:
branches/SuSE-Code-11-Branch/bootloader/VERSION
branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
branches/SuSE-Code-11-Branch/bootloader/src/generic/sections_widget.ycp
Modified: branches/SuSE-Code-11-Branch/bootloader/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloade…
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/VERSION (original)
+++ branches/SuSE-Code-11-Branch/bootloader/VERSION Thu Jan 29 10:19:34 2009
@@ -1 +1 @@
-2.17.52
+2.17.53
Modified: branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloade…
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes (original)
+++ branches/SuSE-Code-11-Branch/bootloader/package/yast2-bootloader.changes Thu Jan 29 10:19:34 2009
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jan 29 10:08:57 CET 2009 - fero(a)suse.cz
+
+- added fix for using translated text in bootloader e.g. Image,
+ Other (bug #445999)
+- 2.17.53
+
+-------------------------------------------------------------------
Tue Jan 27 17:14:25 CET 2009 - juhliarik(a)suse.cz
- added fix for problem with adding boot entry to EFI if
Modified: branches/SuSE-Code-11-Branch/bootloader/src/generic/sections_widget.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/bootloade…
==============================================================================
--- branches/SuSE-Code-11-Branch/bootloader/src/generic/sections_widget.ycp (original)
+++ branches/SuSE-Code-11-Branch/bootloader/src/generic/sections_widget.ycp Thu Jan 29 10:19:34 2009
@@ -81,13 +81,13 @@
),
", "
);
- // Upcase word 'type'
- type = toupper(substring(type,0,1)) + substring(type,1);
return `item (`id (name),
BootCommon::globals["default"]:"" == name ? UI::Glyph (`CheckMark) : "",
name,
- type,
+ (type == "image")
+ ? _("Image")
+ : _("Other"),
summary
);
});
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55132 - in /branches/tmp/lslezak/core: ./ agent-any/doc/ agent-dummy/doc/ agent-dummy/testsuite/ agent-ini/doc/ agent-modules/doc/ agent-process/doc/ agent-process/src/ agent-process/testsuite/lib...
by lslezak@svn.opensuse.org 29 Jan '09
by lslezak@svn.opensuse.org 29 Jan '09
29 Jan '09
Author: lslezak
Date: Thu Jan 29 08:58:52 2009
New Revision: 55132
URL: http://svn.opensuse.org/viewcvs/yast?rev=55132&view=rev
Log:
- merge - update the base to r55131 from trunk
Added:
branches/tmp/lslezak/core/base/tools/tty_wrapper/ (props changed)
- copied from r55131, trunk/core/base/tools/tty_wrapper/
branches/tmp/lslezak/core/base/tools/tty_wrapper/Makefile.am
- copied unchanged from r55131, trunk/core/base/tools/tty_wrapper/Makefile.am
branches/tmp/lslezak/core/base/tools/tty_wrapper/tty_wrapper.cc
- copied unchanged from r55131, trunk/core/base/tools/tty_wrapper/tty_wrapper.cc
branches/tmp/lslezak/core/dbus/SCR_service/org.opensuse.yast.scr.policy
- copied unchanged from r55131, trunk/core/dbus/SCR_service/org.opensuse.yast.scr.policy
branches/tmp/lslezak/core/liby2/src/include/y2/exitcodes.h
- copied unchanged from r55131, trunk/core/liby2/src/include/y2/exitcodes.h
branches/tmp/lslezak/core/liby2util-r/src/include/y2util/y2changes.h
- copied unchanged from r55131, trunk/core/liby2util-r/src/include/y2util/y2changes.h
branches/tmp/lslezak/core/liby2util-r/src/y2changes.cc
- copied unchanged from r55131, trunk/core/liby2util-r/src/y2changes.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinMultiset.cc
- copied unchanged from r55131, trunk/core/libycp/src/YCPBuiltinMultiset.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinSymbol.cc
- copied unchanged from r55131, trunk/core/libycp/src/YCPBuiltinSymbol.cc
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPBuiltinMultiset.h
- copied unchanged from r55131, trunk/core/libycp/src/include/ycp/YCPBuiltinMultiset.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPBuiltinSymbol.h
- copied unchanged from r55131, trunk/core/libycp/src/include/ycp/YCPBuiltinSymbol.h
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Multiset.err
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Multiset.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Multiset.out
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Multiset.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Multiset.ycp
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Multiset.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Symbol.err
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Symbol.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Symbol.out
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Symbol.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Symbol.ycp
- copied unchanged from r55131, trunk/core/libycp/testsuite/tests/builtin/Builtin-Symbol.ycp
Removed:
branches/tmp/lslezak/core/liby2/doc/Y2-access.html.in
branches/tmp/lslezak/core/liby2/doc/Y2-components.html.in
branches/tmp/lslezak/core/liby2/doc/Y2-overview.html
branches/tmp/lslezak/core/liby2/doc/componentbroker.txt
branches/tmp/lslezak/core/liby2/doc/interface.txt
Modified:
branches/tmp/lslezak/core/ (props changed)
branches/tmp/lslezak/core/SUBDIRS
branches/tmp/lslezak/core/VERSION
branches/tmp/lslezak/core/agent-any/doc/ag_anyagent.html (props changed)
branches/tmp/lslezak/core/agent-dummy/doc/ag_dummy.html (props changed)
branches/tmp/lslezak/core/agent-dummy/testsuite/Makefile.am
branches/tmp/lslezak/core/agent-ini/doc/ag_ini.html (props changed)
branches/tmp/lslezak/core/agent-modules/doc/ag_modules.html (props changed)
branches/tmp/lslezak/core/agent-process/doc/ag_process.html (props changed)
branches/tmp/lslezak/core/agent-process/src/Process.cc
branches/tmp/lslezak/core/agent-process/src/Process.h
branches/tmp/lslezak/core/agent-process/testsuite/lib/ag_process_init.exp
branches/tmp/lslezak/core/agent-resolver/doc/ag_resolver.html (props changed)
branches/tmp/lslezak/core/agent-system/src/SystemAgent.cc
branches/tmp/lslezak/core/agents-perl/doc/ag_modinfo.html (props changed)
branches/tmp/lslezak/core/agents-perl/doc/ag_yp_makefile.html (props changed)
branches/tmp/lslezak/core/agents-perl/lib/ycp.pm
branches/tmp/lslezak/core/autodocs/Makefile.am
branches/tmp/lslezak/core/base/src/Makefile.am
branches/tmp/lslezak/core/base/tools/Makefile.am
branches/tmp/lslezak/core/base/tools/ycpc/Makefile.am
branches/tmp/lslezak/core/configure.in.in
branches/tmp/lslezak/core/dbus/SCR_service/ (props changed)
branches/tmp/lslezak/core/dbus/SCR_service/DBusServer.cc
branches/tmp/lslezak/core/dbus/SCR_service/Makefile.am
branches/tmp/lslezak/core/dbus/SCR_service/org.opensuse.yast.SCR.conf.in
branches/tmp/lslezak/core/libscr/src/SCR.cc
branches/tmp/lslezak/core/libscr/testsuite/Makefile.am
branches/tmp/lslezak/core/liby2/Makefile.am
branches/tmp/lslezak/core/liby2/doc/Makefile.am
branches/tmp/lslezak/core/liby2/src/genericfrontend.cc
branches/tmp/lslezak/core/liby2/src/include/Y2.h
branches/tmp/lslezak/core/liby2/src/include/y2/Makefile.am
branches/tmp/lslezak/core/liby2/src/include/y2/Y2Component.h
branches/tmp/lslezak/core/liby2/src/include/y2/Y2ComponentBroker.h
branches/tmp/lslezak/core/liby2dbus/ (props changed)
branches/tmp/lslezak/core/liby2dbus/src/DBusConn.cc (props changed)
branches/tmp/lslezak/core/liby2dbus/src/DBusConn.h (props changed)
branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.cc (props changed)
branches/tmp/lslezak/core/liby2dbus/src/DBusMsg.h (props changed)
branches/tmp/lslezak/core/liby2dbus/src/Makefile.am (props changed)
branches/tmp/lslezak/core/liby2dbus/src/PolKit.cc (contents, props changed)
branches/tmp/lslezak/core/liby2dbus/src/PolKit.h (props changed)
branches/tmp/lslezak/core/liby2util-r/src/ExternalProgram.cc
branches/tmp/lslezak/core/liby2util-r/src/Makefile.am
branches/tmp/lslezak/core/liby2util-r/src/include/y2util/ExternalProgram.h
branches/tmp/lslezak/core/liby2util-r/src/include/y2util/Makefile.am
branches/tmp/lslezak/core/liby2util-r/src/y2log.cc
branches/tmp/lslezak/core/libycp/src/Makefile.am
branches/tmp/lslezak/core/libycp/src/Scanner.cc
branches/tmp/lslezak/core/libycp/src/Type.cc
branches/tmp/lslezak/core/libycp/src/YBlock.cc
branches/tmp/lslezak/core/libycp/src/YBuiltin.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinFloat.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinList.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinMap.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinMisc.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinString.cc
branches/tmp/lslezak/core/libycp/src/YCPBuiltinTerm.cc
branches/tmp/lslezak/core/libycp/src/YCPList.cc
branches/tmp/lslezak/core/libycp/src/YCPMap.cc
branches/tmp/lslezak/core/libycp/src/YCPString.cc
branches/tmp/lslezak/core/libycp/src/YExpression.cc
branches/tmp/lslezak/core/libycp/src/YStatement.cc
branches/tmp/lslezak/core/libycp/src/include/YCP.h
branches/tmp/lslezak/core/libycp/src/include/ycp/Makefile.am
branches/tmp/lslezak/core/libycp/src/include/ycp/Parser.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YBlock.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPCodeCompare.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPList.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPMap.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCPString.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YCode.h
branches/tmp/lslezak/core/libycp/src/include/ycp/YStatement.h
branches/tmp/lslezak/core/libycp/src/include/ycp/pathsearch.h
branches/tmp/lslezak/core/libycp/src/include/ycp/ycpless.h
branches/tmp/lslezak/core/libycp/src/pathsearch.cc
branches/tmp/lslezak/core/libycp/testsuite/Makefile.am
branches/tmp/lslezak/core/libycp/testsuite/runtest.sh
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Float.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map3.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.ycp
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-remove.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.err
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.out
branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.ycp
branches/tmp/lslezak/core/package/yast2-core.changes
branches/tmp/lslezak/core/scr/src/ScriptingAgent.cc
branches/tmp/lslezak/core/scr/src/StdioSCRAgent.cc
branches/tmp/lslezak/core/scr/src/StdioSCRAgent.h
branches/tmp/lslezak/core/wfm/src/WFM.cc
branches/tmp/lslezak/core/wfm/src/Y2CCWFM.cc
branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.cc
branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.h
branches/tmp/lslezak/core/wfm/testsuite/Makefile.am
branches/tmp/lslezak/core/yast2-core.spec.in
Modified: branches/tmp/lslezak/core/SUBDIRS
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/SUBDIRS?rev=…
==============================================================================
--- branches/tmp/lslezak/core/SUBDIRS (original)
+++ branches/tmp/lslezak/core/SUBDIRS Thu Jan 29 08:58:52 2009
@@ -1 +1 @@
-liby2util-r liby2 libycp liby2dbus libscr agent-dummy scr agent-system agent-any agent-ini agent-modules agent-resolver agents-non-y2 agents-perl wfm base autodocs agent-process dbus
+liby2util-r liby2 libycp liby2dbus libscr agent-dummy scr agent-system agent-any agent-ini agent-modules agent-resolver agents-non-y2 agents-perl wfm agent-process base autodocs dbus
Modified: branches/tmp/lslezak/core/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/VERSION?rev=…
==============================================================================
--- branches/tmp/lslezak/core/VERSION (original)
+++ branches/tmp/lslezak/core/VERSION Thu Jan 29 08:58:52 2009
@@ -1 +1 @@
-2.17.9
+2.18.2
Modified: branches/tmp/lslezak/core/agent-dummy/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agent-dummy/…
==============================================================================
--- branches/tmp/lslezak/core/agent-dummy/testsuite/Makefile.am (original)
+++ branches/tmp/lslezak/core/agent-dummy/testsuite/Makefile.am Thu Jan 29 08:58:52 2009
@@ -12,11 +12,7 @@
noinst_PROGRAMS = y2ag_dummy
y2ag_dummy_SOURCES = y2ag_dummy.cc
-y2ag_dummy_LDADD = \
- ../../liby2/src/liby2.la \
- ../../libycp/src/libycp.la \
- ../../libscr/src/libscr.la \
- ${Y2UTIL_LIBS}
+y2ag_dummy_LDADD = ${AGENT_LIBADD}
y2ag_dummy_LDFLAGS = \
-Xlinker --whole-archive \
../src/libpy2ag_dummy.la \
Modified: branches/tmp/lslezak/core/agent-process/src/Process.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agent-proces…
==============================================================================
--- branches/tmp/lslezak/core/agent-process/src/Process.cc (original)
+++ branches/tmp/lslezak/core/agent-process/src/Process.cc Thu Jan 29 08:58:52 2009
@@ -242,3 +242,8 @@
return ExternalProgram::close();
}
+FILE* Process::errorFile()
+{
+ return stderr_output;
+}
+
Modified: branches/tmp/lslezak/core/agent-process/src/Process.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agent-proces…
==============================================================================
--- branches/tmp/lslezak/core/agent-process/src/Process.h (original)
+++ branches/tmp/lslezak/core/agent-process/src/Process.h Thu Jan 29 08:58:52 2009
@@ -77,9 +77,9 @@
* @param default_locale whether to set LC_ALL=C before starting
* @param use_pty start the process in a terminal
*/
- Process(const std::string &commandline, bool use_pty = false, bool default_locale = false)
+ Process(const std::string &commandline, bool use_pty = false, bool default_locale = false, bool pty_trans = true)
: ExternalProgram(commandline, Stderr_To_FileDesc,
- use_pty, create_stderr_pipes(), default_locale), stderr_output(NULL)
+ use_pty, create_stderr_pipes(), default_locale, "", pty_trans), stderr_output(NULL)
{}
/**
@@ -88,9 +88,9 @@
* overwriting existing ones.
*/
- Process(const char *const *argv, const Environment &environment, bool use_pty = false, bool default_locale = false)
+ Process(const char *const *argv, const Environment &environment, bool use_pty = false, bool default_locale = false, bool pty_trans = true)
: ExternalProgram(argv, environment, Stderr_To_FileDesc,
- use_pty, create_stderr_pipes(), default_locale)
+ use_pty, create_stderr_pipes(), default_locale, "", pty_trans)
{}
@@ -145,6 +145,12 @@
* Read whether there are some buffered lines
*/
bool anyLineInStdout();
+
+ /**
+ * Return the stderror stream
+ */
+ FILE* errorFile();
+
};
#endif // Process_h
Modified: branches/tmp/lslezak/core/agent-process/testsuite/lib/ag_process_init.exp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agent-proces…
==============================================================================
--- branches/tmp/lslezak/core/agent-process/testsuite/lib/ag_process_init.exp (original)
+++ branches/tmp/lslezak/core/agent-process/testsuite/lib/ag_process_init.exp Thu Jan 29 08:58:52 2009
@@ -55,14 +55,22 @@
# check stderr
if {[diff $stderr_name "tmp.err.$base_name"] != 1} {
+ puts "\nThe diff follows...\n"
+ puts [exec sh -c "diff -u $stderr_name tmp.err.$base_name || true"]
+ puts ""
fail "Wrong stderr for $base_name"
+ puts "See the diff above."
return -1
}
# check stdout
if {[diff $stdout_name "tmp.out.$base_name"] != 1} {
+ puts "\nThe diff follows...\n"
+ puts [exec sh -c "diff -u $stdout_name tmp.out.$base_name || true"]
+ puts ""
fail "Wrong stdout for $base_name"
+ puts "See the diff above."
return -1
}
@@ -70,6 +78,9 @@
if {[find . "tests/$base_name.write"] == "./tests/$base_name.write"} {
if {[diff "tests/$base_name.write" "tmp.write.$base_name"] != 1} {
+ puts "\nThe diff follows...\n"
+ puts [exec sh -c "diff -u tests/$base_name.write tmp.write.$base_name || true"]
+ puts ""
fail "Wrong write for $base_name"
return -1
}
Modified: branches/tmp/lslezak/core/agent-system/src/SystemAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agent-system…
==============================================================================
--- branches/tmp/lslezak/core/agent-system/src/SystemAgent.cc (original)
+++ branches/tmp/lslezak/core/agent-system/src/SystemAgent.cc Thu Jan 29 08:58:52 2009
@@ -275,14 +275,14 @@
{
YCPMap map = value->asMap ();
ret += "$[";
- for (YCPMapIterator i = map->begin (); i != map->end (); i++) {
+ for (YCPMap::const_iterator i = map->begin(); i != map->end(); i++) {
if ( i != map->begin () )
ret += ",";
ret += "\n";
ret += indent_output (level+1);
- ret += dump_value (level+1, i.key ());
+ ret += dump_value (level+1, i->first);
ret += " : ";
- ret += dump_value (level+1, i.value ());
+ ret += dump_value (level+1, i->second);
}
ret += "\n";
ret += indent_output (level);
@@ -946,17 +946,18 @@
}
string exports = "";
- for (YCPMapIterator pos = variables->begin(); pos != variables->end(); ++pos)
+ for (YCPMap::const_iterator pos = variables->begin(); pos != variables->end(); ++pos)
{
- YCPValue key = pos.key();
- YCPValue value = pos.value();
+ const YCPValue& key = pos->first;
+ const YCPValue& value = pos->second;
+
if (!key->isString())
{
return YCPError (string("Invalid value '")
+ key->toString()
+ "' for target variable name, which must be a string");
-
}
+
exports += "export " + key->asString()->value() + "='";
string valstr;
if (value->isString())
Modified: branches/tmp/lslezak/core/agents-perl/lib/ycp.pm
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/agents-perl/…
==============================================================================
--- branches/tmp/lslezak/core/agents-perl/lib/ycp.pm (original)
+++ branches/tmp/lslezak/core/agents-perl/lib/ycp.pm Thu Jan 29 08:58:52 2009
@@ -761,8 +761,12 @@
sub BEGIN
{
$Y2DEBUG = $ENV{"Y2DEBUG"};
-
- my @names = ( "/var/log/YaST2/y2log", "$ENV{HOME}/.y2log" );
+ my $home = $ENV{"HOME"};
+ my @names = ( "/var/log/YaST2/y2log" );
+ if (defined ($home))
+ {
+ push(@names, "$home/.y2log")
+ }
if (defined ($ARGV[0]) && $ARGV[0] =~ /^(-l|--log)$/)
{
@names = ( $ARGV[1] );
Modified: branches/tmp/lslezak/core/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/autodocs/Mak…
==============================================================================
--- branches/tmp/lslezak/core/autodocs/Makefile.am (original)
+++ branches/tmp/lslezak/core/autodocs/Makefile.am Thu Jan 29 08:58:52 2009
@@ -13,5 +13,6 @@
index.html: $(wildcard $(top_srcdir)/*/*.cc $(top_srcdir)/*/*/*.cc)
${YDOXYGEN} PROJECT_NAME=@RPMNAME@ \
- INPUT=..
+ INPUT=.. \
+ EXCLUDE=../liby2util-r/testsuite
# TODO: create libzypp.tag and use it (elsewhere)
Modified: branches/tmp/lslezak/core/base/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/base/src/Mak…
==============================================================================
--- branches/tmp/lslezak/core/base/src/Makefile.am (original)
+++ branches/tmp/lslezak/core/base/src/Makefile.am Thu Jan 29 08:58:52 2009
@@ -10,6 +10,7 @@
../../wfm/src/libpy2wfm.la \
../../scr/src/libpy2scr.la \
../../libycp/src/libycp.la \
+ ../../libycp/src/libycpvalues.la \
../../liby2/src/liby2.la \
../../libscr/src/libscr.la
Modified: branches/tmp/lslezak/core/base/tools/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/base/tools/M…
==============================================================================
--- branches/tmp/lslezak/core/base/tools/Makefile.am (original)
+++ branches/tmp/lslezak/core/base/tools/Makefile.am Thu Jan 29 08:58:52 2009
@@ -2,5 +2,5 @@
# Makefile.am for core/base/tools
#
-SUBDIRS = startshell autorun elf-arch ycpc devtools
+SUBDIRS = startshell autorun elf-arch ycpc devtools tty_wrapper
Modified: branches/tmp/lslezak/core/base/tools/ycpc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/base/tools/y…
==============================================================================
--- branches/tmp/lslezak/core/base/tools/ycpc/Makefile.am (original)
+++ branches/tmp/lslezak/core/base/tools/ycpc/Makefile.am Thu Jan 29 08:58:52 2009
@@ -15,6 +15,7 @@
bin_PROGRAMS = ycpc
ycpc_SOURCES = ycpc.cc
ycpc_LDADD = $(top_builddir)/libycp/src/libycp.la \
+ $(top_builddir)/libycp/src/libycpvalues.la \
$(top_builddir)/wfm/src/libpy2wfm.la \
$(top_builddir)/liby2/src/liby2.la \
$(top_builddir)/libscr/src/libscr.la \
Modified: branches/tmp/lslezak/core/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/configure.in…
==============================================================================
--- branches/tmp/lslezak/core/configure.in.in (original)
+++ branches/tmp/lslezak/core/configure.in.in Thu Jan 29 08:58:52 2009
@@ -52,6 +52,7 @@
AGENT_LIBADD='dnl
$(top_builddir)/libscr/src/libscr.la dnl
$(top_builddir)/libycp/src/libycp.la dnl
+ $(top_builddir)/libycp/src/libycpvalues.la dnl
$(top_builddir)/liby2/src/liby2.la dnl
${Y2UTIL_LIBS}'
@@ -130,8 +131,6 @@
## and generate the output
AC_CONFIG_FILES([
- liby2/doc/Y2-access.html
- liby2/doc/Y2-components.html
scr/doc/SCR.html
scr/doc/intro_to_scr.html
])
Modified: branches/tmp/lslezak/core/dbus/SCR_service/DBusServer.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/SCR_ser…
==============================================================================
--- branches/tmp/lslezak/core/dbus/SCR_service/DBusServer.cc (original)
+++ branches/tmp/lslezak/core/dbus/SCR_service/DBusServer.cc Thu Jan 29 08:58:52 2009
@@ -25,7 +25,8 @@
// ostringstream
#include <sstream>
-static bool finish = false;
+// use atomic type in signal handler (see bnc#434509)
+static sig_atomic_t finish = 0;
DBusServer::DBusServer()
@@ -426,7 +427,21 @@
{
// create actionId
static const char *polkit_prefix = "org.opensuse.yast.scr";
- std::string action_id(PolKit::createActionId(polkit_prefix, path, method, arg, opt));
+
+ // check the access right to all methods at first (see bnc#449794)
+ std::string action_id(PolKit::createActionId(polkit_prefix, "", method, "", ""));
+
+ if (policykit.isDBusUserAuthorized(action_id, caller, connection.getConnection()))
+ {
+ y2security("User is authorized to do action %s", action_id.c_str());
+ return true;
+ }
+ else
+ {
+ y2debug("User is NOT authorized to do action %s", action_id.c_str());
+ }
+
+ action_id = PolKit::createActionId(polkit_prefix, path, method, arg, opt);
bool ret = false;
Modified: branches/tmp/lslezak/core/dbus/SCR_service/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/SCR_ser…
==============================================================================
--- branches/tmp/lslezak/core/dbus/SCR_service/Makefile.am (original)
+++ branches/tmp/lslezak/core/dbus/SCR_service/Makefile.am Thu Jan 29 08:58:52 2009
@@ -2,7 +2,7 @@
# Makefile.am for dbus/service
#
-EXTRA_DIST=org.opensuse.yast.SCR.service.in org.opensuse.yast.SCR.conf.in
+EXTRA_DIST=org.opensuse.yast.SCR.service.in org.opensuse.yast.SCR.conf.in org.opensuse.yast.scr.policy
AM_CXXFLAGS = -DY2LOG=\"SCR-service\" -DSUSEVERSION=\"${SUSEVERSION}\"
@@ -16,6 +16,14 @@
SCR_dbus_server_LDADD = ${AGENT_LIBADD} $(top_builddir)/liby2dbus/src/liby2dbus.la $(top_builddir)/scr/src/libpy2scr.la
+# PolicyKit defaults
+polkit_policiesdir = `pkg-config --print-errors --variable policydir polkit`
+polkit_policies_DATA = org.opensuse.yast.scr.policy
+
+# validate the policy files in 'make check' target
+check-local:
+ polkit-policy-file-validate $(polkit_policies_DATA)
+
# service activation config
Modified: branches/tmp/lslezak/core/dbus/SCR_service/org.opensuse.yast.SCR.conf.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/SCR_ser…
==============================================================================
--- branches/tmp/lslezak/core/dbus/SCR_service/org.opensuse.yast.SCR.conf.in (original)
+++ branches/tmp/lslezak/core/dbus/SCR_service/org.opensuse.yast.SCR.conf.in Thu Jan 29 08:58:52 2009
@@ -1,11 +1,20 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
+<!--
+ Rationale:
+ http://lists.opensuse.org/opensuse-packaging/2009-01/msg00132.html
+ https://bugzilla.novell.com/show_bug.cgi?id=468390
+-->
<policy user="root">
<allow own="org.opensuse.yast.SCR"/>
- <allow send_interface="org.opensuse.yast.SCR.Methods"/>
+ <allow send_destination="org.opensuse.yast.SCR"/>
</policy>
<policy context="default">
- <deny own="org.opensuse.yast.SCR"/>
- <@ACCESS_MODE@ send_interface="org.opensuse.yast.SCR.Methods"/>
+ <!-- allowed iff compiled with PolicyKit -->
+ <@ACCESS_MODE@ send_destination="org.opensuse.yast.SCR"
+ send_interface="org.opensuse.yast.SCR.Methods"/>
+ <!-- introspection is allowed -->
+ <allow send_destination="org.opensuse.yast.SCR"
+ send_interface="org.freedesktop.DBus.Introspectable" />
</policy>
</busconfig>
Modified: branches/tmp/lslezak/core/libscr/src/SCR.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libscr/src/S…
==============================================================================
--- branches/tmp/lslezak/core/libscr/src/SCR.cc (original)
+++ branches/tmp/lslezak/core/libscr/src/SCR.cc Thu Jan 29 08:58:52 2009
@@ -140,7 +140,9 @@
}
static YCPValue
-SCRWrite2 (const YCPPath &path, const YCPValue& value) {
+SCRWrite2 (const YCPPath &path, const YCPValue& value_n) {
+ YCPValue value = value_n.isNull()? YCPVoid(): value_n; // bnc#406138
+
if (connection != NULL)
{
return CallDBus("Write", path, value);
@@ -156,7 +158,10 @@
}
static YCPValue
-SCRWrite3 (const YCPPath &path, const YCPValue& value, const YCPValue& arg) {
+SCRWrite3 (const YCPPath &path, const YCPValue& value_n, const YCPValue& arg_n) {
+ YCPValue value = value_n.isNull()? YCPVoid(): value_n; // bnc#406138
+ YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138
+
if (connection != NULL)
{
return CallDBus("Write", path, value, arg);
@@ -222,7 +227,9 @@
}
static YCPValue
-SCRExecute2 (const YCPPath &path, const YCPValue &arg) {
+SCRExecute2 (const YCPPath &path, const YCPValue &arg_n) {
+ YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138
+
if (connection != NULL)
{
return CallDBus("Execute", path, arg);
@@ -235,13 +242,16 @@
}
y2debug( "Running SCR::Execute on SCR agent %p", SCRAgent::instance () );
y2debug( "path: %s", path->toString ().c_str () );
- y2debug( "args: %s", arg.isNull () ? "null" : arg->toString ().c_str () );
+ y2debug( "args: %s", arg->toString ().c_str () );
return SCRAgent::instance ()->Execute (path, arg);
}
static YCPValue
-SCRExecute3 (const YCPPath &path, const YCPValue &arg, const YCPValue &opt) {
+SCRExecute3 (const YCPPath &path, const YCPValue &arg_n, const YCPValue &opt_n) {
+ YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138
+ YCPValue opt = opt_n.isNull()? YCPVoid(): opt_n; // bnc#406138
+
if (connection != NULL)
{
return CallDBus("Execute", path, arg, opt);
@@ -254,7 +264,7 @@
}
y2debug( "Running SCR::Execute on SCR agent %p", SCRAgent::instance () );
y2debug( "path: %s", path->toString ().c_str () );
- y2debug( "args: %s,%s", arg.isNull () ? "null" : arg->toString ().c_str (), opt.isNull () ? "null" : opt->toString ().c_str () );
+ y2debug( "args: %s,%s", arg->toString ().c_str (), opt->toString ().c_str () );
return SCRAgent::instance ()->Execute (path, arg, opt);
}
Modified: branches/tmp/lslezak/core/libscr/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libscr/tests…
==============================================================================
--- branches/tmp/lslezak/core/libscr/testsuite/Makefile.am (original)
+++ branches/tmp/lslezak/core/libscr/testsuite/Makefile.am Thu Jan 29 08:58:52 2009
@@ -12,7 +12,7 @@
noinst_PROGRAMS = runscr
runscr_SOURCES = runscr.cc
-runscr_LDADD = ../src/libscr.la ../../liby2/src/liby2.la ../../libycp/src/libycp.la ${Y2UTIL_LIBS} ../../liby2dbus/src/liby2dbus.la
+runscr_LDADD = ${AGENT_LIBADD} ../../liby2dbus/src/liby2dbus.la
PACKAGE = libscr
AUTOMAKE_OPTIONS = dejagnu
Modified: branches/tmp/lslezak/core/liby2/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/Makefi…
==============================================================================
--- branches/tmp/lslezak/core/liby2/Makefile.am (original)
+++ branches/tmp/lslezak/core/liby2/Makefile.am Thu Jan 29 08:58:52 2009
@@ -2,4 +2,4 @@
# Makefile.am for core/liby2
#
-SUBDIRS = src doc
+SUBDIRS = src
Modified: branches/tmp/lslezak/core/liby2/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/doc/Ma…
==============================================================================
--- branches/tmp/lslezak/core/liby2/doc/Makefile.am (original)
+++ branches/tmp/lslezak/core/liby2/doc/Makefile.am Thu Jan 29 08:58:52 2009
@@ -7,9 +7,6 @@
htmldir = $(docdir)/liby2
html_DATA = \
- Y2-access.html Y2-components.html \
- Y2-overview.html \
- componentbroker.txt \
README.componentsearch
EXTRA_DIST = $(html_DATA)
Modified: branches/tmp/lslezak/core/liby2/src/genericfrontend.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/src/ge…
==============================================================================
--- branches/tmp/lslezak/core/liby2/src/genericfrontend.cc (original)
+++ branches/tmp/lslezak/core/liby2/src/genericfrontend.cc Thu Jan 29 08:58:52 2009
@@ -14,17 +14,75 @@
Authors: Mathias Kettner <kettner(a)suse.de>
Arvin Schnell <arvin(a)suse.de>
+ Stanislav Visnovsky <visnov(a)suse.cz>
Maintainer: Arvin Schnell <arvin(a)suse.de>
/-*/
-/*
- * main function common to all Y2 components
- */
-
#ifndef _GNU_SOURCE
#define _GNU_SOURCE // needed for vasprintf below
#endif
+/**
+ * \file
+ * Generic \ref main function handler for all YaST2 applications.
+ */
+
+/**
+ * \mainpage Welcome to YaST2 Core System
+ *
+ * \section intro Introduction
+ *
+ * This is the main page of the YaST2 Core documentation. YaST Core is a generic component-based
+ * system to provide the infrastructure for implementing functionality of the YaST
+ * installation and configuration tool.
+ *
+ * \section whatis What is YaST2 Core?
+ *
+ * YaST Core is a collection of libraries to provide an infrastructure for rapid
+ * development of configuration tools. It is a component-based, cross-language
+ * system.
+ *
+ * Some of the general topics are covered by the following pages:
+ *
+ * - Component architecture
+ * - \ref components
+ * - \ref componentbroker
+ * - \ref componentsearch
+ *
+ * - Handling of error codes: \ref exitcodes
+ *
+ * - Libraries
+ * - \ref liby2
+ * - \ref libycp
+ * - \ref libscr
+ *
+ * - Generic components
+ * - \ref SCR
+ * - \ref WFM
+ *
+ * \section community Join the community
+ *
+ * Visit our web site at : http://en.opensuse.org/YaST or #yast on irc.freenode.net
+ *
+ * \section License
+ *
+ * YaST is licensed under GPL v2.
+ *
+ */
+
+/**
+ * \page exitcodes YaST2 Exit Codes
+ *
+ * All applications using liby2 library share a common \ref main function. The function handles the exit codes in the following way.
+ *
+ * The exit codes are described in \ref exitcodes.h header file. A special handling is applied to the value returned from the client.
+ * - If a value is \ref YCPNull or \ref YCPVoid, exitcode \ref YAST_OK will be used.
+ * - If the value is \ref YCPBoolean, \ref YAST_OK will be returned for true, \ref YAST_CLIENTRESULT for false.
+ * - If the value is \ref YCPInteger, the value will be added to \ref YAST_CLIENTRESULT and the resulting
+ * integer will be the process exitcode.
+ * - If the value is \ref YCPSymbol, for names defined by \ref ycp_error_exit_symbols \ref YAST_CLIENTRESULT
+ * will be returned, otherwise \ref YAST_OK.
+ */
#include <stdarg.h>
#include <unistd.h>
#include <signal.h>
@@ -44,12 +102,21 @@
#include <YCP.h>
#include <ycp/Parser.h>
#include <ycp/pathsearch.h>
+#include "exitcodes.h"
+
+/// number of symbols that are handled as error codes
+#define MAX_YCP_ERROR_EXIT_SYMBOLS 2
+
+/// symbol names that are handled as error codes when returned by the client
+const char* ycp_error_exit_symbols[MAX_YCP_ERROR_EXIT_SYMBOLS] = {
+ "abort",
+ "cancel"
+};
using std::string;
ExecutionEnvironment ee;
-static const int YCP_ERROR = 16;
-
+/// fallback name of the program
static const char *progname = "genericfrontend";
static void print_usage ();
@@ -262,7 +329,7 @@
if (!argv[arg]) {
print_usage ();
- exit (1);
+ exit (YAST_FEWARGUMENTS);
}
client_name = argv[arg];
@@ -299,13 +366,13 @@
if (option.isNull())
{
print_error ("Client option -s: Couldn't parse valid YCP value from stdin");
- exit (5);
+ exit (YAST_OPTIONERROR);
}
if (!option->isList())
{
print_error ("Client option -s: Parsed YCP value is NOT a YCPList");
- exit (5);
+ exit (YAST_OPTIONERROR);
}
arglist = option->asList(); // the option read _IS_ arglist
@@ -387,13 +454,13 @@
{
fprintf(stderr, "No server module given\n");
print_usage ();
- exit (5);
+ exit (YAST_OPTIONERROR);
}
// now create server
if (!argv[arg]) {
print_usage ();
- exit (1);
+ exit (YAST_FEWARGUMENTS);
}
server_name = argv[arg];
@@ -477,7 +544,7 @@
if (!argv[0])
{
fprintf (stderr, "Missing argv[0]. It is a NULL pointer.");
- exit (5);
+ exit (YAST_OPTIONERROR);
}
progname = basename (argv[0]); // get program name
@@ -501,12 +568,12 @@
if (argc < 2) {
fprintf (stderr, "\nToo few arguments");
print_usage();
- exit (1);
+ exit (YAST_FEWARGUMENTS);
}
if (!strcmp (argv[1], "-h") || !strcmp (argv[1], "--help")) {
print_help ();
- exit (0);
+ exit (YAST_OK);
}
// client _AND_ server must be given
@@ -591,7 +658,7 @@
if (pos == NULL)
{
print_error ("Option %s argument must be in format namespace=component", argv[arg-1]);
- exit (5);
+ exit (YAST_OPTIONERROR);
}
*pos = 0;
Y2ComponentBroker::registerNamespaceException (argv[arg], pos+1);
@@ -689,12 +756,12 @@
fprintf (stderr, " %s\n", i->c_str());
print_usage ();
- exit (5);
+ exit (YAST_OPTIONERROR);
}
if (dynamic_cast<Y2ErrorComponent *>(client))
{
print_error ("Error while creating client module %s", client_name);
- exit (5);
+ exit (YAST_OPTIONERROR);
}
@@ -729,10 +796,30 @@
// might be useful in tracking segmentation faults
y2milestone ("Finished YaST2 component '%s'", progname);
- if( !result.isNull () && result->isBoolean() )
- exit( result->asBoolean()->value() ? 0 : YCP_ERROR );
+ if( result.isNull () )
+ exit (YAST_OK);
- exit (EXIT_SUCCESS);
+ y2milestone( "Exiting with client return value '%s'", result->toString ().c_str ());
+
+ if( result->isBoolean () )
+ {
+ exit( result->asBoolean()->value() ? YAST_OK : YAST_CLIENTRESULT );
+ }
+
+ if( result->isInteger () )
+ exit( YAST_CLIENTRESULT + result->asInteger ()->value () );
+
+ // if it is one of error symbols, return it as error
+ if( result->isSymbol () )
+ {
+ string symbol = result->asSymbol()->symbol();
+ for( int i = 0 ; i < MAX_YCP_ERROR_EXIT_SYMBOLS; i++ )
+ if( symbol == ycp_error_exit_symbols[i] )
+ exit( YAST_CLIENTRESULT );
+ }
+
+ // all other values
+ exit (YAST_OK);
}
Modified: branches/tmp/lslezak/core/liby2/src/include/Y2.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/src/in…
==============================================================================
--- branches/tmp/lslezak/core/liby2/src/include/Y2.h (original)
+++ branches/tmp/lslezak/core/liby2/src/include/Y2.h Thu Jan 29 08:58:52 2009
@@ -26,7 +26,9 @@
#include <y2/Y2ComponentCreator.h>
#include <y2/Y2ComponentBroker.h>
-/***
+/**
+ * \page liby2 liby2 Library
+ *
* <h2>The YaST2 component architecture</h2>
*
* <p>The YaST2 system consists of different components. These are
@@ -53,9 +55,9 @@
* time and provide single isolated binaries as well as clusters of components, that need
* not be disjunct.
*
- * <h2>The generic frontend (GF)</h2>
+ * <h2>The generic frontend (y2base)</h2>
*
- * <p>The liby2 provides a main function. A component linked to liby2
+ * <p>The liby2 provides a \ref main function. A component linked to liby2
* therefore need not and cannot have its own main function. This
* generic main function does:
*
@@ -64,36 +66,29 @@
* <li>find the server and the client component regardless, whether they are realized
* as external programs,
* shared library plugins, YCP scripts or objects that are linked to the main binary</li>
- * <li>parameter checking (not yet implemented)
+ * <li>parameter checking
* <li>launches the server and the client component with the correct paramters</li>
* <li>start the communication between client and server</li>
* </ul>
*
* <p>A YaST2 binary does always consist of the generic frontend and zero or more
- * components that are linked in. The binary <tt>y2gf</tt> just contains the frontend
+ * components that are linked in. The binary <tt>y2base</tt> just contains the frontend
* and the builtin components <tt>cat</tt> and <tt>stdio</tt>. <tt>cat</tt> is
* a server component that can be used instead of a user interface. It simply prints
* all commands it gets to stdout and waits for the answer at stdin. <tt>stdio</tt>
* works similary, but is a client.
*
* <p>The general synopsis of a call of a YaST2 binary is:
- * <pre>y2gf [server] client [client-options] [server-options]</pre>
+ * <pre>y2base client server [client-options] [server-options]</pre>
*
* <p><font size="-1">( Please don't ask yet, why the server-options are stated <i>after</i>
* the client options. We will see later. )</font> </p>
*
* <p>An example would be:
- * <pre>y2gf qt mainmenu</pre>
+ * <pre>y2base menu qt</pre>
*
* <p>This call would use the component <tt>qt</tt>, which is the Qt-lib base graphical
- * user interface, as display server and start the module <tt>mainmenu</tt>.
- *
- * <p>If the name of the YaST2 binary is not equal to <tt>y2gf</tt>, then the name
- * without the <tt>y2</tt> is used as the name of the first component:
- * <pre>y2qt mainmenu</pre>
- * <p>This call does the same as the upper one. The generic frontend contained in <tt>y2qt</tt>
- * first looks for a builtin (linked against) component named <tt>qt</tt>. If it finds one
- * <i>in itself</i>, it does not have to launch an external program component.
+ * user interface, as display server and start the module <tt>menu</tt>.
*
* <h3>Server options</h3>
* <p>Every command line argument
Modified: branches/tmp/lslezak/core/liby2/src/include/y2/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/src/in…
==============================================================================
--- branches/tmp/lslezak/core/liby2/src/include/y2/Makefile.am (original)
+++ branches/tmp/lslezak/core/liby2/src/include/y2/Makefile.am Thu Jan 29 08:58:52 2009
@@ -14,7 +14,8 @@
Y2SerialComponent.h Y2StdioComponent.h \
Y2PluginComponent.h Y2CCPlugin.h \
Y2Namespace.h \
- Y2Function.h SymbolEntry.h
+ Y2Function.h SymbolEntry.h \
+ exitcodes.h
#<INSTALL-HEADER-TARGET>
Modified: branches/tmp/lslezak/core/liby2/src/include/y2/Y2Component.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/src/in…
==============================================================================
--- branches/tmp/lslezak/core/liby2/src/include/y2/Y2Component.h (original)
+++ branches/tmp/lslezak/core/liby2/src/include/y2/Y2Component.h Thu Jan 29 08:58:52 2009
@@ -33,8 +33,195 @@
class YCPList;
/**
+ * \page components YaST2 Component Architecture
+ *
+ * \author Mathias Kettner
+ *
+ * \todo This is partially obsolete!
+ *
+ * <h2>Design principles</h2>
+ *
+ * <p>The YaST2 component model is the foundation of the
+ * YaST2 architecture. It is important to understand at least
+ * the basic ideas in order to be able to write new Y2 components.
+ * It's based upon the following design principles:
+ *
+ * <p><table cellspacing=0 BGCOLOR="#f96500" width="100%"><tr><td>
+ * <table width="100%" bgcolor="#ffc080" cellpadding=10><TR><TD>
+ * <ul>
+ *
+ * <p><li><i>YaST2 should be easily extensable. One should be able
+ * to exchange or add functionality independent
+ * of all other parts.</i>This leads to a modular architecture.
+ * The interchangable parts are called 'components'.</li>
+ *
+ * <p><li><i>It should be possible, that a component can be added
+ * or exchanged merely through the fact, that a file has been
+ * added or exchanged.</i> This allows you to put configuration
+ * modules for a software into the same package as that software.
+ * For example you could write a configuration module for
+ * sendmail and put it into the sendmail package. As long as
+ * the sendmail package is installed, its YaST2 configuration
+ * module is available.</li>
+ *
+ * <p><li><i>Despite the need for Y2 to be modular in concept,
+ * during execution time this should not lead to high communication
+ * overhead or large need in memory usage or the number of
+ * concurrently running processes.</i></li>
+ *
+ * <p><li><i>The inter-component communication should be human
+ * readable, at least in debugging situations.</i></li>
+ *
+ * <p><li><i>The inter-component communication should be network
+ * transparent.</i></li>
+ *
+ * <p><li><i>It should be easy to write a component. Component implementing
+ * should not be restricted to a certain programming language.</i>
+ *
+ * </ul>
+ * </td></tr></table>
+ * </td></tr></table>
+ *
+ * <h2>Communication</h2>
+ *
+ * <p>All components speak a common language and act according to
+ * defined protocol. Both the language and the protocol are
+ * called <i>YCP (YaST2 communication protocol)</i>. One protocol
+ * step consists of one of the partners sending exactly one
+ * of \ref ycpvalues to the other and the other receiving that value. In the
+ * next step, the component that just was receiving, is now sending and
+ * vice versa. The only exception is, that one of that partners
+ * may terminate the session and send a last <i>result</i> message
+ * after which - of course - the partner won't send another value.
+ *
+ * <h2>Clients and Servers</h2>
+ *
+ * <p>There are two different kinds of components: server components and
+ * client components, which differ in how the control flows.
+ *
+ * <p>A <i>server</i> component is one that - once it's initialized -
+ * just waits for jobs to do. Another component can send a <i>request</i>
+ * and thus pass the control to the server. That does what is neccessary
+ * in order to do handle the request and returns an
+ * <i>answer</i>. Prominent examples for server components are the user
+ * interfaces. In YaST2 they play a <i>passive</i> role. They just wait
+ * for a command like "Show me this dialog, wait for the next user
+ * input and return me that input". A server component can also use
+ * the service of another server component. For example the <i>SCR
+ * (System configuration repository)</i> makes use of servers called
+ * <i>agents</i>, which realize subtrees of the SCR tree.
+ *
+ * <p>A <i>client</i> component is one that controls the flow. It may
+ * contain something like an "event loop". In order to do its
+ * work, it can use the services of other server components. Client
+ * components are sometimes called <i>modules</i>. Examples for
+ * modules are the single steps of the YaST2 "Installation
+ * Wizard" or the program that calls <tt>rpm</tt> to install
+ * packages. Other examples could be a module that configures the network
+ * setup of a workstation or one, that just sets the IP-number and the
+ * hostname of that workstation.
+ *
+ * <p>Modules can be hiearchically structured
+ * and hand over control to other modules that acomplish sub tasks and
+ * are called <i>submodules</i> in this context. An example is the
+ * structure of the YaST2 installer. The installation itself is
+ * a module. For each of the wizard window steps, it calls a submodule.
+ *
+ * <h2>How components are realized</h2>
+ * <p>There are quite a number of ways how you can implement a component.
+ * A component can be:
+ * <p><table cellspacing=0 BGCOLOR="#f96500" width="100%"><tr><td>
+ * <table width="100%" bgcolor="#ffc080" cellpadding=10><TR><TD>
+ * <ul>
+ *
+ * <li>An executable program (ELF, /bin/sh, or whatsoever)</li>
+ * <li>A C++ class using \ref libycp and \ref liby2</li>
+ * <li>A YCP script executed by the <i>Workflowmanager</i></li>
+ * <li>Youself typing some YCP code at a terminal</li>
+ *
+ * </ul>
+ * </td></tr></table>
+ * </td></tr></table>
+ *
+ * <p>Don't laugh over the last possibility! For debugging this is sometimes
+ * very helpful. You can simulate <i>any</i> component by typing to a terminal.
+ *
+ * <h3>Executable programs</h3>
+ *
+ * <p>A component that exists as <i>executable program</i> is realized by
+ * a process that is created when the component is needed. If a component
+ * needs the services of an external program component, it launches a
+ * seperate process and starts a communication via two unix pipes, one in
+ * each direction.
+ *
+ * <p>The data flowing through these pipes is YCP Ascii
+ * representation. Each communication side needs a parser to analyse the
+ * data and a YCP syntax generater to write data to the pipe. Both can be
+ * found in the \ref libycp, which can only used from C++ programs.
+ *
+ * <p>But the production of YCP code
+ * can in many cases very easily be done be printing to stdout, for
+ * example with <tt>echo</tt> (shell) or <tt>printf</tt> (C).
+ *
+ * <p>The parsing of YCP code is as bit more tricky. But in many cases you
+ * don't need a full featured parser, because you know beforehand what structure
+ * the value have that you get. This especially holds for client components,
+ * because they can decide, how the output from the server should look like.
+ *
+ * <h3>C++ class using libycp and liby2</h3>
+ * <p>If you anyway decide to write your component in C++,
+ * it's by far the most conveniant way to use the functionality
+ * of libycp and liby2, whose only purpose is excactly to support
+ * component implementation.
+ *
+ * <p>What you have to do is to subclass at least two classes:
+ * \ref Y2ComponentCreator and \ref Y2Component and
+ *
+ * <p>Depending on whether you want to implement a server or a client component
+ * you have to override different methods. Many examples can be found within the liby2
+ * itself.
+ *
+ * <p>One big advantage of writing a component in C++ is, that
+ * you can very easily create three external appearances of the component:
+ * <ul>
+ * <li>A selfcontained executable program</li>
+ * <li>A shared library plugin to load during runtime</li>
+ * <li>A static library that can be linked together with other components</li>
+ * </ul>
+ *
+ * <p>The YaST2 installer makes usage of the third variant only. All required components
+ * are linked together to <tt>y2base</tt>, which is statically linked against liby2 and
+ * libycp. The memory usage is reduced as well as the required disk space. Furthermore
+ * no creating and parsing of Ascii streams between the components is required. Protocol
+ * steps are simple function calls. Even for very large data structures, only one pointer
+ * has to be passed.
+ *
+ * <h3>A YCP script executed by the <i>Workflowmanager</i></h3>
+ * <p>If you have installed YaST2, you will find some files ending in <tt>.ycp</tt>
+ * lying around in <tt>/lib/YaST2/clients</tt>. These are YCP scripts implementing
+ * client components (modules). YCP is not only a protocol, it is also a full features
+ * programming language, which is in this case used to implement components. This is
+ * very conveniant as the language can directly operate on the protocol values and
+ * has some other nice features.
+ *
+ * <p>The client scripts are executed by the <i>Workflowmanager</i>, which is an
+ * extension to the core YCP language. It implements a couple of builtin functions
+ * that allow communication the the system and with other
+ * components. Here is a
+ * <a href="../y2wfm/YCP-builtins-wfm.html">of builtins.</a>.
+ *
+ * <h3>Youself typing YCP code at a terminal</h3>
+ * <p>You can be a component yourself :-). Just tell another component to communicate
+ * via stdio and speak with it. For example you can launch the component <tt>ycp</tt> by
+ * typing <tt>y2ycp stdio</tt>. Now you can enter YCP expressions and get the evaluation
+ * as answer.
+ */
+
+/**
* @short Communication handle to a YaST2 component.
- * @see Y2ComponentBroker.
+ * @see componentbroker
+ * @see Y2ComponentBroker
+ *
* YaST2 is a network oriented client/server architecture.
* Currently there exist five differnt types of components:
* userinterfaces, modules, the workflowmanagers, the
Modified: branches/tmp/lslezak/core/liby2/src/include/y2/Y2ComponentBroker.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2/src/in…
==============================================================================
--- branches/tmp/lslezak/core/liby2/src/include/y2/Y2ComponentBroker.h (original)
+++ branches/tmp/lslezak/core/liby2/src/include/y2/Y2ComponentBroker.h Thu Jan 29 08:58:52 2009
@@ -34,6 +34,41 @@
class Y2Component;
/**
+ * \page componentbroker YaST2 Component Broker
+ * \author Matthias Kettner
+ * \todo clean up and update
+ *
+ * <h2>How the component broker works</h2>
+ *
+ * liby2 is the library which does all the stuff
+ *
+ * in \ref Y2ProgramComponent.cc the server/client is started
+ * (\ref launchExternalProgram) by connecting pipes for stdin/stdout
+ * and starting the program via fork/execve.
+ *
+ * The program is searched via \ref pathsearch.cc and must reside
+ * in a sub-directory "clients" or "servers".
+ * The $HOME directory is a special case, as a sub-dir $HOME/.yast2
+ * must exists.
+ *
+ * Every program starts via \ref main() \ref genericfrontend.cc
+ *
+ * The \ref main() function parses argv and starts
+ * the client (\ref Y2ComponentBroker::createClient) and the
+ * server (\ref Y2ComponentBroker::createServer) for the component
+ *
+ * Expressions are 'commands' to the server and sent via
+ * "...Component::evaluate (const YCPValue& command)"
+ *
+ * evaluate() starts the 'real' component if it is not already
+ * running.
+ *
+ * \ref doActualWork() is used for client components
+ *
+ * \ref result() is used to finish server components
+ */
+
+/**
* @short Looks for and creates YaST2 components
* This class has no instances and only static methods.
* There are two reasons for this:
@@ -50,6 +85,8 @@
* exist. During global constructor call time (before main), the
* constructors of the @ref ComponentCreator classes <i>register</i>
* themselves to the component broker.
+ *
+ * For more details, see \page componentbroker
*/
class Y2ComponentBroker
{
Modified: branches/tmp/lslezak/core/liby2dbus/src/PolKit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2dbus/sr…
==============================================================================
--- branches/tmp/lslezak/core/liby2dbus/src/PolKit.cc (original)
+++ branches/tmp/lslezak/core/liby2dbus/src/PolKit.cc Thu Jan 29 08:58:52 2009
@@ -25,11 +25,22 @@
y2debug("Checking action %s from %s", action_id.c_str(), dbus_caller.c_str());
PolKitCaller *pk_caller = polkit_caller_new_from_dbus_name(con, dbus_caller.c_str(), &dbus_error);
+
if (dbus_error_is_set (&dbus_error))
{
- y2error ("dbus error: %s: %s", dbus_error.name, dbus_error.message);
+ // PolKit sometimes sets the error even if the PolKitCaller object has been successfully returned
+ // see bnc#439150
+ if (pk_caller == NULL)
+ {
+ y2error ("dbus error: %s: %s", dbus_error.name, dbus_error.message);
+ }
+
dbus_error_free (&dbus_error);
- return false;
+
+ if (pk_caller == NULL)
+ {
+ return false;
+ }
}
if (pk_caller == NULL)
Modified: branches/tmp/lslezak/core/liby2util-r/src/ExternalProgram.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2util-r/…
==============================================================================
--- branches/tmp/lslezak/core/liby2util-r/src/ExternalProgram.cc (original)
+++ branches/tmp/lslezak/core/liby2util-r/src/ExternalProgram.cc Thu Jan 29 08:58:52 2009
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <pty.h> // openpty
#include <stdlib.h> // setenv
+#include <termios.h> // tcsetattr()
#include <cstring> // strsignal
@@ -36,8 +37,8 @@
ExternalProgram::ExternalProgram (string commandline,
Stderr_Disposition stderr_disp, bool use_pty,
int stderr_fd, bool default_locale,
- const Pathname& root)
- : use_pty (use_pty)
+ const Pathname& root, bool pty_trans)
+ : use_pty (use_pty), disable_pty_trans(!pty_trans)
{
const char *argv[4];
argv[0] = "/bin/sh";
@@ -58,8 +59,8 @@
ExternalProgram::ExternalProgram (const char *const *argv,
Stderr_Disposition stderr_disp, bool use_pty,
int stderr_fd, bool default_locale,
- const Pathname& root)
- : use_pty (use_pty)
+ const Pathname& root, bool pty_trans)
+ : use_pty (use_pty), disable_pty_trans(!pty_trans)
{
const char* rootdir = NULL;
if(!root.empty() && root != "/")
@@ -74,8 +75,8 @@
ExternalProgram::ExternalProgram (const char *const *argv, const Environment & environment,
Stderr_Disposition stderr_disp, bool use_pty,
int stderr_fd, bool default_locale,
- const Pathname& root)
- : use_pty (use_pty)
+ const Pathname& root, bool pty_trans)
+ : use_pty (use_pty), disable_pty_trans(!pty_trans)
{
const char* rootdir = NULL;
if(!root.empty() && root != "/")
@@ -87,8 +88,8 @@
ExternalProgram::ExternalProgram (const char *binpath, const char *const *argv_1,
- bool use_pty)
- : use_pty (use_pty)
+ bool use_pty, bool pty_trans)
+ : use_pty (use_pty), disable_pty_trans(!pty_trans)
{
int i = 0;
while (argv_1[i++])
@@ -102,8 +103,8 @@
ExternalProgram::ExternalProgram (const char *binpath, const char *const *argv_1, const Environment & environment,
- bool use_pty)
- : use_pty (use_pty)
+ bool use_pty, bool pty_trans)
+ : use_pty (use_pty), disable_pty_trans(!pty_trans)
{
int i = 0;
while (argv_1[i++])
@@ -119,6 +120,39 @@
{
}
+// disable LF to CRLF translation on the terminal file descriptor
+// see 'man termios' or stty.c in core-utils for more info
+bool ExternalProgram::disableCRLFTranslation(int fd)
+{
+ if (!isatty(fd))
+ {
+ ERR << "The file descriptor is not a terminal!\n";
+ return false;
+ }
+
+ // properties of the terminal
+ struct termios mode;
+
+ // get the current attributes
+ if (tcgetattr(fd, &mode))
+ {
+ ERR << "tcgetattr() failed: " << strerror(errno) << endl;
+ return false;
+ }
+
+ // disable the LF to CRLF translation in the output flag
+ mode.c_oflag = mode.c_oflag & ~ONLCR;
+
+ // TCSADRAIN should be used when changing output flags (see 'man termios')
+ if (tcsetattr(fd, TCSADRAIN, &mode))
+ {
+ ERR << "tcsetattr() failed: " << strerror(errno) << endl;
+ return false;
+ }
+
+ return true;
+}
+
void
ExternalProgram::start_program (const char *const *argv, const Environment & environment,
@@ -139,6 +173,11 @@
ERR << "openpty failed" << endl;
return;
}
+
+ if (disable_pty_trans)
+ {
+ disableCRLFTranslation(slave_tty);
+ }
}
else
{
Modified: branches/tmp/lslezak/core/liby2util-r/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2util-r/…
==============================================================================
--- branches/tmp/lslezak/core/liby2util-r/src/Makefile.am (original)
+++ branches/tmp/lslezak/core/liby2util-r/src/Makefile.am Thu Jan 29 08:58:52 2009
@@ -22,7 +22,8 @@
Y2SLog.cc \
miniini.cc \
stringutil.cc \
- y2log.cc
+ y2log.cc \
+ y2changes.cc
liby2util_la_LDFLAGS = -version-info 4:0:0
Modified: branches/tmp/lslezak/core/liby2util-r/src/include/y2util/ExternalProgram.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2util-r/…
==============================================================================
--- branches/tmp/lslezak/core/liby2util-r/src/include/y2util/ExternalProgram.h (original)
+++ branches/tmp/lslezak/core/liby2util-r/src/include/y2util/ExternalProgram.h Thu Jan 29 08:58:52 2009
@@ -64,7 +64,7 @@
ExternalProgram (std::string commandline,
Stderr_Disposition stderr_disp = Normal_Stderr,
bool use_pty = false, int stderr_fd = -1, bool default_locale = false,
- const Pathname& root = "");
+ const Pathname& root = "", bool pty_trans = true);
/**
* Start an external program by giving the arguments as an arry of char *pointers.
@@ -74,19 +74,19 @@
ExternalProgram (const char *const *argv,
Stderr_Disposition stderr_disp = Normal_Stderr,
bool use_pty = false, int stderr_fd = -1, bool default_locale = false,
- const Pathname& root = "");
+ const Pathname& root = "", bool pty_trans = true);
ExternalProgram (const char *const *argv, const Environment & environment,
Stderr_Disposition stderr_disp = Normal_Stderr,
bool use_pty = false, int stderr_fd = -1, bool default_locale = false,
- const Pathname& root = "");
+ const Pathname& root = "", bool pty_trans = true);
ExternalProgram (const char *binpath, const char *const *argv_1,
- bool use_pty = false);
+ bool use_pty = false, bool pty_trans = true);
ExternalProgram (const char *binpath, const char *const *argv_1, const Environment & environment,
- bool use_pty = false);
+ bool use_pty = false, bool pty_trans = true);
~ExternalProgram();
@@ -124,6 +124,12 @@
*/
bool use_pty;
+ /**
+ * Set to true if LF to CRLF output tranformation on the pty
+ * will be disabled
+ */
+ bool disable_pty_trans;
+
pid_t pid;
int _exitStatus;
@@ -132,6 +138,8 @@
int stderr_fd = -1, bool default_locale = false,
const char* root = NULL);
+ // disable LF to CRLF translation on the terminal file descriptor
+ bool disableCRLFTranslation(int fd);
};
#endif // ExternalProgram_h
Modified: branches/tmp/lslezak/core/liby2util-r/src/include/y2util/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2util-r/…
==============================================================================
--- branches/tmp/lslezak/core/liby2util-r/src/include/y2util/Makefile.am (original)
+++ branches/tmp/lslezak/core/liby2util-r/src/include/y2util/Makefile.am Thu Jan 29 08:58:52 2009
@@ -19,7 +19,8 @@
Y2SLog.h \
miniini.h \
stringutil.h \
- y2log.h
+ y2log.h \
+ y2changes.h
#<INSTALL-HEADER-TARGET>
Modified: branches/tmp/lslezak/core/liby2util-r/src/y2log.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/liby2util-r/…
==============================================================================
--- branches/tmp/lslezak/core/liby2util-r/src/y2log.cc (original)
+++ branches/tmp/lslezak/core/liby2util-r/src/y2log.cc Thu Jan 29 08:58:52 2009
@@ -72,14 +72,16 @@
inisection logconf;
static bool did_set_logname = false;
-static bool did_read_logconf = false;
+// use atomic type in signal handler (see bnc#434509)
+static sig_atomic_t did_read_logconf = 0;
static const char *logname;
static off_t maxlogsize;
static int maxlognum;
-static bool log_debug = false;
+// use atomic type in signal handler (see bnc#434509)
+static sig_atomic_t log_debug = false;
static bool log_to_file = true;
static bool log_to_syslog = false;
Modified: branches/tmp/lslezak/core/libycp/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/M…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/Makefile.am (original)
+++ branches/tmp/lslezak/core/libycp/src/Makefile.am Thu Jan 29 08:58:52 2009
@@ -45,7 +45,8 @@
YCPBuiltinList.cc YCPBuiltinBoolean.cc \
YCPBuiltinString.cc YCPBuiltinTerm.cc \
YCPBuiltinVoid.cc YCPBuiltinMap.cc \
- YCPBuiltinMisc.cc \
+ YCPBuiltinMisc.cc YCPBuiltinSymbol.cc \
+ YCPBuiltinMultiset.cc \
YSymbolEntry.cc \
TypeStatics.cc \
y2string.cc \
Modified: branches/tmp/lslezak/core/libycp/src/Scanner.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/S…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/Scanner.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/Scanner.cc Thu Jan 29 08:58:52 2009
@@ -23,6 +23,7 @@
#include <string>
#include <unistd.h>
#include <stdarg.h>
+#include <errno.h>
#include "ycp/Scanner.h"
#include "ycp/y2log.h"
@@ -216,7 +217,12 @@
else if (m_inputFd >= 0)
{
- ssize_t read_bytes = read (m_inputFd, buf, m_buffered ? maxnum : 1);
+ ssize_t read_bytes;
+ do {
+ read_bytes = read (m_inputFd, buf, m_buffered ? maxnum : 1);
+ } while (read_bytes == -1 &&
+ (errno == EINTR || errno == ERESTART)); // bnc#434253
+
if (read_bytes >= 0)
return read_bytes;
else
Modified: branches/tmp/lslezak/core/libycp/src/Type.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/T…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/Type.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/Type.cc Thu Jan 29 08:58:52 2009
@@ -21,7 +21,7 @@
#include "ycp/Type.h"
#include "ycp/Bytecode.h"
#include "ycp/Xmlcode.h"
-#include "ycp/YCPMap.h" // for YCPMapIterator
+#include "ycp/YCPMap.h"
#include "ycp/YCPCode.h" // for YT_Code in matchvalue()
#ifndef DO_DEBUG
@@ -455,10 +455,10 @@
// check every map element
YCPMap mvalue = value->asMap();
- for (YCPMapIterator i = mvalue->begin(); i != mvalue->end(); i++)
+ for (YCPMap::const_iterator i = mvalue->begin(); i != mvalue->end(); ++i)
{
- YCPValue kvalue = i.key(); // get map key value
- YCPValue evalue = i.value(); // get map element value
+ YCPValue kvalue = i->first; // get map key value
+ YCPValue evalue = i->second; // get map element value
y2debug ("kvalue '%s', evalue '%s'", kvalue->toString().c_str(), evalue->toString().c_str());
if (key_type->matchvalue (kvalue) < 0)
{
Modified: branches/tmp/lslezak/core/libycp/src/YBlock.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YBlock.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YBlock.cc Thu Jan 29 08:58:52 2009
@@ -475,7 +475,7 @@
string
-YBlock::toStringSwitch (map<YCPValue, int, ycpless> cases, int defaultcase) const
+YBlock::toStringSwitch (map<YCPValue, int, ycp_less> cases, int defaultcase) const
{
// first, create reverse map of cases
int statementcount = statementCount ();
@@ -484,7 +484,7 @@
for (int i = 0; i < statementcount; i++)
values[i] = YCPNull ();
- for (map<YCPValue, int, ycpless>::iterator it = cases.begin ();
+ for (map<YCPValue, int, ycp_less>::iterator it = cases.begin ();
it != cases.end (); it++ )
{
values[ it->second ] = it->first;
@@ -519,7 +519,7 @@
std::ostream &
-YBlock::toXmlSwitch( map<YCPValue, int, ycpless> cases, int defaultcase, std::ostream & str, int indent ) const
+YBlock::toXmlSwitch( map<YCPValue, int, ycp_less> cases, int defaultcase, std::ostream & str, int indent ) const
{
// first, create reverse map of cases
int statementcount = statementCount ();
@@ -528,7 +528,7 @@
for (int i = 0; i < statementcount; i++)
values[i] = YCPNull ();
- for (map<YCPValue, int, ycpless>::iterator it = cases.begin ();
+ for (map<YCPValue, int, ycp_less>::iterator it = cases.begin ();
it != cases.end (); it++ )
{
values[ it->second ] = it->first;
Modified: branches/tmp/lslezak/core/libycp/src/YBuiltin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YBuiltin.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YBuiltin.cc Thu Jan 29 08:58:52 2009
@@ -50,6 +50,12 @@
#include "ycp/YCPBuiltinList.h"
static YCPBuiltinList builtin_list; // trigger constructor
+#include "ycp/YCPBuiltinMultiset.h"
+static YCPBuiltinMultiset builtin_multiset; // trigger constructor
+
+#include "ycp/YCPBuiltinSymbol.h"
+static YCPBuiltinSymbol builtin_symbol; // trigger constructor
+
#include "ycp/YCPBuiltinMap.h"
static YCPBuiltinMap builtin_map; // trigger constructor
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinFloat.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinFloat.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinFloat.cc Thu Jan 29 08:58:52 2009
@@ -313,8 +313,6 @@
{ "-", "float (float)", (void *)f_neg },
{ "*", "float (float, float)", (void *)f_mult },
{ "/", "float (float, float)", (void *)f_div },
- { "trunc", "float (float)", (void *)f_trunc, DECL_DEPRECATED },
- { "pow", "float (float, float)", (void *)f_pow, DECL_DEPRECATED },
{ "tofloat", "float (const any)", (void *)f_tofloat },
{ "tostring","string (float, integer)", (void *)f_tostring },
{ 0 }
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinList.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinList.cc Thu Jan 29 08:58:52 2009
@@ -72,10 +72,9 @@
SymbolEntryPtr s = symbol->asEntry()->entry();
- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- YCPValue element = list->value (i);
- s->setValue (element);
+ s->setValue(*it);
YCPValue v = expr->evaluate ();
@@ -93,7 +92,7 @@
if (v->asBoolean ()->value ())
{
- ret = element;
+ ret = *it;
break;
}
}
@@ -144,20 +143,7 @@
* @usage contains ([1, 2, 5], 2) -> true
*/
- if (list.isNull ())
- {
- return YCPNull ();
- }
-
- for (int i = 0; i < list->size (); i++)
- {
- if (list->value (i)->equal (value))
- {
- return YCPBoolean (true);
- }
- }
-
- return YCPBoolean (false);
+ return YCPBoolean(list->contains(value));
}
@@ -179,35 +165,7 @@
* @usage setcontains ([1, 2, 5], 2) -> true
*/
- if (list.isNull ())
- {
- return YCPNull ();
- }
-
- int hi = list->size () - 1;
- int lo = 0;
-
- while (lo <= hi)
- {
- int mid = (hi + lo) / 2;
- YCPValue midvalue = list->value (mid);
- YCPOrder comp = value->compare (midvalue);
-
- switch (comp)
- {
- case YO_EQUAL:
- return YCPBoolean (true);
- break;
- case YO_LESS:
- hi = mid - 1;
- break;
- case YO_GREATER:
- lo = mid + 1;
- break;
- }
- }
-
- return YCPBoolean (false);
+ return YCPBoolean(binary_search(list->begin(), list->end(), value, ycp_less()));
}
@@ -254,18 +212,8 @@
// Already contained? I know, this has an _awful_ complexity.
// We need to introduce an order on YCPValueRep to solve the problem.
- bool contained = false;
- for (int a = 0; a < newlist->size (); a++)
- {
- if (newlist->value (a)->equal (to_insert))
- {
- contained = true;
- break;
- }
- }
-
- if (!contained)
+ if (!newlist->contains(to_insert))
newlist->add (to_insert);
}
}
@@ -440,10 +388,9 @@
SymbolEntryPtr s = symbol->asEntry()->entry();
- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- YCPValue element = list->value (i);
- s->setValue (element);
+ s->setValue(*it);
YCPValue v = expr->evaluate ();
@@ -464,7 +411,7 @@
}
if (v->asBoolean ()->value ())
{
- ret->add (element);
+ ret->add(*it);
}
}
@@ -501,9 +448,9 @@
YCPList ret;
SymbolEntryPtr s = symbol->asEntry()->entry();
- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- s->setValue (list->value (i));
+ s->setValue(*it);
YCPValue v = expr->evaluate ();
@@ -558,9 +505,9 @@
YCPList curr_list;
YCPMap curr_map;
- for (int i = 0; i < list->size (); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- key->setValue (list->value (i));
+ key->setValue(*it);
YCPValue curr_value = expr->evaluate ();
@@ -584,8 +531,8 @@
curr_map = curr_value->asMap();
if ( curr_map->size() == 1 )
{
- YCPMapIterator it = curr_map->begin();
- ret->add (it.key(), it.value());
+ YCPMap::const_iterator it = curr_map->begin();
+ ret->add(it->first, it->second);
}
else
{
@@ -658,20 +605,10 @@
* @usage toset ([1, 5, 3, 2, 3, true, false, true]) -> [false, true, 1, 2, 3, 5]
*/
- if (list.isNull ())
- {
- return YCPNull ();
- }
-
- set <YCPValue, ycpless> newset;
-
- for (int i = 0; i < list->size (); i++)
- {
- newset.insert (list->value (i));
- }
+ set<YCPValue, ycp_less> newset(list->begin(), list->end());
YCPList setlist;
- for (set <YCPValue, ycpless>::const_iterator it = newset.begin ();
+ for (set <YCPValue, ycp_less>::const_iterator it = newset.begin ();
it != newset.end (); ++it)
{
setlist->add (*it);
@@ -914,6 +851,27 @@
}
+static YCPValue
+l_isempty(const YCPList& l)
+{
+ /**
+ * @builtin isempty
+ * @id isempty-list
+ * @short Returns whether the list <tt>l</tt> is empty.
+ * @param list l List
+ * @return boolean Emptiness of list <tt>l</tt>
+ *
+ * @description
+ * Notice that the list <tt>l</tt> must not be nil.
+ *
+ * @usage isempty([]) -> true
+ * @usage isempty([19, 29]) -> false
+ */
+
+ return YCPBoolean(l->isEmpty());
+}
+
+
// parameter is YCPValue because we accept 'nil'
static YCPValue
l_size (const YCPValue &list)
@@ -949,11 +907,14 @@
* @short Removes element from a list
* @param list LIST
* @param integer e element index
- * @return list Returns nil if the index is invalid.
+ * @return list Returns unchanged list if the index is invalid.
* @description
* Removes the <tt>i</tt>'th value from a list. The first value has the
* index 0. The call remove ([1,2,3], 1) thus returns [1,3].
*
+ * The yast2-core version < 2.17.16 returns nil if the key is invalid. This behavior
+ * has changed in version 2.17.16 to return unchanged list.
+ *
* @usage remove ([1, 2], 0) -> [2]
*/
@@ -975,7 +936,7 @@
if (idx < 0 || idx >= ret->size ())
{
ycp2error ("Index %s for remove () out of range", toString (idx).c_str ());
- return YCPNull ();
+ return ret;
}
ret->remove (idx);
@@ -1072,9 +1033,9 @@
SymbolEntryPtr s = sym->asEntry()->entry();
YCPValue ret = YCPVoid();
- for (int i=0; i < list->size(); i++)
+ for (YCPList::const_iterator it = list->begin(); it != list->end(); ++it)
{
- s->setValue (list->value (i));
+ s->setValue(*it);
ret = expr->evaluate ();
if (ret.isNull())
@@ -1093,6 +1054,44 @@
static YCPValue
+l_reduce_helper(const YCPSymbol &x, const YCPSymbol &y, const YCPValue &initial,
+ const YCPList::const_iterator &first, const YCPList::const_iterator &last,
+ const YCPCode &expr)
+{
+ SymbolEntryPtr xs = x->asEntry()->entry();
+ SymbolEntryPtr ys = y->asEntry()->entry();
+
+ YCPValue ret = initial;
+
+ for (YCPList::const_iterator it = first; it != last; ++it)
+ {
+ xs->setValue(ret);
+ ys->setValue(*it);
+
+ YCPValue tmp = expr->evaluate();
+ if (tmp.isNull())
+ {
+ ycp2error("Bad 'reduce' expression %s", expr->toString().c_str());
+ continue;
+ }
+ if (tmp->isVoid())
+ {
+ ycp2error("The expression for 'reduce' returned 'nil'");
+ continue;
+ }
+ if (tmp->isBreak())
+ {
+ break;
+ }
+
+ ret = tmp;
+ }
+
+ return ret;
+}
+
+
+static YCPValue
l_reduce1 (const YCPSymbol &x, const YCPSymbol &y, const YCPList &list, const YCPCode &expr)
{
/**
@@ -1115,50 +1114,20 @@
* the list must not be empty.
*
* @usage list::reduce (integer x, integer y, [2, 4, 6], { return x < y ? x : y; }) -> 2
- * @usage list::reduce (integer x, integer y, [2, 4, 6], { return x < y ? x : y; }) -> 6
+ * @usage list::reduce (integer x, integer y, [2, 4, 6], { return x > y ? x : y; }) -> 6
*/
- if (list.isNull())
- {
- return YCPNull();
- }
-
- if (list->size() < 1)
+ if (list->isEmpty())
{
- ycp2error("Empty list %s for 'reduce'", list->toString().c_str());
+ ycp2error("Empty list for 'reduce'");
return YCPNull();
}
- SymbolEntryPtr xs = x->asEntry()->entry();
- SymbolEntryPtr ys = y->asEntry()->entry();
-
- YCPValue ret = list->value(0);
-
- for (int i = 1; i < list->size(); i++)
- {
- xs->setValue(ret);
- ys->setValue(list->value(i));
-
- YCPValue tmp = expr->evaluate();
- if (tmp.isNull())
- {
- ycp2error("Bad 'reduce' expression %s", expr->toString().c_str());
- continue;
- }
- if (tmp->isVoid())
- {
- ycp2error("The expression for 'reduce' returned 'nil'");
- continue;
- }
- if (tmp->isBreak())
- {
- break;
- }
+ const YCPList::const_iterator initial = list->begin();
+ const YCPList::const_iterator first = initial + 1;
+ const YCPList::const_iterator last = list->end();
- ret = tmp;
- }
-
- return ret;
+ return l_reduce_helper(x, y, *initial, first, last, expr);
}
@@ -1175,7 +1144,7 @@
* @param list<flex2> list
* @param block<flex1> expression
* @return flex1
- *
+ *
* @description
* Apply expression cumulatively to the values of the list, from left to
* right, to reduce the list to a single value. See
@@ -1192,41 +1161,10 @@
* @usage list::reduce (term t, float f, `item(`id(`dummy)), [3.14, 2.71], { return add(t, tostring(f)); }) -> `item (`id (`dummy), "3.14", "2.71")
*/
- if (list.isNull())
- {
- return YCPNull();
- }
-
- SymbolEntryPtr xs = x->asEntry()->entry();
- SymbolEntryPtr ys = y->asEntry()->entry();
-
- YCPValue ret = initial;
-
- for (int i = 0; i < list->size(); i++)
- {
- xs->setValue(ret);
- ys->setValue(list->value(i));
-
- YCPValue tmp = expr->evaluate();
- if (tmp.isNull())
- {
- ycp2error("Bad 'reduce' expression %s", expr->toString().c_str());
- continue;
- }
- if (tmp->isVoid())
- {
- ycp2error("The expression for 'reduce' returned 'nil'");
- continue;
- }
- if (tmp->isBreak())
- {
- break;
- }
-
- ret = tmp;
- }
+ const YCPList::const_iterator first = list->begin();
+ const YCPList::const_iterator last = list->end();
- return ret;
+ return l_reduce_helper(x, y, initial, first, last, expr);
}
@@ -1264,7 +1202,7 @@
{ "find", "flex (variable <flex>, const list <flex>, const block <boolean>)", (void *)l_find, DECL_SYMBOL|DECL_FLEX },
{ "prepend", "list <flex> (const list <flex>, const flex)", (void *)l_prepend, DECL_FLEX },
{ "contains", "boolean (const list <flex>, const flex)", (void *)l_contains, DECL_FLEX },
- { "setcontains","boolean (list <flex>, const flex)", (void *)l_setcontains, DECL_FLEX },
+ { "setcontains","boolean (const list <flex>, const flex)", (void *)l_setcontains, DECL_FLEX },
{ "union", "list <any> (const list <any>, const list <any>)", (void *)l_unionlist },
{ "+", "list <flex> (const list <flex>, const list <flex>)", (void *)l_unionlist, DECL_FLEX },
{ "merge", "list <any> (const list <any>, const list <any>)", (void *)l_mergelist },
@@ -1283,6 +1221,7 @@
{ "add", "list <flex> (const list <flex>, const flex)", (void *)l_add, DECL_FLEX },
{ "+", "list <flex> (const list <flex>, const flex)", (void *)l_add, DECL_FLEX },
{ "+", "list <any> (const list <any>, any)", (void *)l_add },
+ { "isempty", "boolean (const list <any>)", (void *)l_isempty },
{ "size", "integer (const list <any>)", (void *)l_size, DECL_NIL },
{ "remove", "list <flex> (const list <flex>, const integer)", (void *)l_remove, DECL_FLEX },
{ "select", "flex (const list <flex>, integer, flex)", (void *)l_select, DECL_NIL|DECL_FLEX },
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinMap.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinMap.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinMap.cc Thu Jan 29 08:58:52 2009
@@ -62,8 +62,7 @@
return YCPNull ();
}
- YCPValue tmp = map->value (value);
- return YCPBoolean (!tmp.isNull ());
+ return YCPBoolean(map->hasKey(value));
}
@@ -96,10 +95,10 @@
SymbolEntryPtr k = key->asEntry()->entry();
SymbolEntryPtr v = value->asEntry()->entry();
- for (YCPMapIterator pos = map->begin (); pos != map->end (); ++pos)
+ for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)
{
- k->setValue (pos.key());
- v->setValue (pos.value());
+ k->setValue (pos->first);
+ v->setValue (pos->second);
YCPValue v = expr->evaluate ();
@@ -120,7 +119,7 @@
}
if (v->asBoolean ()->value ())
{
- ret->add (pos.key (), pos.value ());
+ ret->add(pos->first, pos->second);
}
}
@@ -165,10 +164,10 @@
SymbolEntryPtr k = key->asEntry()->entry();
SymbolEntryPtr v = value->asEntry()->entry();
- for (YCPMapIterator pos = map->begin (); pos != map->end (); ++pos)
+ for (YCPMap::const_iterator pos = map->begin (); pos != map->end (); ++pos)
{
- k->setValue (pos.key());
- v->setValue (pos.value());
+ k->setValue (pos->first);
+ v->setValue (pos->second);
YCPValue curr_value = expr->evaluate ();
@@ -180,8 +179,8 @@
}
expr_map = curr_value->asMap();
- YCPMapIterator it = expr_map->begin();
- ret->add (it.key(), it.value());
+ YCPMap::const_iterator it = expr_map->begin();
+ ret->add(it->first, it->second);
}
else
{
@@ -227,10 +226,10 @@
SymbolEntryPtr k = key->asEntry()->entry();
SymbolEntryPtr v = value->asEntry()->entry();
- for (YCPMapIterator pos = map->begin (); pos != map->end (); pos++)
+ for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)
{
- k->setValue (pos.key());
- v->setValue (pos.value());
+ k->setValue (pos->first);
+ v->setValue (pos->second);
YCPValue v = expr->evaluate();
@@ -280,9 +279,9 @@
{
YCPMap map = (m == 0 ? map1 : map2);
- for (YCPMapIterator pos = map->begin (); pos != map->end (); pos++)
+ for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)
{
- newmap->add (pos.key (), pos.value ());
+ newmap->add(pos->first, pos->second);
}
}
@@ -361,6 +360,27 @@
}
+static YCPValue
+m_isempty(const YCPMap& m)
+{
+ /**
+ * @builtin isempty
+ * @id isempty-map
+ * @short Returns whether the map <tt>m</tt> is empty.
+ * @param map m Map
+ * @return boolean Emptiness of map <tt>m</tt>
+ *
+ * @description
+ * Notice that the map <tt>m</tt> must not be nil.
+ *
+ * @usage isempty($[]) -> true
+ * @usage isempty($[ `host : "pandora" ]) -> false
+ */
+
+ return YCPBoolean(m->isEmpty());
+}
+
+
// parameter is YCPValue because we accept 'nil'
static YCPValue
m_size (const YCPValue &map)
@@ -418,10 +438,10 @@
SymbolEntryPtr v = val->asEntry()->entry();
YCPValue ret = YCPVoid();
- for (YCPMapIterator pos = map->begin(); pos != map->end(); ++pos)
+ for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)
{
- k->setValue (pos.key());
- v->setValue (pos.value());
+ k->setValue (pos->first);
+ v->setValue (pos->second);
ret = expr->evaluate ();
if (ret.isNull())
@@ -478,13 +498,16 @@
*
* @description
* Remove the value with the key <tt>KEY</tt> from a map. Returns
- * nil if the key is invalid.
+ * unchanged map if the key is invalid.
+ *
+ * The yast2-core version < 2.17.16 returns nil if the key is invalid. This behavior
+ * has changed in version 2.17.16 to return unchanged map.
*
* @param map MAP
* @param any KEY
* @return map
*
- * @usage remove($[1:2], 0) -> nil
+ * @usage remove($[1:2], 0) -> $[1:2]
* @usage remove($[1:2], 1) -> $[]
* @usage remove ($[1:2, 3:4], 1) -> $[3:4]
*/
@@ -500,10 +523,10 @@
YCPMap ret = map;
- if(map->value (key).isNull ())
+ if (!map->hasKey(key))
{
ycp2error ( "Key %s for remove () does not exist", key->toString ().c_str ());
- return YCPNull ();
+ return ret;
}
ret->remove (key);
@@ -544,6 +567,7 @@
{ "+", "map <any,any> (const map <any,any>, const map <any,any>)", (void *)m_unionmap },
{ "add", "map <flex1,flex2> (const map <flex1,flex2>, const flex1, const flex2)", (void *)m_addmap, DECL_FLEX },
{ "change", "map <flex1,flex2> (const map <flex1,flex2>, const flex1, const flex2)", (void *)m_changemap,DECL_FLEX|DECL_DEPRECATED },
+ { "isempty", "boolean (const map <any,any>)", (void *)m_isempty },
{ "size", "integer (const map <any,any>)", (void *)m_size, DECL_NIL },
{ "foreach","flex1 (variable <flex2>, variable <flex3>, const map <flex2,flex3>, const block <flex1>)", (void *)m_foreach, DECL_LOOP|DECL_SYMBOL|DECL_FLEX },
{ "tomap", "map <any,any> (const any)", (void *)m_tomap, DECL_FLEX },
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinMisc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinMisc.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinMisc.cc Thu Jan 29 08:58:52 2009
@@ -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 }
};
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinString.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinString.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinString.cc Thu Jan 29 08:58:52 2009
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <regex.h>
#include <libintl.h>
-#include <iostream>
#include <string>
using std::string;
@@ -58,6 +57,27 @@
static YCPValue
+s_isempty(const YCPString& s)
+{
+ /**
+ * @builtin isempty
+ * @id isempty-string
+ * @short Returns whether the string <tt>s</tt> is empty.
+ * @param string s String
+ * @return boolean Emptiness of string <tt>s</tt>
+ *
+ * @description
+ * Notice that the string <tt>s</tt> must not be nil.
+ *
+ * @usage isempty("") -> true
+ * @usage isempty("test") -> false
+ */
+
+ return YCPBoolean(s->isEmpty());
+}
+
+
+static YCPValue
s_size (const YCPString &s)
{
/**
@@ -331,6 +351,114 @@
static YCPValue
+s_lsubstring1 (const YCPString &s, const YCPInteger &i1)
+{
+ /**
+ * @builtin lsubstring
+ * @id lsubstring-rest
+ * @short Extracts a substring in UTF-8 encoded string
+ *
+ * @description
+ * Extracts a substring of the string <tt>STRING</tt>, starting at
+ * <tt>OFFSET</tt> after the first one with length of at most
+ * <tt>LENGTH</tt>. <tt>OFFSET</tt> starts with 0. This method uses UTF-8 encoding.
+ *
+ * @param string STRING
+ * @param integer OFFSET
+ * @param integer LENGTH
+ * @return string
+ * @usage substring ("some text", 5) -> "text"
+ * @usage substring ("some text", 42) -> ""
+ */
+
+ if (s.isNull () || i1.isNull())
+ return YCPNull ();
+
+ string lss = s->value ();
+ wstring ss;
+
+ if( ! utf82wchar( lss, &ss ) )
+ {
+ y2error( "Unable to recode string '%s' to UTF-8", lss.c_str() );
+ return YCPNull ();
+ }
+
+ string::size_type start = i1->value ();
+
+ if (start > ss.size ())
+ {
+ ycp2error ("Substring index out of range");
+ return YCPString ("");
+ }
+
+ ss = ss.substr ((wstring::size_type) start, wstring::npos);
+
+ if( !wchar2utf8( ss, &lss ) )
+ {
+ y2error( "Unable to recode result string '%ls' from UTF-8", ss.c_str() );
+ return YCPNull ();
+ }
+
+ return YCPString(lss);
+}
+
+
+static YCPValue
+s_lsubstring2 (const YCPString &s, const YCPInteger &i1, const YCPInteger &i2)
+{
+ /**
+ * @builtin lsubstring
+ * @id lsubstring-length
+ * @short Extracts a substring in UTF-8 encoded string
+ *
+ * @description
+ * Extracts a substring of the string <tt>STRING</tt>, starting at
+ * <tt>OFFSET</tt> after the first one with length of at most
+ * <tt>LENGTH</tt>. <tt>OFFSET</tt> starts with 0. This method uses UTF-8 encoding.
+ *
+ * @param string STRING
+ * @param integer OFFSET
+ * @param integer LENGTH
+ * @return string
+ * @usage lsubstring ("some text", 5, 2) -> "te"
+ * @usage lsubstring ("some text", 42, 2) -> ""
+ * @usage lsubstring("123456789", 2, 3) -> "345"
+ */
+
+ if (s.isNull () || i1.isNull() || i2.isNull ())
+ return YCPNull ();
+
+ string lss = s->value ();
+ wstring ss;
+
+ if( ! utf82wchar( lss, &ss ) )
+ {
+ y2error( "Unable to recode string '%s' to UTF-8", lss.c_str() );
+ return YCPNull ();
+ }
+
+ string::size_type start = i1->value ();
+ string::size_type length = i2->value ();
+
+ if (start > ss.size ())
+ {
+ ycp2error ("Substring index out of range");
+ return YCPString ("");
+ }
+
+ ss = ss.substr (start, length);
+
+ if( !wchar2utf8( ss, &lss ) )
+ {
+ y2error( "Unable to recode result string '%ls' from UTF-8", ss.c_str() );
+ return YCPNull ();
+ }
+
+ return YCPString(lss);
+}
+
+
+static YCPValue
s_search (const YCPString &s1, const YCPString &s2)
{
/**
@@ -1380,6 +1508,7 @@
{ "tostring", "string (any)", (void *)s_tostring },
{ "tohexstring", "string (integer)", (void *)s_tohexstring1 },
{ "tohexstring", "string (integer, integer)", (void *)s_tohexstring2 },
+ { "isempty", "boolean (string)", (void *)s_isempty },
{ "size", "integer (string)", (void *)s_size },
{ "find", "integer (string, string)", (void *)s_find, DECL_DEPRECATED },
{ "search", "integer (string, string)", (void *)s_search },
@@ -1407,6 +1536,8 @@
{ "dgettext", "string (string, string)", (void *)s_dgettext},
{ "dngettext", "string (string, string, string, integer)", (void *)s_dngettext},
{ "dpgettext", "string (string, string, string)", (void *)s_dpgettext},
+ { "lsubstring", "string (string, integer)", (void *)s_lsubstring1 },
+ { "lsubstring", "string (string, integer, integer)", (void *)s_lsubstring2 },
{ 0 }
};
Modified: branches/tmp/lslezak/core/libycp/src/YCPBuiltinTerm.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPBuiltinTerm.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPBuiltinTerm.cc Thu Jan 29 08:58:52 2009
@@ -232,6 +232,9 @@
* remove which allowed 'remove(`term(1,2,3), 0) = [1,2,3]'
* Use 'argsof (term) -> list' for this kind of transformation.)
*
+ * The yast2-core version < 2.17.16 returns nil if the index is invalid. This behavior
+ * has changed in version 2.17.16 to return unchanged term.
+ *
* @param term TERM
* @param integer i
* @return term
@@ -250,7 +253,7 @@
if (idx <= 0 || idx > args->size ())
{
ycp2error ("Index %s for remove () out of range", toString (idx).c_str ());
- return YCPNull ();
+ return term;
}
args->remove (idx-1);
Modified: branches/tmp/lslezak/core/libycp/src/YCPList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPList.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPList.cc Thu Jan 29 08:58:52 2009
@@ -10,10 +10,11 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YCPList.cc
+ File: YCPList.cc
Authors: Mathias Kettner <kettner(a)suse.de>
Klaus Kaempf <kkaempf(a)suse.de>
+ Arvin Schnell <aschnell(a)suse.de>
Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
/-*/
@@ -67,6 +68,13 @@
void
+YCPListRep::push_back(const YCPValue& value)
+{
+ elements.push_back(value);
+}
+
+
+void
YCPListRep::set (const int i, const YCPValue& value)
{
if (i < 0)
@@ -102,41 +110,24 @@
bool YCPListRep::contains (const YCPValue& value) const
{
- for (vector <YCPValue>::const_iterator it = elements.begin ();
- it != elements.end (); it++)
- {
- if ((*it)->equal (value))
- return true;
- }
-
- return false;
-}
-
-
-static bool compareYCP (const YCPValue& y1, const YCPValue& y2)
-{
- return (y1->compare(y2)) == YO_LESS;
+ return find_if(begin(), end(), bind2nd(ycp_equal_to(), value)) != end();
}
void
YCPListRep::sortlist()
{
- std::sort (elements.begin (), elements.end (), compareYCP);
+ std::sort(elements.begin(), elements.end(), ycp_less());
}
-static bool lcompareYCP( const YCPValue& y1, const YCPValue& y2 )
+void
+YCPListRep::lsortlist()
{
- return y1->compare(y2, true) == YO_LESS;
+ std::sort(elements.begin(), elements.end(), ycp_less(true));
}
-void YCPListRep::lsortlist()
-{
- std::sort (elements.begin (), elements.end (), lcompareYCP);
-}
-
void
YCPListRep::fsortlist(const YCPCodeCompare& cmp)
{
@@ -193,6 +184,20 @@
}
+YCPListRep::const_iterator
+YCPListRep::begin() const
+{
+ return elements.begin();
+}
+
+
+YCPListRep::const_iterator
+YCPListRep::end() const
+{
+ return elements.end();
+}
+
+
YCPOrder
YCPListRep::compare(const YCPList& l) const
{
Modified: branches/tmp/lslezak/core/libycp/src/YCPMap.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPMap.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPMap.cc Thu Jan 29 08:58:52 2009
@@ -12,7 +12,8 @@
File: YCPMap.cc
- Author: Mathias Kettner <kettner(a)suse.de>
+ Authors: Mathias Kettner <kettner(a)suse.de>
+ Arvin Schnell <aschnell(a)suse.de>
Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
/-*/
@@ -56,12 +57,22 @@
ycp2error ("Only integer, string, or symbol constant allowed as key in map");
return;
}
- YCPValueYCPValueMap::iterator pos = stl_map.find( key );
- if ( pos == stl_map.end() )
- stl_map.insert( YCPValueYCPValueMap::value_type( key, value ) );
- else
+ // Note: 'stl_map[key] = value' would create a temporary object using the
+ // default constructor for YCPValue. See Scott Meyers, Effective STL, Item
+ // 24.
+
+ YCPMap::iterator pos = stl_map.lower_bound(key);
+ if (pos != stl_map.end() && !YCPMap::key_compare()(key, pos->first))
+ {
pos->second = value;
+ }
+ else
+ {
+ // pos is just a hint but can avoid a second search through the map
+ stl_map.insert(pos, YCPMap::value_type(key, value));
+ }
+
}
@@ -79,9 +90,9 @@
YCPMap newmap;
- for (YCPMapIterator pos = begin(); pos != end(); ++pos )
+ for (YCPMap::const_iterator pos = begin(); pos != end(); ++pos)
{
- newmap->add( pos.key(), pos.value() );
+ newmap->add(pos->first, pos->second);
}
newmap->add( key, value );
@@ -106,13 +117,20 @@
{
YCPMapRep* newmap = new YCPMapRep ();
- for (YCPMapIterator pos = begin(); pos != end(); ++pos )
- newmap->add (pos.key(), pos.value());
+ for (YCPMap::const_iterator pos = begin(); pos != end(); ++pos)
+ newmap->add(pos->first, pos->second);
return newmap;
}
+bool
+YCPMapRep::isEmpty() const
+{
+ return stl_map.empty();
+}
+
+
long
YCPMapRep::size() const
{
@@ -120,13 +138,22 @@
}
+bool
+YCPMapRep::hasKey(const YCPValue& key) const
+{
+ return stl_map.find(key) != stl_map.end();
+}
+
+
YCPValue
YCPMapRep::value(const YCPValue& key) const
{
- YCPMapIterator pos = stl_map.find( key );
+ YCPMap::const_iterator pos = stl_map.find(key);
- if ( pos != end() ) return pos.value();
- else return YCPNull();
+ if (pos != end())
+ return pos->second;
+ else
+ return YCPNull();
}
@@ -151,16 +178,16 @@
else
{
// equal length ==> pairwise comparison
- for( YCPMapIterator pos_this = begin(), pos_m = m->begin();
+ for( YCPMap::const_iterator pos_this = begin(), pos_m = m->begin();
pos_this != end(), pos_m != m->end();
++pos_this, ++pos_m )
{
// compare keys
- order = pos_this.key()->compare( pos_m.key() );
+ order = pos_this->first->compare(pos_m->first);
if ( order == YO_LESS || order == YO_GREATER ) return order;
// equal keys ==> compare values
- order = pos_this.value()->compare( pos_m.value() );
+ order = pos_this->second->compare(pos_m->second);
if ( order == YO_LESS || order == YO_GREATER ) return order;
}
@@ -177,25 +204,18 @@
{
string s = "$[";
- for(YCPMapIterator pos = begin(); pos != end(); ++pos )
+ for (YCPMap::const_iterator pos = begin(); pos != end(); ++pos)
{
if ( pos != begin() ) s += ", ";
- s += pos.key()->toString()
+ s += pos->first->toString()
+ ":"
- + ((pos.value().isNull()) ? "(null)" : pos.value()->toString());
+ + ((pos->second.isNull()) ? "(null)" : pos->second->toString());
}
return s + "]";
}
-YCPMapIterator
-YCPMapRep::findKey(const YCPValue& key) const
-{
- return stl_map.find( key );
-}
-
-
YCPValueType
YCPMapRep::valuetype() const
{
@@ -210,11 +230,11 @@
YCPMapRep::toStream (std::ostream & str) const
{
Bytecode::writeInt32 (str, stl_map.size());
- for(YCPMapIterator pos = begin(); pos != end(); ++pos )
+ for (YCPMap::const_iterator pos = begin(); pos != end(); ++pos)
{
- if (!Bytecode::writeValue (str, pos.key()))
+ if (!Bytecode::writeValue (str, pos->first))
break;
- if (!Bytecode::writeValue (str, pos.value()))
+ if (!Bytecode::writeValue (str, pos->second))
break;
}
return str;
@@ -225,11 +245,11 @@
YCPMapRep::toXml (std::ostream & str, int indent ) const
{
str << "<map size=\"" << stl_map.size() << "\">";
- for(YCPMapIterator pos = begin(); pos != end(); ++pos )
+ for (YCPMap::const_iterator pos = begin(); pos != end(); ++pos)
{
str << "<element>";
- str << "<key>"; pos.key()->toXml( str, 0 ); str << "</key>";
- str << "<value>"; pos.value()->toXml( str, 0 ); str << "</value>";
+ str << "<key>"; pos->first->toXml( str, 0 ); str << "</key>";
+ str << "<value>"; pos->second->toXml( str, 0 ); str << "</value>";
str << "</element>";
}
return str << "</map>";
Modified: branches/tmp/lslezak/core/libycp/src/YCPString.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YCPString.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YCPString.cc Thu Jan 29 08:58:52 2009
@@ -33,6 +33,14 @@
{
}
+
+bool
+YCPStringRep::isEmpty() const
+{
+ return v.empty();
+}
+
+
string
YCPStringRep::value() const
{
Modified: branches/tmp/lslezak/core/libycp/src/YExpression.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YExpression.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YExpression.cc Thu Jan 29 08:58:52 2009
@@ -1116,13 +1116,13 @@
YCPMap map = value->asMap ();
- for (YCPMapIterator pos = map->begin (); pos != map->end (); pos++)
+ for (YCPMap::const_iterator pos = map->begin(); pos != map->end(); ++pos)
{
- if (! canPropagate (pos.key (), key) )
+ if (! canPropagate (pos->first, key) )
{
return false;
}
- if (! canPropagate (pos.value (), elem) )
+ if (! canPropagate (pos->second, elem) )
{
return false;
}
Modified: branches/tmp/lslezak/core/libycp/src/YStatement.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/Y…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/YStatement.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/YStatement.cc Thu Jan 29 08:58:52 2009
@@ -1927,7 +1927,7 @@
Bytecode::writeInt32 (str, m_cases.size ());
- for (map<YCPValue, int, ycpless>::const_iterator it = m_cases.begin ()
+ for (map<YCPValue, int, ycp_less>::const_iterator it = m_cases.begin ()
; it != m_cases.end () ; it++)
{
Bytecode::writeValue (str, it->first);
Modified: branches/tmp/lslezak/core/libycp/src/include/YCP.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/YCP.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/YCP.h Thu Jan 29 08:58:52 2009
@@ -28,6 +28,37 @@
// include all basic types
+/**
+ * \page libycp libycp Library
+ *
+ * This is a library implementing basic \ref ycpvalues and \ref ycplanguage.
+ */
+
+/**
+ * \page ycpvalues YCP Values
+ *
+ * YCP values are the primary way of communicating of YaST components. The following values are implemented:
+ *
+ * <em>Simple values:</em>
+ *
+ * - \ref YCPNull no value - typically error during internal communication
+ * - \ref YCPVoid nil value
+ * - \ref YCPBoolean boolean value
+ * - \ref YCPInteger signed 64-bit integer
+ * - \ref YCPFloat double floating point
+ * - \ref YCPString UTF-8 encoded string
+ *
+ * <em>Special values:</em>
+ * - \ref YCPByteblock array of bytes (e.g. image)
+ * - \ref YCPCode executable code written in YCP language
+ * - \ref YCPExternal pointer
+ *
+ * <em>Complex values:</em>
+ * - \ref YCPList list/array of YCP values
+ * - \ref YCPMap map/hash of YCP values, key/value pairs
+ * - \ref YCPPath special ordered list of YCP values
+ * - \ref YCPTerm constant structure of YCP values
+ */
#include <ycp/YCPBoolean.h>
#include <ycp/YCPByteblock.h>
#include <ycp/YCPCode.h>
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/Makefile.am (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/Makefile.am Thu Jan 29 08:58:52 2009
@@ -19,11 +19,12 @@
YCPDebugger.h \
Type.h TypePtr.h \
YCPBuiltinBoolean.h YCPBuiltinFloat.h \
- YCPBuiltinByteblock.h \
+ YCPBuiltinByteblock.h YCPBuiltinSymbol.h \
YCPBuiltinInteger.h YCPBuiltinList.h \
YCPBuiltinMap.h YCPBuiltinMisc.h \
YCPBuiltinPath.h YCPBuiltinString.h \
YCPBuiltinTerm.h YCPBuiltinVoid.h \
+ YCPBuiltinMultiset.h \
StaticDeclaration.h \
YCode.h YCodePtr.h \
YCPCode.h \
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/Parser.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/Parser.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/Parser.h Thu Jan 29 08:58:52 2009
@@ -36,7 +36,8 @@
class YBlock;
/**
- * @short YCP parser
+ * @short YCP language parser
+ *
* A YCP parser read a characters stream and outputs a sequence
* of YCP values. Three properties of the YCP grammar are important:
*
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YBlock.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YBlock.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YBlock.h Thu Jan 29 08:58:52 2009
@@ -274,7 +274,7 @@
string toString () const;
string environmentToString () const;
- string toStringSwitch (map<YCPValue, int, ycpless> cases, int defaultcase) const;
+ string toStringSwitch (map<YCPValue, int, ycp_less> cases, int defaultcase) const;
//---------------------------------------------------------------
// stream output
@@ -282,7 +282,7 @@
// write block to stream
std::ostream & toStream (std::ostream & str) const;
std::ostream & toXml( std::ostream & str, int indent ) const;
- std::ostream & toXmlSwitch( map<YCPValue, int, ycpless> cases, int defaultcase, std::ostream & str, int indent ) const;
+ std::ostream & toXmlSwitch( map<YCPValue, int, ycp_less> cases, int defaultcase, std::ostream & str, int indent ) const;
};
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YCPCodeCompare.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YCPCodeCompare.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YCPCodeCompare.h Thu Jan 29 08:58:52 2009
@@ -20,6 +20,7 @@
#include "y2/SymbolEntry.h"
#include "ycp/YCPCode.h"
+#include "ycp/YCPBoolean.h"
#include "ycp/y2log.h"
/**
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YCPList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YCPList.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YCPList.h Thu Jan 29 08:58:52 2009
@@ -10,10 +10,11 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YCPList.h
+ File: YCPList.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Thomas Roelz <tom(a)suse.de>
+ Authors: Mathias Kettner <kettner(a)suse.de>
+ Arvin Schnell <aschnell(a)suse.de>
+ Maintainer: Thomas Roelz <tom(a)suse.de>
/-*/
// -*- c++ -*-
@@ -25,9 +26,9 @@
#include "YCPValue.h"
-
class YCPCodeCompare;
+
/**
* @short List of YCPValues that is a value itself
* In YCP there is no distinction between lists, tuples and structs.
@@ -42,9 +43,19 @@
*/
class YCPListRep : public YCPValueRep
{
- vector<YCPValue> elements;
+private:
+
+ typedef vector<YCPValue> YCPValueList;
+
+ YCPValueList elements;
protected:
+
+ typedef YCPValueList::iterator iterator;
+ typedef YCPValueList::const_iterator const_iterator;
+ typedef YCPValueList::value_type value_type;
+ typedef YCPValueList::const_reference const_reference;
+
friend class YCPList;
/**
@@ -58,6 +69,7 @@
~YCPListRep() {}
public:
+
/**
* Returns the number of elements in the list.
*/
@@ -81,6 +93,13 @@
void add(const YCPValue& value);
/**
+ * Appends a value to the list. Takes over the memory management
+ * of that value. Use @ref YCPElementRep, if you need it
+ * yourself.
+ */
+ void push_back(const YCPValue& value);
+
+ /**
* Sets a value in the list. Takes over the memory management
* of that value. Use @ref YCPElementRep, if you need it
* yourself.
@@ -141,6 +160,18 @@
YCPValue value(int n) const;
/**
+ * Returns a random access iterator for the YCPList that
+ * is positioned at the first value in the list.
+ */
+ const_iterator begin() const;
+
+ /**
+ * Returns a random access iterator for the YCPList that
+ * is positioned behind the last value in the list.
+ */
+ const_iterator end() const;
+
+ /**
* Compares two YCPLists for equality, greaterness or smallerness.
* The relation is lexicographically with respect to the list elements,
* i.e. elementwise comparison up to the shorter length.
@@ -186,6 +217,7 @@
string commaList() const;
};
+
#define CONST_ELEMENT (static_cast<const YCPListRep*>(element))
#define ELEMENT (const_cast<YCPListRep*>(static_cast<const YCPListRep*>(this->writeCopy())))
@@ -198,7 +230,14 @@
class YCPList : public YCPValue
{
DEF_COW_COMMON(List, Value);
+
public:
+
+ typedef YCPListRep::iterator iterator;
+ typedef YCPListRep::const_iterator const_iterator;
+ typedef YCPListRep::value_type value_type;
+ typedef YCPListRep::const_reference const_reference;
+
YCPList() : YCPValue(new YCPListRep()) {}
YCPList(bytecodeistream & str);
@@ -206,6 +245,7 @@
void reserve (int size) { ELEMENT->reserve (size); }
bool isEmpty() const { return CONST_ELEMENT->isEmpty (); }
void add(const YCPValue& value) { ELEMENT->add (value); }
+ void push_back(const YCPValue& value) { ELEMENT->push_back(value); }
void set(const int n, const YCPValue& value) { ELEMENT->set (n, value); }
void remove(const int n) { ELEMENT->remove (n); }
void swap(int x, int y) { ELEMENT->swap (x, y); }
@@ -217,6 +257,8 @@
YCPList functionalAdd(const YCPValue& value, bool prepend = false) const
{ return CONST_ELEMENT->functionalAdd (value, prepend); }
YCPValue value(int n) const { return CONST_ELEMENT->value (n); }
+ const_iterator begin() const { return CONST_ELEMENT->begin(); }
+ const_iterator end() const { return CONST_ELEMENT->end(); }
string commaList() const { return CONST_ELEMENT->commaList (); }
};
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YCPMap.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YCPMap.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YCPMap.h Thu Jan 29 08:58:52 2009
@@ -10,10 +10,11 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YCPMap.h
+ File: YCPMap.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Thomas Roelz <tom(a)suse.de>
+ Authors: Mathias Kettner <kettner(a)suse.de>
+ Arvin Schnell <aschnell(a)suse.de>
+ Maintainer: Thomas Roelz <tom(a)suse.de>
/-*/
// -*- c++ -*-
@@ -26,9 +27,12 @@
#include "ycpless.h"
-typedef map<YCPValue, YCPValue, ycpless> YCPValueYCPValueMap;
+// Only for backwards compatibility. See mail from aschnell on yast-devel on
+// 2009-01-07. http://lists.opensuse.org/yast-devel/2009-01/msg00016.html
+typedef map<YCPValue, YCPValue, ycp_less> YCPValueYCPValueMap;
class YCPMapIterator;
+
/**
* @short A mapping from keys to values.
* A map is also called assiciative array. It is a mapping from a set
@@ -40,9 +44,18 @@
*/
class YCPMapRep : public YCPValueRep
{
+private:
+
YCPValueYCPValueMap stl_map;
protected:
+
+ typedef YCPValueYCPValueMap::iterator iterator;
+ typedef YCPValueYCPValueMap::const_iterator const_iterator;
+ typedef YCPValueYCPValueMap::value_type value_type;
+ typedef YCPValueYCPValueMap::const_reference const_reference;
+ typedef YCPValueYCPValueMap::key_compare key_compare;
+
friend class YCPMap;
/**
@@ -56,6 +69,7 @@
~YCPMapRep() {}
public:
+
/**
* Adds a new key/value pair. If the key is
* existent, the old entry will be overwritten
@@ -82,27 +96,35 @@
void remove(const YCPValue& key);
/**
+ * Returns true, iff this map is empty.
+ */
+ bool isEmpty() const;
+
+ /**
* Returns the number of key/value pairs.
*/
long size() const;
/**
+ * Returns true iff the map contains the key.
+ */
+ bool hasKey(const YCPValue& key) const;
+
+ /**
* Looks for a certain key and returns the value assigned
* to that key. Returns 0, if the key is not found.
*/
YCPValue value(const YCPValue& key) const;
/**
- * Returns a bidirectional STL iterator for the YCPMap that
+ * Returns a bidirectional iterator for the YCPMap that
* is positioned at the first value pair in the map.
- * (suitable for iterating over all entries)
*/
YCPMapIterator begin() const;
/**
- * Returns a bidirectional STL iterator for the YCPMap that
- * is positioned BEHIND the last value pair in the map.
- * (suitable for iterating over all entries)
+ * Returns a bidirectional iterator for the YCPMap that
+ * is positioned behind the last value pair in the map.
*/
YCPMapIterator end() const;
@@ -135,61 +157,18 @@
* Returns YT_MAP. See @ref YCPValueRep#valuetype.
*/
YCPValueType valuetype() const;
-
-
-private:
- /**
- * Searches the map for a given key and returns
- * an iterator that is positioned at the entry found.
- * If the key can not be found the iterator is positioned
- * at end().
- */
- YCPMapIterator findKey(const YCPValue& key) const;
};
-/**
- * @short Iterator for YCPMap values.
- */
-class YCPMapIterator
-{
- friend class YCPMapRep;
-
- YCPValueYCPValueMap::const_iterator position;
-protected:
- YCPMapIterator(YCPValueYCPValueMap::const_iterator position)
- : position(position) {}
-
-public:
- /**
- * Return the key of the current position.
- */
- YCPValue key() const { return position->first; }
-
- /**
- * Return the value of the current position.
- */
- YCPValue value() const { return position->second; }
-
- /**
- * Check for equality.
- */
- friend bool operator==(const YCPMapIterator &x, const YCPMapIterator &y) {
- return x.position == y.position;
- }
-
- /**
- * Check for inequality.
- */
- friend bool operator!=(const YCPMapIterator &x, const YCPMapIterator &y) {
- return !(x == y);
- }
+// Only for backwards compatibility. See mail from aschnell on yast-devel on
+// 2009-01-07. http://lists.opensuse.org/yast-devel/2009-01/msg00016.html
+struct YCPMapIterator : public YCPValueYCPValueMap::const_iterator
+{
+ YCPMapIterator(YCPValueYCPValueMap::const_iterator it)
+ : YCPValueYCPValueMap::const_iterator(it) {}
- /**
- * Advance to the next position.
- */
- void operator++() { ++position; }
- void operator++(int) { ++position; }
+ YCPValue key() const __attribute__ ((deprecated)) { return (*this)->first; }
+ YCPValue value() const __attribute__ ((deprecated)) { return (*this)->second; }
};
@@ -205,14 +184,24 @@
class YCPMap : public YCPValue
{
DEF_COW_COMMON(Map, Value);
+
public:
+
+ typedef YCPMapRep::iterator iterator;
+ typedef YCPMapRep::const_iterator const_iterator;
+ typedef YCPMapRep::value_type value_type;
+ typedef YCPMapRep::const_reference const_reference;
+ typedef YCPMapRep::key_compare key_compare;
+
YCPMap() : YCPValue(new YCPMapRep()) {}
YCPMap(bytecodeistream & str);
void add(const YCPValue& key, const YCPValue& value) { ELEMENT->add (key,value); }
YCPMap functionalAdd(const YCPValue& key, const YCPValue& value) const { return CONST_ELEMENT-> functionalAdd (key,value); }
void remove(const YCPValue& key) { ELEMENT-> remove (key); }
+ bool isEmpty() const { return CONST_ELEMENT->isEmpty(); }
long size() const { return CONST_ELEMENT-> size (); }
+ bool hasKey(const YCPValue& key) const { return CONST_ELEMENT->hasKey(key); }
YCPValue value(const YCPValue& key) const { return CONST_ELEMENT-> value (key); }
YCPMapIterator begin() const { return CONST_ELEMENT-> begin (); }
YCPMapIterator end() const { return CONST_ELEMENT-> end (); }
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YCPString.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YCPString.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YCPString.h Thu Jan 29 08:58:52 2009
@@ -53,6 +53,12 @@
YCPStringRep(string s);
public:
+
+ /**
+ * Returns true, iff this string is empty.
+ */
+ bool isEmpty() const;
+
/**
* Returns the value of this object in form of a C++
* string value.
@@ -94,6 +100,9 @@
YCPValueType valuetype() const;
};
+
+#define CONST_ELEMENT (static_cast<const YCPStringRep*>(element))
+
/**
* @short Wrapper for YCPStringRep
* This class realizes an automatic memory management
@@ -106,7 +115,11 @@
public:
YCPString(string s) : YCPValue(new YCPStringRep(s)) {}
YCPString(bytecodeistream & str);
+
+ bool isEmpty() const { return CONST_ELEMENT->isEmpty(); }
};
+#undef CONST_ELEMENT
+
#endif // YCPString_h
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YCode.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YCode.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YCode.h Thu Jan 29 08:58:52 2009
@@ -21,6 +21,21 @@
#ifndef YCode_h
#define YCode_h
+/**
+ * \page ycplanguage YCP Scripting Language
+ * \todo Enhance
+ *
+ * YCP is a very simple imperative scripting language with builtin support for
+ * \ref ycpvalues, easy access to \ref components, common control structures and more.
+ * It is designed to be well suited for system configuration manipulation.
+ *
+ * YCP interpreter consists of the following parts:
+ * - YCP \ref Parser which parses ASCII representation into in-memory representation (C++ classes
+ * inheriting from the \ref YCode class.
+ * - YCP interpreter - the \ref YCode based classes
+ * - \ref YCP bytecode implementation
+ */
+
#include <string>
using std::string;
@@ -48,7 +63,14 @@
typedef struct ycodelist ycodelist_t;
/**
- * @short YCode for precompiled ycp code
+ * \brief YCode for precompiled ycp code
+ *
+ * A class representing parsed YCP code. This is an abstract base class for implementing
+ * any YCP language feature. \ref kind uniquely identifies the type of the class.
+ * The class provides infrastructure for dumping a bytecode representation (\ref toStream),
+ * XML representation (\ref toXML) and ASCII representation (\ref toString).
+ *
+ * The represented YCP code is executed via invoking \ref evaluate.
*/
class YCode : public Rep
#ifdef D_MEMUSAGE
@@ -132,73 +154,107 @@
YCode ();
/**
- * Cleans up
+ * Destructor
*/
virtual ~YCode();
/**
- * Returns the YCode kind
+ * Kind of this \ref YCode. This method must be reimplemented in the inherited classes.
+ *
+ * \return the YCode kind
*/
virtual ykind kind() const = 0;
/**
- * Returns an ASCII representation of the YCode.
+ * Return ASCII represtation of this YCP code.
+ *
+ * \return ASCII string representation
*/
virtual string toString() const;
+
+ /**
+ * String representation of the YCode kind value. For debugging purposes.
+ *
+ * \param kind which kind representation should be returned
+ * \return string representation
+ */
static string toString(ykind kind);
/**
- * writes YCode to a stream
- * see Bytecode for read
+ * Write YCP code to a byte stream (bytecode implementation). Every
+ * class inheriting from \ref YCode must reimplement this method.
+ * \param str byte stream to store into
+ * \return byte stream for chaining writing bytecode (str)
*/
virtual std::ostream & toStream (std::ostream & str) const = 0;
+
+ /**
+ * Write YCP code as XML representation. Every class inheriting from
+ * \ref YCode must reimplement this method.
+ * \param str string stream to store into
+ * \param indend indentation level for pretty print
+ * \return string stream for chaining writing XML (str)
+ */
virtual std::ostream & toXml (std::ostream & str, int indent ) const = 0;
/**
- * returns true if the YCode represents a constant
+ * Is this code constant?
+ *
+ * \return true if the \ref YCode represents a constant
*/
virtual bool isConstant () const;
/**
- * returns true if the YCode represents an error
+ * Is this code a representation of an error?
+ *
+ * \returns true if the \ref YCode represents an error
*/
bool isError () const;
/**
- * returns true if the YCode represents a statement
+ * Is this a YCP statement (e.g. if, while, ...)
+ *
+ * \return true if the \ref YCode represents a statement
*/
virtual bool isStatement () const;
/**
- * returns true if the YCode represents a block
+ * Is this a YCP block?
+ *
+ * \return true if the \ref YCode represents a block
*/
virtual bool isBlock () const;
/**
- * returns true if the YCode represents something we can reference to
+ * Can this code be stored in a variable of a type reference?
+ *
+ * \return true if the \ref YCode represents something we can reference to
*/
virtual bool isReferenceable () const;
/**
- * evaluate YCode to YCPValue
- * if debugger == 0
- * called for parse time evaluation (i.e. constant subexpression elimination)
- * else
- * called for runtime evaluation
+ * Execute YCP code to get the resulting \ref YCPValue. Every inherited class of YCode should reimplement
+ * this method.
+ *
+ * \return \ref YCPValue after executing the code
+ * \param cse should the evaluation be done for parse time evaluation (i.e. constant subexpression elimination)
*/
virtual YCPValue evaluate (bool cse = false);
/**
- * return type (interesting mostly for function calls)
+ * Return type of this YCP code (interesting mostly for function calls).
+ *
+ * \return type of the value to be returned after calling \ref evaluate
*/
virtual constTypePtr type() const;
};
/**
- * constant (-> YCPValue)
+ * \brief YCP Constant
+ *
+ * The base class for YCP constants (\ref YCPValue).
*/
-
class YConst : public YCode
{
REP_BODY(YConst);
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/YStatement.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/YStatement.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/YStatement.h Thu Jan 29 08:58:52 2009
@@ -516,7 +516,7 @@
int m_defaultcase;
// indices of the case statements in the block
- map<YCPValue, int, ycpless> m_cases;
+ map<YCPValue, int, ycp_less> m_cases;
public:
YSSwitch (YCodePtr condition);
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/pathsearch.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/pathsearch.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/pathsearch.h Thu Jan 29 08:58:52 2009
@@ -97,8 +97,10 @@
*/
static string completeFilename (const string& fname);
-private:
+protected:
+ static bool searchPrefixWarn;
+private:
static int defaultComponentLevel ();
};
Modified: branches/tmp/lslezak/core/libycp/src/include/ycp/ycpless.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/i…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/include/ycp/ycpless.h (original)
+++ branches/tmp/lslezak/core/libycp/src/include/ycp/ycpless.h Thu Jan 29 08:58:52 2009
@@ -10,10 +10,11 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: ycpless.h
+ File: ycpless.h
- Author: Mathias Kettner <kettner(a)suse.de>
- Maintainer: Thomas Roelz <tom(a)suse.de>
+ Authors: Mathias Kettner <kettner(a)suse.de>
+ Arvin Schnell <aschnell(a)suse.de>
+ Maintainer: Thomas Roelz <tom(a)suse.de>
/-*/
// -*- c++ -*-
@@ -23,19 +24,81 @@
#include "YCPValue.h"
-using std::binary_function;
/*
- * global comparison function to be used with STL-Containers as generic
- * ordering operator. Compares two YCPValues and returns
- * true if the first value is less than the second one,
- * false otherwise.
+ * Global comparison functor usable as generic ordering operator for
+ * STL-containers and as predicate for STL-algorithms.
+ *
+ * Compares two YCPValues and returns true if the first value is less than the
+ * second one, false otherwise. Optionally the comparison is locale aware.
*/
+class ycp_less : public std::binary_function<YCPValue, YCPValue, bool>
+{
+
+public:
+
+ ycp_less(bool respect_locale = false) : respect_locale(respect_locale) {}
+
+ bool operator()(const YCPValue& x, const YCPValue& y) const
+ {
+ return x->compare(y, respect_locale) == YO_LESS;
+ }
+
+private:
+
+ const bool respect_locale;
+
+};
+
+
+/*
+ * Global comparison functor usable as predicate for STL-algorithms.
+ *
+ * Compares two YCPValues and returns true if they are equal, false otherwise.
+ * Optionally the comparison is locale aware.
+ */
+class ycp_equal_to : public std::binary_function<YCPValue, YCPValue, bool>
+{
+
+public:
+
+ ycp_equal_to(bool respect_locale = false) : respect_locale(respect_locale) {}
-struct ycpless : public binary_function<YCPValue, YCPValue, bool>
+ bool operator()(const YCPValue& x, const YCPValue& y) const
+ {
+ return x->compare(y, respect_locale) == YO_EQUAL;
+ }
+
+private:
+
+ const bool respect_locale;
+
+};
+
+
+/*
+ * Global comparison functor usable as predicate for STL-algorithms.
+ *
+ * Compares two YCPValues and returns true if they are not equal, false
+ * otherwise. Optionally the comparison is locale aware.
+ */
+class ycp_not_equal_to : public std::binary_function<YCPValue, YCPValue, bool>
{
- bool operator()(const YCPValue& x, const YCPValue& y)
- const { return x->compare(y) == YO_LESS; };
+
+public:
+
+ ycp_not_equal_to(bool respect_locale = false) : respect_locale(respect_locale) {}
+
+ bool operator()(const YCPValue& x, const YCPValue& y) const
+ {
+ return x->compare(y, respect_locale) != YO_EQUAL;
+ }
+
+private:
+
+ const bool respect_locale;
+
};
+
#endif // ycpless_h
Modified: branches/tmp/lslezak/core/libycp/src/pathsearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/src/p…
==============================================================================
--- branches/tmp/lslezak/core/libycp/src/pathsearch.cc (original)
+++ branches/tmp/lslezak/core/libycp/src/pathsearch.cc Thu Jan 29 08:58:52 2009
@@ -48,6 +48,7 @@
static const int NUM_LEVELS = sizeof (paths) / sizeof (paths[0]);
+bool Y2PathSearch::searchPrefixWarn = true;
int
Y2PathSearch::numberOfComponentLevels ()
@@ -178,6 +179,11 @@
pathname = completeFilename (pathname + filename);
if (access (pathname.c_str(), mode) == 0)
{
+ // FIXME: this check is different for clients and for modules - see find
+ if( searchPrefixWarn && i != NUM_LEVELS-1 )
+ {
+ y2warning( "Using special search prefix '%s' for '%s'",searchPath (GENERIC, i).c_str(), pathname.c_str() );
+ }
return pathname;
}
}
@@ -278,6 +284,8 @@
const char *home = getenv ("HOME");
const char *y2dir = getenv ("Y2DIR");
+ searchPrefixWarn = (getenv ("Y2SILENTSEARCH") == NULL);
+
addPath (kind, string (YAST2DIR) + suffix);
if (home)
{
@@ -329,6 +337,10 @@
if (access (pathname.c_str(), R_OK) == 0)
{
y2debug ("... success");
+ // FIXME: this check is different for clients and for modules - see findy2
+ if( searchPrefixWarn && *i != kindList.back () ) {
+ y2warning( "Using special search prefix '%s' for '%s'", i->c_str(), pathname.c_str() );
+ }
return pathname;
}
Modified: branches/tmp/lslezak/core/libycp/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/Makefile.am (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/Makefile.am Thu Jan 29 08:58:52 2009
@@ -14,13 +14,13 @@
noinst_PROGRAMS = testSignature runc runycp
runc_SOURCES = runc.cc
-runc_LDADD = ../src/libycp.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
+runc_LDADD = ../src/libycp.la ../src/libycpvalues.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
runycp_SOURCES = runycp.cc
-runycp_LDADD = ../src/libycp.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
+runycp_LDADD = ../src/libycp.la ../src/libycpvalues.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
testSignature_SOURCES = testSignature.cc
-testSignature_LDADD = ../src/libycp.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
+testSignature_LDADD = ../src/libycp.la ../src/libycpvalues.la ../../liby2/src/liby2.la ${Y2UTIL_LIBS}
PACKAGE=libycp
Modified: branches/tmp/lslezak/core/libycp/testsuite/runtest.sh
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
Binary files - no diff available.
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Float.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Float.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Float.ycp Thu Jan 29 08:58:52 2009
@@ -1,7 +1,7 @@
# ---------------------------------------------------------
#
-# Filename: Builtin-Integer.ycp
+# Filename: Builtin-Float.ycp
#
# Purpose: test cases for all float builtins
#
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.err (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.err Thu Jan 29 08:58:52 2009
@@ -141,7 +141,7 @@
----------------------------------------------------------------------
list::reduce (integer x, integer y, [], { return (x + y); })
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-List.ycp:73 Empty list [] for 'reduce'
+[Interpreter] tests/builtin/Builtin-List.ycp:73 Empty list for 'reduce'
Parsed:
----------------------------------------------------------------------
list::reduce (integer x, integer y, 0, [], { return (x + y); })
@@ -158,7 +158,7 @@
----------------------------------------------------------------------
list::reduce (integer x, integer y, [], { return (x * y); })
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-List.ycp:78 Empty list [] for 'reduce'
+[Interpreter] tests/builtin/Builtin-List.ycp:78 Empty list for 'reduce'
Parsed:
----------------------------------------------------------------------
list::reduce (integer x, integer y, 1, [], { return (x * y); })
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List.ycp Thu Jan 29 08:58:52 2009
@@ -83,3 +83,4 @@
(list::reduce (term t, float f, `item(`id(`dummy)), [], { return add(t, tostring(f)); }))
(list::reduce (term t, float f, `item(`id(`dummy)), [3.14, 2.71], { return add(t, tostring(f)); }))
+
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.err (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.err Thu Jan 29 08:58:52 2009
@@ -124,6 +124,23 @@
----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
+"** isempty **"
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty ([])
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty ([1, 2, 3])
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty (nil)
+----------------------------------------------------------------------
+[Interpreter] tests/builtin/Builtin-List2.ycp:72 Argument (nil) to isempty(...) is nil
+Parsed:
+----------------------------------------------------------------------
"** size **"
----------------------------------------------------------------------
Parsed:
@@ -166,12 +183,12 @@
----------------------------------------------------------------------
"** change **"
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:90 Warning: change(...) is deprecated, please fix
+[Parser] tests/builtin/Builtin-List2.ycp:97 Warning: change(...) is deprecated, please fix
Parsed:
----------------------------------------------------------------------
change ([1, 4], 8)
----------------------------------------------------------------------
-[libycp] tests/builtin/Builtin-List2.ycp:90 Change does not work as expected! The argument is not passed by reference.
+[libycp] tests/builtin/Builtin-List2.ycp:97 Change does not work as expected! The argument is not passed by reference.
Parsed:
----------------------------------------------------------------------
"** remove **"
@@ -184,34 +201,34 @@
----------------------------------------------------------------------
remove ([], 0)
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-List2.ycp:96 Index 0 for remove () out of range
+[Interpreter] tests/builtin/Builtin-List2.ycp:103 Index 0 for remove () out of range
Parsed:
----------------------------------------------------------------------
"** select **"
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:101 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-List2.ycp:108 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
[1, 2][-1]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:102 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-List2.ycp:109 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
[1, 2][0]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:103 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-List2.ycp:110 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
[1, 2][1]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:104 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-List2.ycp:111 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
[1, 2][3]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-List2.ycp:105 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-List2.ycp:112 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> string */[1, "two"][0]:"wrong type"
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-List2.ycp:96 Can't convert value '1' to type 'string'
+[Interpreter] tests/builtin/Builtin-List2.ycp:103 Can't convert value '1' to type 'string'
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.out (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.out Thu Jan 29 08:58:52 2009
@@ -27,6 +27,10 @@
([true, 1, 1, 2])
([8, 6, 3, 2])
([8, 6, 3, 2])
+("** isempty **")
+(true)
+(false)
+(nil)
("** size **")
(0)
(3)
@@ -41,7 +45,7 @@
([1, 4, 8])
("** remove **")
([2])
-(nil)
+([])
("** select **")
(42)
(1)
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-List2.ycp Thu Jan 29 08:58:52 2009
@@ -65,6 +65,13 @@
(sort (`x, `y, [ 3, 6, 2, 8 ], ``(x>y)))
+("** isempty **")
+
+(isempty ([]))
+(isempty ([1, 2, 3]))
+(isempty ((list) nil))
+
+
("** size **")
(size ([]))
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map.ycp Thu Jan 29 08:58:52 2009
@@ -75,6 +75,13 @@
(add ($[`a: 17, `b: 11], `b, nil))
+("** isempty **")
+
+(isempty ($[]))
+(isempty ($[1:"a", 2:"b"]))
+(isempty ((map) nil))
+
+
("** size **")
(size ($[]))
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map3.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map3.out (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-Map3.out Thu Jan 29 08:58:52 2009
@@ -3,7 +3,7 @@
(0)
(2)
("** remove **")
-(nil)
+($[1:2])
($[])
($[3:4])
("** change **")
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.err (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.err Thu Jan 29 08:58:52 2009
@@ -1,5 +1,22 @@
Parsed:
----------------------------------------------------------------------
+"** isempty **"
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty ("")
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty ("linux")
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+isempty (nil)
+----------------------------------------------------------------------
+[Interpreter] tests/builtin/Builtin-String.ycp:15 Argument (nil) to isempty(...) is nil
+Parsed:
+----------------------------------------------------------------------
"** size **"
----------------------------------------------------------------------
Parsed:
@@ -12,6 +29,11 @@
----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
+size (nil)
+----------------------------------------------------------------------
+[Interpreter] tests/builtin/Builtin-String.ycp:22 Argument (nil) to size(...) is nil
+Parsed:
+----------------------------------------------------------------------
"** plus **"
----------------------------------------------------------------------
Parsed:
@@ -94,7 +116,7 @@
----------------------------------------------------------------------
substring ("some text", 42)
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-String.ycp:48 Substring index out of range
+[Interpreter] tests/builtin/Builtin-String.ycp:56 Substring index out of range
Parsed:
----------------------------------------------------------------------
substring ("some text", 5, 2)
@@ -103,7 +125,37 @@
----------------------------------------------------------------------
substring ("some text", 42, 2)
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-String.ycp:51 Substring index out of range
+[Interpreter] tests/builtin/Builtin-String.ycp:59 Substring index out of range
+Parsed:
+----------------------------------------------------------------------
+"** lsubstring **"
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("some text", 5)
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("some text", 42)
+----------------------------------------------------------------------
+[Interpreter] tests/builtin/Builtin-String.ycp:65 Substring index out of range
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("ÄÅ¡ÄÅžýáÃ", 5)
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("some text", 5, 2)
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("some text", 42, 2)
+----------------------------------------------------------------------
+[Interpreter] tests/builtin/Builtin-String.ycp:69 Substring index out of range
+Parsed:
+----------------------------------------------------------------------
+lsubstring ("ÄÅ¡ÄÅžýáÃ", 5, 2)
+----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
"** mergestring **"
@@ -116,9 +168,9 @@
----------------------------------------------------------------------
mergestring (["abc", "dev", "ghi", ""], "/")
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-String.ycp:58 No match for 'mergestring : <unspec> (list, string)'
-[Parser] tests/builtin/Builtin-String.ycp:58 Please fix parameter types to match one of:
-[Parser] tests/builtin/Builtin-String.ycp:58 'mergestring : string (const list <string>, string)'
-[Parser] tests/builtin/Builtin-String.ycp:58 Wrong parameters in call to mergestring(...)
-[Parser] tests/builtin/Builtin-String.ycp:58 Expected '(const list <string>, string)', seen '(list, string)'.
+[Parser] tests/builtin/Builtin-String.ycp:77 No match for 'mergestring : <unspec> (list, string)'
+[Parser] tests/builtin/Builtin-String.ycp:77 Please fix parameter types to match one of:
+[Parser] tests/builtin/Builtin-String.ycp:77 'mergestring : string (const list <string>, string)'
+[Parser] tests/builtin/Builtin-String.ycp:77 Wrong parameters in call to mergestring(...)
+[Parser] tests/builtin/Builtin-String.ycp:77 Expected '(const list <string>, string)', seen '(list, string)'.
runycp: parser error
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.out (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.out Thu Jan 29 08:58:52 2009
@@ -1,6 +1,11 @@
+("** isempty **")
+(true)
+(false)
+(nil)
("** size **")
(0)
(5)
+(nil)
("** plus **")
("YaST2")
("YaST2")
@@ -22,6 +27,13 @@
("")
("te")
("")
+("** lsubstring **")
+("text")
+("")
+("ýáÃ")
+("te")
+("")
+("ýá")
("** mergestring **")
("/abc/dev/ghi")
("abc/dev/ghi/")
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-String.ycp Thu Jan 29 08:58:52 2009
@@ -8,10 +8,18 @@
# ---------------------------------------------------------
+("** isempty **")
+
+(isempty (""))
+(isempty ("linux"))
+(isempty ((string) nil))
+
+
("** size **")
(size (""))
(size ("linux"))
+(size ((string) nil))
("** plus **")
@@ -51,6 +59,17 @@
(substring ("some text", 42, 2))
+("** lsubstring **")
+
+(lsubstring ("some text", 5))
+(lsubstring ("some text", 42))
+(lsubstring ("ÄÅ¡ÄÅžýáÃ", 5))
+
+(lsubstring ("some text", 5, 2))
+(lsubstring ("some text", 42, 2))
+(lsubstring ("ÄÅ¡ÄÅžýáÃ", 5, 2))
+
+
("** mergestring **")
(mergestring (["", "abc", "dev", "ghi"], "/"))
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-remove.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-remove.out (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin-remove.out Thu Jan 29 08:58:52 2009
@@ -1 +1 @@
-(nil)
+($[])
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.err (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.err Thu Jan 29 08:58:52 2009
@@ -12,7 +12,7 @@
----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
-remove ([1, 2, 3], 3)
+(remove ([1, 2, 3], 3) == [1, 2, 3])
----------------------------------------------------------------------
[Interpreter] tests/builtin/Builtin_X.ycp:4 Index 3 for remove () out of range
Parsed:
@@ -33,6 +33,6 @@
----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
-remove (`HBox (1, 2, 3), 4)
+(remove (`HBox (1, 2, 3), 4) == `HBox (1, 2, 3))
----------------------------------------------------------------------
[Interpreter] tests/builtin/Builtin_X.ycp:10 Index 4 for remove () out of range
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.out (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.out Thu Jan 29 08:58:52 2009
@@ -1,9 +1,9 @@
(true)
(true)
(true)
-(nil)
(true)
(true)
(true)
(true)
-(nil)
+(true)
+(true)
Modified: branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/libycp/tests…
==============================================================================
--- branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.ycp (original)
+++ branches/tmp/lslezak/core/libycp/testsuite/tests/builtin/Builtin_X.ycp Thu Jan 29 08:58:52 2009
@@ -1,10 +1,10 @@
( remove([1,2,3],0) == [2,3] )
( remove([1,2,3],1) == [1,3] )
( remove([1,2,3],2) == [1,2] )
-remove([1,2,3],3) // error
+( remove([1,2,3],3) == [1,2,3] ) // error
// OLD: ( remove(`HBox(1,2,3),0) == [1,2,3] )
( argsof(`HBox(1,2,3)) == [1,2,3] )
( remove(`HBox(1,2,3),1) == `HBox(2,3) )
( remove(`HBox(1,2,3),2) == `HBox(1,3) )
( remove(`HBox(1,2,3),3) == `HBox(1,2) )
-remove(`HBox(1,2,3),4) // error
+( remove(`HBox(1,2,3),4) == `HBox(1,2,3) ) // error
Modified: branches/tmp/lslezak/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/package/yast…
==============================================================================
--- branches/tmp/lslezak/core/package/yast2-core.changes (original)
+++ branches/tmp/lslezak/core/package/yast2-core.changes Thu Jan 29 08:58:52 2009
@@ -1,4 +1,166 @@
-------------------------------------------------------------------
+Mon Jan 26 14:00:31 CET 2009 - mvidner(a)suse.cz
+
+- Fixed the D-Bus access policy (bnc#468390, CVE-2008-4311).
+- 2.18.2
+
+-------------------------------------------------------------------
+Thu Jan 08 19:01:01 CET 2009 - aschnell(a)suse.de
+
+- added namespace multiset with 1. some list function, 2. some new
+ functions and 3. extended testsuite
+- 2.18.1
+
+-------------------------------------------------------------------
+Wed Jan 07 15:17:23 CET 2009 - aschnell(a)suse.de
+
+- improved YCPList and YCPMap iterators
+
+-------------------------------------------------------------------
+Mon Jan 5 15:20:56 CET 2009 - visnov(a)suse.cz
+
+- match WFM component name and component creator instance
+- improve main page for doxygen
+
+-------------------------------------------------------------------
+Mon Dec 22 13:16:02 CET 2008 - mvidner(a)suse.cz
+
+- Reverted r50800 which, in an attempt to fix another bug, encoded to
+ UTF-8 once too many, breaking i18n going thru Perl agents (bnc#448217).
+
+-------------------------------------------------------------------
+Sat Dec 20 10:45:55 CET 2008 - aschnell(a)suse.de
+
+- added tosymbol builtin (bnc #192389)
+- added isempty builtin for string, list and map
+- 2.18.0
+
+-------------------------------------------------------------------
+Thu Dec 11 15:06:31 CET 2008 - lslezak(a)suse.cz
+
+- tty_wrapper - fixed a deadlock in tty setting (set the terminal
+ properties _before_ starting the subprocess) (bnc#458025)
+- 2.17.25
+
+-------------------------------------------------------------------
+Tue Dec 9 13:20:49 CET 2008 - lslezak(a)suse.cz
+
+- SCR DBus service - check for the global permissions at first
+ (all method parameters are allowed) then for specific ones,
+ added .policy file with the default values (bnc#449794)
+- 2.17.24
+
+-------------------------------------------------------------------
+Thu Nov 27 15:22:59 CET 2008 - lslezak(a)suse.cz
+
+- tty_wrapper - disable LF to CRLF translation on the stdout stream
+ (bnc#444228)
+- 2.17.23
+
+-------------------------------------------------------------------
+Wed Nov 26 14:04:27 CET 2008 - visnov(a)suse.cz
+
+- added lsubstring builtin (bnc#446996)
+- 2.17.22
+
+-------------------------------------------------------------------
+Sun Nov 9 15:35:43 CET 2008 - lslezak(a)suse.cz
+
+- added 'tty_wrapper' binary to start a yast module in commandline
+ mode without a tty device (bnc#444228)
+- 2.17.21
+
+-------------------------------------------------------------------
+Mon Nov 3 11:55:50 CET 2008 - lslezak(a)suse.cz
+
+- fixed testing of the result of polkit_caller_new_from_dbus_name()
+ call which sometime sets the error object even when there is no
+ real error (bnc#439150)
+- 2.17.20
+
+-------------------------------------------------------------------
+Fri Oct 24 15:54:54 CEST 2008 - visnov(a)suse.cz
+
+- Also print diff when agent-process testsuite fails
+- 2.17.19
+
+-------------------------------------------------------------------
+Tue Oct 14 16:38:26 CEST 2008 - mvidner(a)suse.cz
+
+- Avoid YCPNull reaching SCR agents to prevent crashes (bnc#406138).
+- Allow make check before make install again, after libycpvalues API
+ changed in 2.17.15.
+- 2.17.18
+
+-------------------------------------------------------------------
+Tue Oct 14 14:41:34 CEST 2008 - lslezak(a)suse.cz
+
+- use atomic type sig_atomic_t in signal handlers (bnc#434509)
+
+-------------------------------------------------------------------
+Sat Oct 11 12:30:03 CEST 2008 - mvidner(a)suse.cz
+
+- Handle EINTR in YCP scanner. Makes possible to toggle
+ debugging via SIGUSR1 to 'y2base stdio scr' (bnc#434253).
+- 2.17.17
+
+-------------------------------------------------------------------
+Tue Oct 7 14:27:00 CEST 2008 - visnov(a)suse.cz
+
+- change remove builtin behavior to saner one (bnc #396697)
+- more documentation updates
+- 2.17.16
+
+-------------------------------------------------------------------
+Mon Sep 29 23:03:10 CEST 2008 - visnov(a)suse.cz
+
+- YCP values overview page added to docs
+
+-------------------------------------------------------------------
+Fri Sep 26 16:09:22 CEST 2008 - visnov(a)suse.cz
+
+- new builtins: list::difference, list::symmetric_difference,
+ list::intersection, list::union (aschnell, bnc #58844)
+- 2.17.15
+
+-------------------------------------------------------------------
+Fri Sep 26 12:17:35 CEST 2008 - visnov(a)suse.cz
+
+- allow clients to return exit code (bnc #350740)
+- clean up documentation in liby2
+- 2.17.14
+
+-------------------------------------------------------------------
+Thu Sep 25 12:21:34 CEST 2008 - visnov(a)suse.cz
+
+- support SCR::RegisterAgent and SCR::UnregisterAgent in chroot
+ (bnc #425472)
+- 2.17.13
+
+-------------------------------------------------------------------
+Wed Sep 17 15:49:42 CEST 2008 - visnov(a)suse.cz
+
+- Warn to log if using non-standard place for loading modules
+- 2.17.12
+
+-------------------------------------------------------------------
+Tue Sep 9 15:49:07 CEST 2008 - visnov(a)suse.cz
+
+- Added y2useritem and y2usernote builtins for user-level
+ action log (Fate #100386)
+
+-------------------------------------------------------------------
+Tue Sep 9 11:39:07 CEST 2008 - locilka(a)suse.cz
+
+- Adjusted STDOUT in ycp.pm to use 'utf8'.
+
+-------------------------------------------------------------------
+Fri Sep 5 13:59:32 CEST 2008 - locilka(a)suse.cz
+
+- Added WFM::ClientExists function (needed for installation).
+- 2.17.10
+
+-------------------------------------------------------------------
Wed Aug 27 12:13:27 CEST 2008 - locilka(a)suse.cz
- Enabled getenv builtin.
Modified: branches/tmp/lslezak/core/scr/src/ScriptingAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/scr/src/Scri…
==============================================================================
--- branches/tmp/lslezak/core/scr/src/ScriptingAgent.cc (original)
+++ branches/tmp/lslezak/core/scr/src/ScriptingAgent.cc Thu Jan 29 08:58:52 2009
@@ -284,6 +284,18 @@
{
return UnmountAllAgents ();
}
+ else if (sym == "RegisterAgent"
+ && term->size () == 2
+ && term->value (0)->isPath ())
+ {
+ return RegisterAgent (term->value (0)->asPath (), term->value (1));
+ }
+ else if (sym == "UnregisterAgent"
+ && term->size () == 1
+ && term->value (0)->isPath ())
+ {
+ return UnregisterAgent (term->value (0)->asPath ());
+ }
else if (sym == "YaST2Version" || sym == "SuSEVersion")
{
// SuSEVersion is the older name (for historic reasons)
Modified: branches/tmp/lslezak/core/scr/src/StdioSCRAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/scr/src/Stdi…
==============================================================================
--- branches/tmp/lslezak/core/scr/src/StdioSCRAgent.cc (original)
+++ branches/tmp/lslezak/core/scr/src/StdioSCRAgent.cc Thu Jan 29 08:58:52 2009
@@ -159,6 +159,63 @@
}
+YCPBoolean
+StdioSCRAgent::RegisterAgent (const YCPPath& path, const YCPValue& value) {
+ if (! m_handler)
+ return YCPNull ();
+
+ y2debug( "This is StdioSCRAgent(%p)::RegisterAgent", this );
+
+ YCPTerm r ( "RegisterAgent" );
+ r.add (path);
+ r.add (value);
+
+ YCPValue v = m_handler->evaluate (r);
+
+ if (v.isNull())
+ {
+ ycp2error ("SCR::RegisterAgent() failed");
+ return YCPNull ();
+ }
+ if (!v->isBoolean ())
+ {
+ ycp2error ("SCR::RegisterAgent() did not return a boolean (%s)", v->toString().c_str());
+ return YCPNull ();
+ }
+
+ return v->asBoolean();
+}
+
+
+
+YCPBoolean
+StdioSCRAgent::UnregisterAgent (const YCPPath& path) {
+ if (! m_handler)
+ return YCPNull ();
+
+ y2debug( "This is StdioSCRAgent(%p)::UnregisterAgent", this );
+
+ YCPTerm r ( "UnregisterAgent" );
+ r.add (path);
+
+ YCPValue v = m_handler->evaluate (r);
+
+ if (v.isNull())
+ {
+ ycp2error ("SCR::UnregisterAgent() failed");
+ return YCPNull ();
+ }
+ if (!v->isBoolean ())
+ {
+ ycp2error ("SCR::UnregisterAgent() did not return a boolean (%s)", v->toString().c_str());
+ return YCPNull ();
+ }
+
+ return v->asBoolean();
+}
+
+
+
YCPValue
StdioSCRAgent::otherCommand (const YCPTerm &term)
{
Modified: branches/tmp/lslezak/core/scr/src/StdioSCRAgent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/scr/src/Stdi…
==============================================================================
--- branches/tmp/lslezak/core/scr/src/StdioSCRAgent.h (original)
+++ branches/tmp/lslezak/core/scr/src/StdioSCRAgent.h Thu Jan 29 08:58:52 2009
@@ -56,8 +56,17 @@
virtual YCPMap Error (const YCPPath &path);
/**
- * Handle the commands 'UnregisterAgent',
- * 'UnregisterAllAgents', 'MountAgent', 'MountAllAgents',
+ * Register an agent
+ */
+ virtual YCPBoolean RegisterAgent (const YCPPath& path, const YCPValue& value);
+
+ /**
+ * Unregister an agent
+ */
+ virtual YCPBoolean UnregisterAgent (const YCPPath& path);
+
+ /**
+ * Handle the commands 'UnregisterAllAgents', 'MountAgent', 'MountAllAgents',
* 'UnmountAgent' and 'UnmountAllAgents'.
*/
YCPValue otherCommand (const YCPTerm &term);
Modified: branches/tmp/lslezak/core/wfm/src/WFM.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/wfm/src/WFM.…
==============================================================================
--- branches/tmp/lslezak/core/wfm/src/WFM.cc (original)
+++ branches/tmp/lslezak/core/wfm/src/WFM.cc Thu Jan 29 08:58:52 2009
@@ -74,6 +74,12 @@
return Y2WFMComponent::instance ()->CallFunction (name);
}
+static YCPBoolean
+WFMClientExists (const YCPString& name)
+{
+ return Y2WFMComponent::instance ()->ClientExists (name);
+}
+
static YCPValue
WFMCallFunction1 (const YCPString& name, const YCPList& args)
{
@@ -185,6 +191,7 @@
{ "Write", "boolean (path, any, any)", (void*)WFMWrite3},
{ "Write", "boolean (path, any)", (void*)WFMWrite2},
{ "Execute", "any (path, any)", (void*)WFMExecute},
+ { "ClientExists", "boolean (string)", (void*)WFMClientExists},
{ 0 }
};
Modified: branches/tmp/lslezak/core/wfm/src/Y2CCWFM.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/wfm/src/Y2CC…
==============================================================================
--- branches/tmp/lslezak/core/wfm/src/Y2CCWFM.cc (original)
+++ branches/tmp/lslezak/core/wfm/src/Y2CCWFM.cc Thu Jan 29 08:58:52 2009
@@ -213,4 +213,4 @@
}
-Y2CCWFM g_y2ccWFM;
+Y2CCWFM g_y2ccwfm;
Modified: branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/wfm/src/Y2WF…
==============================================================================
--- branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.cc (original)
+++ branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.cc Thu Jan 29 08:58:52 2009
@@ -627,6 +627,44 @@
}
+YCPBoolean
+Y2WFMComponent::ClientExists (const YCPString& client)
+{
+ /**
+ * @builtin ClientExists
+ * @short Checks whether a YCP client exists
+ * @param string name client name
+ *
+ * @description
+ * This is similar to 'call' or 'CallFunction' but client is only
+ * checked for existence and not executed. If client exists
+ * 'true' is returned, otherwise 'false'.
+ *
+ * @usage ClientExists ("inst_mouse") -> true
+ * @usage ClientExists ("missing_client") -> false
+ * @return boolean whether client exists
+ */
+
+ string new_modulename = client->value ();
+
+ if (client.isNull() || new_modulename == "")
+ {
+ y2error ("Client name not defined %s", new_modulename.c_str());
+ return YCPBoolean (false);
+ }
+
+ // try loading a client via Y2ComponentBroker
+ Y2Component* client_comp = Y2ComponentBroker::createClient (new_modulename.c_str ());
+ if (client_comp)
+ {
+ return YCPBoolean (true);
+ }
+ else
+ {
+ return YCPBoolean (false);
+ }
+}
+
YCPValue
Y2WFMComponent::CallFunction (const YCPString& client, const YCPList& args)
{
Modified: branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/wfm/src/Y2WF…
==============================================================================
--- branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.h (original)
+++ branches/tmp/lslezak/core/wfm/src/Y2WFMComponent.h Thu Jan 29 08:58:52 2009
@@ -72,6 +72,7 @@
YCPValue Execute (const YCPPath &path, const YCPValue& arg1);
YCPValue CallFunction (const YCPString& client, const YCPList& args = YCPList ());
YCPString GetEnvironmentEncoding ();
+ YCPBoolean ClientExists (const YCPString& client);
virtual Y2Namespace* import (const char* name_space);
Modified: branches/tmp/lslezak/core/wfm/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/wfm/testsuit…
==============================================================================
--- branches/tmp/lslezak/core/wfm/testsuite/Makefile.am (original)
+++ branches/tmp/lslezak/core/wfm/testsuite/Makefile.am Thu Jan 29 08:58:52 2009
@@ -25,7 +25,8 @@
$(top_builddir)/scr/src/libpy2scr.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
- $(top_builddir)/liby2/src/liby2.la \
+ $(top_builddir)/libycp/src/libycpvalues.la \
+ $(top_builddir)/liby2/src/liby2.la \
${Y2UTIL_LIBS}
runc_SOURCES = runc.cc
@@ -34,6 +35,7 @@
$(top_builddir)/scr/src/libpy2scr.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
+ $(top_builddir)/libycp/src/libycpvalues.la \
$(top_builddir)/liby2/src/liby2.la \
${Y2UTIL_LIBS}
Modified: branches/tmp/lslezak/core/yast2-core.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/yast2-core.s…
==============================================================================
--- branches/tmp/lslezak/core/yast2-core.spec.in (original)
+++ branches/tmp/lslezak/core/yast2-core.spec.in Thu Jan 29 08:58:52 2009
@@ -84,6 +84,7 @@
%{_libdir}/lib*.so.*
@ybindir@/y2base
@ybindir@/startshell
+@ybindir@/tty_wrapper
@ybindir@/md_autorun
@ybindir@/elf-arch
@plugindir@/lib*.so.*
@@ -105,6 +106,8 @@
# DBus service config
/usr/share/dbus-1/system-services/org.opensuse.yast.SCR.service
/etc/dbus-1/system.d/org.opensuse.yast.SCR.conf
+# PolicyKit default policies
+/usr/share/PolicyKit/policy/org.opensuse.yast.scr.policy
%files devel
%defattr(-,root,root)
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55131 - /tags/branch-Code-11-2_17_58/packager/
by lslezak@svn.opensuse.org 28 Jan '09
by lslezak@svn.opensuse.org 28 Jan '09
28 Jan '09
Author: lslezak
Date: Wed Jan 28 17:17:11 2009
New Revision: 55131
URL: http://svn.opensuse.org/viewcvs/yast?rev=55131&view=rev
Log:
Created tag branch-Code-11-2_17_58 for packager
Added:
tags/branch-Code-11-2_17_58/packager/
- copied from r55130, branches/SuSE-Code-11-Branch/packager/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
28 Jan '09
Author: lslezak
Date: Wed Jan 28 17:17:09 2009
New Revision: 55130
URL: http://svn.opensuse.org/viewcvs/yast?rev=55130&view=rev
Log:
Created tag branch-Code-11-2_17_58
Added:
tags/branch-Code-11-2_17_58/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55129 - in /branches/SuSE-Code-11-Branch/packager: VERSION package/yast2-packager.changes src/modules/Packages.ycp
by lslezak@svn.opensuse.org 28 Jan '09
by lslezak@svn.opensuse.org 28 Jan '09
28 Jan '09
Author: lslezak
Date: Wed Jan 28 17:17:00 2009
New Revision: 55129
URL: http://svn.opensuse.org/viewcvs/yast?rev=55129&view=rev
Log:
- do not remove kernel-xenpae package at update, it can be
installed together with the standard kernel (bnc#468674)
- 2.17.58
Modified:
branches/SuSE-Code-11-Branch/packager/VERSION
branches/SuSE-Code-11-Branch/packager/package/yast2-packager.changes
branches/SuSE-Code-11-Branch/packager/src/modules/Packages.ycp
Modified: branches/SuSE-Code-11-Branch/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/packager/…
==============================================================================
--- branches/SuSE-Code-11-Branch/packager/VERSION (original)
+++ branches/SuSE-Code-11-Branch/packager/VERSION Wed Jan 28 17:17:00 2009
@@ -1 +1 @@
-2.17.57
+2.17.58
Modified: branches/SuSE-Code-11-Branch/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/packager/…
==============================================================================
--- branches/SuSE-Code-11-Branch/packager/package/yast2-packager.changes (original)
+++ branches/SuSE-Code-11-Branch/packager/package/yast2-packager.changes Wed Jan 28 17:17:00 2009
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Jan 28 17:06:48 CET 2009 - lslezak(a)suse.cz
+
+- do not remove kernel-xenpae package at update, it can be
+ installed together with the standard kernel (bnc#468674)
+- 2.17.58
+
+-------------------------------------------------------------------
Mon Jan 26 14:06:50 CET 2009 - lslezak(a)suse.cz
- fixed another places logging complete URL including a password
Modified: branches/SuSE-Code-11-Branch/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/packager/…
==============================================================================
--- branches/SuSE-Code-11-Branch/packager/src/modules/Packages.ycp (original)
+++ branches/SuSE-Code-11-Branch/packager/src/modules/Packages.ycp Wed Jan 28 17:17:00 2009
@@ -1855,6 +1855,7 @@
foreach (string one_kernel, kernels_to_be_installed, {
// XEN can be installed in parallel
if (one_kernel == "kernel-xen") return;
+ if (one_kernel == "kernel-xenpae") return;
// don't remove the recommended one
if (one_kernel == recommended_kernel) return;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55128 - in /trunk/packager: package/yast2-packager.changes src/modules/Packages.ycp
by lslezak@svn.opensuse.org 28 Jan '09
by lslezak@svn.opensuse.org 28 Jan '09
28 Jan '09
Author: lslezak
Date: Wed Jan 28 17:13:20 2009
New Revision: 55128
URL: http://svn.opensuse.org/viewcvs/yast?rev=55128&view=rev
Log:
- do not remove kernel-xenpae package at update, it can be
installed together with the standard kernel (bnc#468674)
Modified:
trunk/packager/package/yast2-packager.changes
trunk/packager/src/modules/Packages.ycp
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Wed Jan 28 17:13:20 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 28 17:06:48 CET 2009 - lslezak(a)suse.cz
+
+- do not remove kernel-xenpae package at update, it can be
+ installed together with the standard kernel (bnc#468674)
+
+-------------------------------------------------------------------
Mon Jan 26 14:06:50 CET 2009 - lslezak(a)suse.cz
- fixed another places logging complete URL including a password
Modified: trunk/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.yc…
==============================================================================
--- trunk/packager/src/modules/Packages.ycp (original)
+++ trunk/packager/src/modules/Packages.ycp Wed Jan 28 17:13:20 2009
@@ -1855,6 +1855,7 @@
foreach (string one_kernel, kernels_to_be_installed, {
// XEN can be installed in parallel
if (one_kernel == "kernel-xen") return;
+ if (one_kernel == "kernel-xenpae") return;
// don't remove the recommended one
if (one_kernel == recommended_kernel) return;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
28 Jan '09
Author: locilka
Date: Wed Jan 28 17:10:35 2009
New Revision: 55127
URL: http://svn.opensuse.org/viewcvs/yast?rev=55127&view=rev
Log:
Created tag stable-2_18_3 for installation
Added:
tags/stable-2_18_3/installation/
- copied from r55126, trunk/installation/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r55126 - /trunk/installation/src/clients/inst_finish.ycp
by locilka@svn.opensuse.org 28 Jan '09
by locilka@svn.opensuse.org 28 Jan '09
28 Jan '09
Author: locilka
Date: Wed Jan 28 17:09:53 2009
New Revision: 55126
URL: http://svn.opensuse.org/viewcvs/yast?rev=55126&view=rev
Log:
Final SlideShow update for now
Modified:
trunk/installation/src/clients/inst_finish.ycp
Modified: trunk/installation/src/clients/inst_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_fi…
==============================================================================
--- trunk/installation/src/clients/inst_finish.ycp (original)
+++ trunk/installation/src/clients/inst_finish.ycp Wed Jan 28 17:09:53 2009
@@ -90,9 +90,13 @@
SlideShow::OpenDialog();
}
+ // Might be left from the previous stage
+ SlideShow::HideTable();
+
SlideShow::MoveToStage("finish");
string log = _("Creating list of finish scripts to call...");
+ SlideShow::SubProgress (0, "");
SlideShow::StageProgress (0, log);
SlideShow::AppendMessageToInstLog (log);
@@ -251,7 +255,14 @@
integer steps_count = 0;
+integer stages_to_check = size (stages);
+integer currently_checking = 0;
+
stages = maplist (map<string,any> stage, stages, {
+ currently_checking = currently_checking + 1;
+ SlideShow::SubProgress (100 * currently_checking / stages_to_check,
+ sformat (_("Checking stage: %1..."), stage["label"]:stage["id"]:""));
+
list<map> steps = maplist (string s, stage["steps"]:[], {
// some steps are called in live installer only
if (s == "" || s == nil) {
@@ -320,6 +331,7 @@
integer stages_nr = size (stages);
integer current_stage = -1;
integer current_stage_percent = 0;
+string fallback_msg = nil;
foreach (map<string,any> stage, stages, {
if (stage["icon"]:"" != "")
@@ -337,13 +349,13 @@
foreach (map step, stage["steps"]:[], {
current_step = current_step + 1;
- SlideShow::SubProgress (100 * current_step / steps_nr, nil);
- SlideShow::StageProgress (current_stage_percent + (100 / stages_nr * current_step / steps_nr), nil);
+ // a fallback busy message
+ fallback_msg = sformat (_("Calling step %1..."), step["client"]:"");
- if (haskey (step, "title")) {
- // use as ' * %1' -> ' * One of the finish steps...' in the SlideShow log
- SlideShow::AppendMessageToInstLog (sformat (_(" * %1"), step["title"]:""));
- }
+ SlideShow::SubProgress (100 * current_step / steps_nr, step["title"]:fallback_msg);
+ SlideShow::StageProgress (current_stage_percent + (100 / stages_nr * current_step / steps_nr), nil);
+ // use as ' * %1' -> ' * One of the finish steps...' in the SlideShow log
+ SlideShow::AppendMessageToInstLog (sformat (_(" * %1"), step["title"]:fallback_msg));
boolean orig = Progress::set (false);
if (test_mode == true) {
@@ -375,7 +387,7 @@
SlideShow::SubProgress (100, nil);
});
-SlideShow::StageProgress (100, _("Finished"));
+SlideShow::StageProgress (100, nil);
SlideShow::AppendMessageToInstLog (_("Finished"));
if (aborted)
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0