YaST Commits
Threads by month
- ----- 2024 -----
- November
- October
- September
- August
- July
- June
- May
- 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
December 2007
- 21 participants
- 683 discussions
06 Dec '07
Author: locilka
Date: Thu Dec 6 16:51:53 2007
New Revision: 42769
URL: http://svn.opensuse.org/viewcvs/yast?rev=42769&view=rev
Log:
Fixed Lazy Init...
Modified:
trunk/yast2/library/modules/Icon.ycp
Modified: trunk/yast2/library/modules/Icon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/modules/Icon.ycp?r…
==============================================================================
--- trunk/yast2/library/modules/Icon.ycp (original)
+++ trunk/yast2/library/modules/Icon.ycp Thu Dec 6 16:51:53 2007
@@ -42,6 +42,8 @@
* @see Icon::Image() for details
*/
global string IconPath (string icon_type) {
+ LazyInit ();
+
string icon_path = nil;
if (icons_map[icon_type]:nil != nil) {
@@ -81,8 +83,6 @@
* )
*/
global term Image (string icon_type, map <string, any> options) {
- LazyInit();
-
if (! has_image_support)
return `Empty();
--
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] r42768 - /trunk/gtk/unstable/mockups/package-selector/current-selector.jpg
by rpmcruz@svn.opensuse.org 06 Dec '07
by rpmcruz@svn.opensuse.org 06 Dec '07
06 Dec '07
Author: rpmcruz
Date: Thu Dec 6 16:50:08 2007
New Revision: 42768
URL: http://svn.opensuse.org/viewcvs/yast?rev=42768&view=rev
Log:
A shot of the current selector as of 10.3.
Added:
trunk/gtk/unstable/mockups/package-selector/current-selector.jpg (with props)
Added: trunk/gtk/unstable/mockups/package-selector/current-selector.jpg
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/mockups/package-sel…
==============================================================================
Binary file - no diff available.
--
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] r42767 - /trunk/gtk/unstable/mockups/package-selector/christian-selector.svg
by rpmcruz@svn.opensuse.org 06 Dec '07
by rpmcruz@svn.opensuse.org 06 Dec '07
06 Dec '07
Author: rpmcruz
Date: Thu Dec 6 16:49:40 2007
New Revision: 42767
URL: http://svn.opensuse.org/viewcvs/yast?rev=42767&view=rev
Log:
SVG version of Christian Jaeger mockup.
Added:
trunk/gtk/unstable/mockups/package-selector/christian-selector.svg
Added: trunk/gtk/unstable/mockups/package-selector/christian-selector.svg
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/mockups/package-sel…
==============================================================================
--- trunk/gtk/unstable/mockups/package-selector/christian-selector.svg (added)
+++ trunk/gtk/unstable/mockups/package-selector/christian-selector.svg Thu Dec 6 16:49:40 2007
@@ -0,0 +1,366 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ width="550"
+ height="450"
+ sodipodi:docbase="/home/rick2/Documents/yast/gtk/unstable/mockups/package-selector"
+ sodipodi:docname="christian-selector.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.0">
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs5" />
+ <sodipodi:namedview
+ inkscape:window-height="729"
+ inkscape:window-width="984"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="1"
+ inkscape:cx="394.83358"
+ inkscape:cy="282.70709"
+ inkscape:window-x="221"
+ inkscape:window-y="67"
+ inkscape:current-layer="svg2"
+ height="450px"
+ width="550px" />
+ <rect
+ style="fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3462"
+ width="588"
+ height="482"
+ x="-14"
+ y="-12" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.79200006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect2159"
+ width="372"
+ height="164"
+ x="10"
+ y="276.36218" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.79200006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3132"
+ width="358"
+ height="52"
+ x="17"
+ y="381.36218" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot3142"
+ transform="translate(-50,-189)"><flowRegion
+ id="flowRegion3144"><rect
+ id="rect3146"
+ width="112"
+ height="18"
+ x="76"
+ y="598.36218" /></flowRegion><flowPara
+ id="flowPara3148">2.2 (Main-OSS)</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot3150"
+ transform="translate(-64,-181)"><flowRegion
+ id="flowRegion3152"><rect
+ id="rect3154"
+ width="106"
+ height="20"
+ x="176"
+ y="567.36218" /></flowRegion><flowPara
+ id="flowPara3156">downgrade</flowPara></flowRoot> <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.41479945;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 136.71151,405.91974 L 137.14101,425.80462 L 137.14101,425.80462 L 144.44244,417.00312 L 144.44244,417.00312 L 137.14101,425.47864 L 131.55756,420.58891 L 135.85252,425.15265"
+ id="path3164" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="313"
+ y="396.36218"
+ id="text3166"><tspan
+ sodipodi:role="line"
+ id="tspan3168"
+ x="313"
+ y="396.36218">Installed:</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="280"
+ y="420.36218"
+ id="text3170"><tspan
+ sodipodi:role="line"
+ id="tspan3172"
+ x="280"
+ y="420.36218">2.4 (Packman)</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="22"
+ y="298.36218"
+ id="text3174"><tspan
+ sodipodi:role="line"
+ id="tspan3176"
+ x="22"
+ y="298.36218">The GIMP is...</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#2bff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="321"
+ y="331.36218"
+ id="text3178"><tspan
+ sodipodi:role="line"
+ id="tspan3180"
+ x="321"
+ y="331.36218">uninstall</tspan></text>
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#da2020;stroke-width:2.33824253;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 333.85208,280.98146 L 356.4939,316.7429 L 344.54405,297.54465 L 358.38072,282.86364 L 326.61928,315.99002 L 343.91511,298.29753 L 341.71383,301.30902"
+ id="path3182" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3184"
+ width="371.99347"
+ height="162.9935"
+ x="10.00325"
+ y="100.36545" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.65715837;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3186"
+ width="170.04285"
+ height="149.04285"
+ x="16.978577"
+ y="109.34076"
+ ry="0" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.73408329;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3188"
+ width="177.96591"
+ height="149.96591"
+ x="197.01704"
+ y="108.37921" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="25"
+ y="128.36218"
+ id="text3190"><tspan
+ sodipodi:role="line"
+ id="tspan3192"
+ x="25"
+ y="128.36218">Productivity</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="51"
+ y="150.36218"
+ id="text3194"><tspan
+ sodipodi:role="line"
+ id="tspan3196"
+ x="51"
+ y="150.36218">Graphics</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#00ff00;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="207"
+ y="129.36218"
+ id="text3198"><tspan
+ sodipodi:role="line"
+ id="tspan3200"
+ x="207"
+ y="129.36218">The Gimp</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="209"
+ y="148.36218"
+ id="text3202"><tspan
+ sodipodi:role="line"
+ id="tspan3204"
+ x="209"
+ y="148.36218">GIMP Shop</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="16"
+ y="88.362183"
+ id="text3206"><tspan
+ sodipodi:role="line"
+ id="tspan3208"
+ x="16"
+ y="88.362183">Filters:</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="100"
+ y="87.362183"
+ id="text3210"><tspan
+ sodipodi:role="line"
+ id="tspan3212"
+ x="100"
+ y="87.362183">Upgrades</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="192"
+ y="88.362183"
+ id="text3214"><tspan
+ sodipodi:role="line"
+ id="tspan3216"
+ x="192"
+ y="88.362183">Packman-Repository</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="345"
+ y="87.362183"
+ id="text3218"><tspan
+ sodipodi:role="line"
+ id="tspan3220"
+ x="345"
+ y="87.362183">GIMP</tspan></text>
+ <rect
+ style="fill:#00ff00;fill-opacity:1;stroke:#000000;stroke-width:1.84761775;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3222"
+ width="101.85239"
+ height="55.852383"
+ x="265.07382"
+ y="9.4359894" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.64138579;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3224"
+ width="121.05862"
+ height="54.058613"
+ x="8.9706917"
+ y="10.33287" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.78103864;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3226"
+ width="115.91896"
+ height="54.918961"
+ x="141.04053"
+ y="9.40271" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="39"
+ y="42.362183"
+ id="text3228"><tspan
+ sodipodi:role="line"
+ id="tspan3230"
+ x="39"
+ y="42.362183">Packages</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="167"
+ y="41.362183"
+ id="text3232"><tspan
+ sodipodi:role="line"
+ id="tspan3234"
+ x="167"
+ y="41.362183">Patterns</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="286"
+ y="42.362183"
+ id="text3236"><tspan
+ sodipodi:role="line"
+ id="tspan3238"
+ x="286"
+ y="42.362183">Categories</tspan></text>
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.74622476;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="rect3240"
+ width="151.95378"
+ height="430.9538"
+ x="392.02313"
+ y="10.385284" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="410"
+ y="39.362183"
+ id="text3242"><tspan
+ sodipodi:role="line"
+ id="tspan3244"
+ x="410"
+ y="39.362183">Changes</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="407"
+ y="74.362183"
+ id="text3246"><tspan
+ sodipodi:role="line"
+ id="tspan3248"
+ x="407"
+ y="74.362183">- uninstall The GIMP</tspan></text>
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#da2020;stroke-width:1.01152611;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 526.89184,62.8181 L 537.64774,76.90626 L 531.97103,69.34314 L 538.54408,63.55958 L 523.45592,76.60966 L 531.67225,69.63974 L 530.62653,70.82611"
+ id="path3250" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="513"
+ y="49.362183"
+ id="text3252"><tspan
+ sodipodi:role="line"
+ id="tspan3254"
+ x="513"
+ y="49.362183">undo</tspan></text>
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:6.4;stroke-opacity:1"
+ id="path3436"
+ sodipodi:cx="521.5"
+ sodipodi:cy="596.86218"
+ sodipodi:rx="65.5"
+ sodipodi:ry="21.5"
+ d="M 587 596.86218 A 65.5 21.5 0 1 1 456,596.86218 A 65.5 21.5 0 1 1 587 596.86218 z"
+ transform="matrix(0.9980833,0,0,1.3197421,-53.00044,-384.84199)" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="421"
+ y="406.36218"
+ id="text3438"><tspan
+ sodipodi:role="line"
+ id="tspan3440"
+ x="421"
+ y="406.36218">Perform Changes</tspan></text>
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot3134"
+ transform="translate(-54,-192)"><flowRegion
+ id="flowRegion3136"><rect
+ id="rect3138"
+ width="60"
+ height="18"
+ x="77"
+ y="576.36218" /></flowRegion><flowPara
+ id="flowPara3140">Versions:</flowPara></flowRoot></svg>
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
06 Dec '07
Author: sh-sh-sh
Date: Thu Dec 6 16:34:29 2007
New Revision: 42766
URL: http://svn.opensuse.org/viewcvs/yast?rev=42766&view=rev
Log:
Created tag stable-2_16_14 for core
Added:
tags/stable-2_16_14/core/
- copied from r42765, trunk/core/
--
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] r42765 - in /trunk/core: VERSION libyui/src/YCPDialogParser.cc libyui/src/YCPDialogParser.h package/yast2-core.changes
by sh-sh-sh@svn.opensuse.org 06 Dec '07
by sh-sh-sh@svn.opensuse.org 06 Dec '07
06 Dec '07
Author: sh-sh-sh
Date: Thu Dec 6 16:34:22 2007
New Revision: 42765
URL: http://svn.opensuse.org/viewcvs/yast?rev=42765&view=rev
Log:
Added bug compatibility mode for TextEntry:
TextEntry() is treated as InputField(`opt(`hstretch))
Modified:
trunk/core/VERSION
trunk/core/libyui/src/YCPDialogParser.cc
trunk/core/libyui/src/YCPDialogParser.h
trunk/core/package/yast2-core.changes
Modified: trunk/core/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=42765&r1=42764&…
==============================================================================
--- trunk/core/VERSION (original)
+++ trunk/core/VERSION Thu Dec 6 16:34:22 2007
@@ -1 +1 @@
-2.16.13
+2.16.14
Modified: trunk/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.…
==============================================================================
--- trunk/core/libyui/src/YCPDialogParser.cc (original)
+++ trunk/core/libyui/src/YCPDialogParser.cc Thu Dec 6 16:34:22 2007
@@ -252,7 +252,7 @@
else if ( s == YUIWidget_Right ) w = parseAlignment ( p, opt, term, ol, n, YAlignEnd, YAlignUnchanged );
else if ( s == YUIWidget_SelectionBox ) w = parseSelectionBox ( p, opt, term, ol, n );
else if ( s == YUIWidget_Table ) w = parseTable ( p, opt, term, ol, n );
- else if ( s == YUIWidget_TextEntry ) w = parseInputField ( p, opt, term, ol, n, false );
+ else if ( s == YUIWidget_TextEntry ) w = parseInputField ( p, opt, term, ol, n, false, true ); // bugCompatibilityMode
else if ( s == YUIWidget_Top ) w = parseAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignBegin );
else if ( s == YUIWidget_Tree ) w = parseTree ( p, opt, term, ol, n );
else if ( s == YUIWidget_VBox ) w = parseLayoutBox ( p, opt, term, ol, n, YD_VERT );
@@ -1551,13 +1551,23 @@
* @note You can and should set a keyboard shortcut within the
* label. When the user presses the hotkey, the corresponding text entry widget
* will get the keyboard focus.
+ *
+ * @note Bug compatibility mode: If used as TextEntry(), `opt(`hstretch)
+ * is automatically added (with a warning in the log about that fact)
+ * to avoid destroying dialogs written before fixing a geometry bug
+ * in the widget. The bug had caused all TextEntry widgets to be
+ * horizontally stretchable, so they consumed all the horizontal
+ * space they could get, typically making them as wide as the dialog.
+ * When used with the new name InputField(), they use a reasonable
+ * default width. You can still add `opt(`hstretch), of course.
**/
YWidget *
YCPDialogParser::parseInputField( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- bool passwordMode )
+ bool passwordMode, bool bugCompatibilityMode )
{
+ static bool postedBugCompatibilityWarning = false;
if ( term->size() - argnr < 1 || term->size() - argnr > 2
|| !term->value(argnr)->isString()
@@ -1590,6 +1600,28 @@
if ( shrinkable )
inputField->setShrinkable();
+ else if ( bugCompatibilityMode )
+ {
+ inputField->setStretchable( YD_HORIZ, true );
+
+ if ( ! postedBugCompatibilityWarning )
+ {
+ y2warning( "\n"
+ "\nUsing `TextEntry() in bug compatibiltiy mode."
+ "\nThis is equivalent to `InputField(`opt(`hstretch), ...)."
+ "\nThis makes the field grab as much space horizontally as it can get,"
+ "\ntypically making it stretch across the entire width of the dialog."
+ "\nWithout this hstretch, the field will take a reasonable default width."
+ "\n"
+ "\nIf this `hstretch is really desired, please use `InputField(`opt(`hstretch), ...)."
+ "\nIf it is not, please use `InputField() without `hstretch."
+ "\n\n"
+ );
+
+ postedBugCompatibilityWarning = true;
+ }
+ }
+
return inputField;
}
@@ -3211,7 +3243,7 @@
nextButtonLabel,
wizardMode );
YUI_CHECK_NEW( wizard );
-
+
// All wizard widgets have a fixed ID `wizard
YWidgetID * wizardId = new YCPValueWidgetID( YCPSymbol( YWizardID ) );
wizard->setId( wizardId );
Modified: trunk/core/libyui/src/YCPDialogParser.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.…
==============================================================================
--- trunk/core/libyui/src/YCPDialogParser.h (original)
+++ trunk/core/libyui/src/YCPDialogParser.h Thu Dec 6 16:34:22 2007
@@ -197,7 +197,7 @@
**/
static YWidget * parseInputField( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- bool passwordMode );
+ bool passwordMode, bool bugCompatibilityMode = false );
static YWidget * parseMultiLineEdit( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr );
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?…
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Thu Dec 6 16:34:22 2007
@@ -1,4 +1,15 @@
-------------------------------------------------------------------
+Thu Dec 6 16:28:04 CET 2007 - sh(a)suse.de
+
+- Fixed bug #345819 (input fields too small):
+ Introduced bug compatibility mode for TextEntry widget;
+ when used with the old name `TextEntry(), `opt(`hstretch)
+ is automatically assumed; with the new name `InputField() it
+ behaves like specified.
+
+- V 2.16.14
+
+-------------------------------------------------------------------
Wed Dec 5 14:42:32 CET 2007 - sh(a)suse.de
- Fixed YMenuEvent( string ) handling:
--
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] r42764 - in /trunk/pkg-bindings/src: Makefile.am Resolvable.cc Resolvable_Install.cc Resolvable_Patches.cc Resolvable_Properties.cc Source_Load.cc Target.cc Target_DU.cc Target_Load.cc
by lslezak@svn.opensuse.org 06 Dec '07
by lslezak@svn.opensuse.org 06 Dec '07
06 Dec '07
Author: lslezak
Date: Thu Dec 6 15:42:40 2007
New Revision: 42764
URL: http://svn.opensuse.org/viewcvs/yast?rev=42764&view=rev
Log:
- TargetInit - added global progress
- Resolvable.cc and Target.cc have been split
Added:
trunk/pkg-bindings/src/Resolvable_Install.cc
trunk/pkg-bindings/src/Resolvable_Patches.cc
trunk/pkg-bindings/src/Resolvable_Properties.cc
trunk/pkg-bindings/src/Target_DU.cc
- copied, changed from r42708, trunk/pkg-bindings/src/Target.cc
trunk/pkg-bindings/src/Target_Load.cc
- copied, changed from r42708, trunk/pkg-bindings/src/Target.cc
Removed:
trunk/pkg-bindings/src/Resolvable.cc
Modified:
trunk/pkg-bindings/src/Makefile.am
trunk/pkg-bindings/src/Source_Load.cc
trunk/pkg-bindings/src/Target.cc
Modified: trunk/pkg-bindings/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Makefile.am?rev…
==============================================================================
--- trunk/pkg-bindings/src/Makefile.am (original)
+++ trunk/pkg-bindings/src/Makefile.am Thu Dec 6 15:42:40 2007
@@ -28,9 +28,11 @@
PkgModuleFunctions_Register.cc \
Package.cc \
Patch.cc \
- Resolvable.cc \
+ Resolvable_Install.cc \
+ Resolvable_Patches.cc \
+ Resolvable_Properties.cc \
Selection.cc \
- Target.cc \
+ Target.cc Target_DU.cc Target_Load.cc \
Locale.cc \
Source_Callbacks.cc \
Source_Create.cc \
Added: trunk/pkg-bindings/src/Resolvable_Install.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Inst…
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Install.cc (added)
+++ trunk/pkg-bindings/src/Resolvable_Install.cc Thu Dec 6 15:42:40 2007
@@ -0,0 +1,285 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2007 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/*
+ File: $Id$
+ Author: Ladislav Slezák <lslezak(a)novell.com>
+ Summary: Install or remove resolvables
+*/
+
+#include "PkgModuleFunctions.h"
+
+#include <ycp/YCPVoid.h>
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPSymbol.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+
+#include <zypp/Product.h>
+#include <zypp/Patch.h>
+#include <zypp/Pattern.h>
+#include <zypp/Language.h>
+#include <zypp/Package.h>
+
+/**
+ @builtin ResolvableInstallArchVersion
+ @short Install all resolvables with selected name, architecture and kind. Use it only in a special case, ResolvableInstall() should be prefrerred.
+ @param name_r name of the resolvable, if empty ("") install all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @param arch architecture of the resolvable
+ @param vers Required version of the resolvable, empty string means any version
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableInstallArchVersion( const YCPString& name_r, const YCPSymbol& kind_r, const YCPString& arch, const YCPString& vers )
+{
+ zypp::Resolvable::Kind kind;
+
+ std::string req_kind = kind_r->symbol ();
+
+ std::string arch_str = arch->value();
+ if (arch_str.empty())
+ return YCPBoolean (false);
+
+ // ensure installation of the required architecture
+ zypp::Arch architecture(arch_str);
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else
+ {
+ y2error("Pkg::ResolvableInstall: unknown symbol: %s", req_kind.c_str());
+ return YCPBoolean(false);
+ }
+
+ std::string version_str = vers->value();
+
+ return YCPBoolean(
+ (name_r->value().empty())
+ ? DoProvideAllKind(kind)
+ : DoProvideNameKind (name_r->value(), kind, architecture, version_str)
+ );
+}
+
+// ------------------------
+/**
+ @builtin ResolvableInstall
+ @short Install all resolvables with selected name and kind
+ @param name_r name of the resolvable, if empty ("") install all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableInstall( const YCPString& name_r, const YCPSymbol& kind_r )
+{
+ return ResolvableInstallArchVersion(name_r, kind_r, YCPString(zypp_ptr()->architecture().asString()), YCPString(""));
+}
+
+// ------------------------
+/**
+ @builtin ResolvableRemove
+ @short Removes all resolvables with selected name and kind
+ @param name_r name of the resolvable, if empty ("") remove all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableRemove ( const YCPString& name_r, const YCPSymbol& kind_r )
+{
+ zypp::Resolvable::Kind kind;
+
+ std::string req_kind = kind_r->symbol ();
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else
+ {
+ y2error("Pkg::ResolvableRemove: unknown symbol: %s", req_kind.c_str());
+ return YCPBoolean(false);
+ }
+
+ return YCPBoolean(
+ (name_r->value().empty())
+ ? DoRemoveAllKind(kind)
+ : DoRemoveNameKind (name_r->value(), kind)
+ );
+}
+
+// ------------------------
+/**
+ @builtin ResolvableNeutral
+ @short Remove all transactions from all resolvables with selected name and kind
+ @param name_r name of the resolvable, if empty ("") use all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @param force_r remove the transactions even on USER level - default is APPL_HIGH (use true value only if really needed!)
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableNeutral ( const YCPString& name_r, const YCPSymbol& kind_r, const YCPBoolean& force_r )
+{
+ zypp::Resolvable::Kind kind;
+
+ std::string req_kind = kind_r->symbol();
+ std::string name = name_r->value();
+ bool force = force_r->value();
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else
+ {
+ y2error("Pkg::ResolvableNeutral: unknown symbol: %s", req_kind.c_str());
+ return YCPBoolean(false);
+ }
+
+ bool ret = true;
+
+ try
+ {
+ for (zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(kind);
+ it != zypp_ptr()->pool().byKindEnd(kind);
+ ++it)
+ {
+ if (name.empty() || (*it)->name() == name)
+ {
+ if (!it->status().resetTransact(whoWantsIt))
+ {
+ ret = false;
+ }
+
+ // force neutralization on the user level
+ if (force && !it->status().resetTransact(zypp::ResStatus::USER))
+ {
+ ret = false;
+ }
+ }
+ }
+ }
+ catch (...)
+ {
+ return YCPBoolean(false);
+ }
+
+ return YCPBoolean(ret);
+}
+
+// ------------------------
+/**
+ @builtin ResolvableSetSoftLock
+ @short Soft lock - it prevents the solver from re-selecting item
+ if it's recommended (if it's required it will be selected).
+ @param name_r name of the resolvable, if empty ("") use all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableSetSoftLock ( const YCPString& name_r, const YCPSymbol& kind_r )
+{
+ zypp::Resolvable::Kind kind;
+
+ std::string req_kind = kind_r->symbol();
+ std::string name = name_r->value();
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else
+ {
+ y2error("Pkg::ResolvableSetSoftLock: unknown symbol: %s", req_kind.c_str());
+ return YCPBoolean(false);
+ }
+
+ bool ret = true;
+
+ try
+ {
+ for (zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(kind);
+ it != zypp_ptr()->pool().byKindEnd(kind);
+ ++it)
+ {
+ if (name.empty() || (*it)->name() == name)
+ {
+ if (!it->status().setSoftLock(whoWantsIt))
+ {
+ ret = false;
+ }
+ }
+ }
+ }
+ catch (...)
+ {
+ return YCPBoolean(false);
+ }
+
+ return YCPBoolean(ret);
+}
+
Added: trunk/pkg-bindings/src/Resolvable_Patches.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Patc…
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Patches.cc (added)
+++ trunk/pkg-bindings/src/Resolvable_Patches.cc Thu Dec 6 15:42:40 2007
@@ -0,0 +1,160 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2007 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/*
+ File: $Id$
+ Author: Ladislav Slezák <lslezak(a)novell.com>
+ Summary: Patch related functions
+*/
+
+#include "PkgModuleFunctions.h"
+
+#include <sstream>
+
+#include <ycp/YCPVoid.h>
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPSymbol.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+
+#include <zypp/Product.h>
+#include <zypp/Patch.h>
+#include <zypp/Pattern.h>
+#include <zypp/Language.h>
+#include <zypp/Package.h>
+
+/**
+ @builtin ResolvableCountPatches
+ @short Count patches which will be selected by ResolvablePreselectPatches() function
+ @description
+ Only non-optional patches are selected (even when `all parameter is passed!)
+ @param kind_r kind of preselected patches, can be `all, `interactive, `reboot_needed or `affects_pkg_manager
+ @return integer number of preselected patches
+*/
+YCPValue
+PkgModuleFunctions::ResolvableCountPatches (const YCPSymbol& kind_r)
+{
+ // only count the patches
+ return ResolvableSetPatches(kind_r, false);
+}
+
+/**
+ @builtin ResolvablePreselectPatches
+ @short Preselect patches for auto online update during the installation
+ @description
+ Only non-optional patches are selected (even when `all parameter is passed!)
+ @param kind_r kind of preselected patches, can be `all, `interactive, `reboot_needed or `affects_pkg_manager
+ @return integer number of preselected patches
+*/
+YCPValue
+PkgModuleFunctions::ResolvablePreselectPatches (const YCPSymbol& kind_r)
+{
+ // preselect the patches
+ return ResolvableSetPatches(kind_r, true);
+}
+
+// helper function
+YCPValue
+PkgModuleFunctions::ResolvableSetPatches (const YCPSymbol& kind_r, bool preselect)
+{
+ long long selected_patches = 0LL;
+ std::string kind = kind_r->symbol();
+
+ if (kind != "all" && kind != "interactive" && kind != "reboot_needed"
+ && kind != "affects_pkg_manager")
+ {
+ return YCPError("Pkg::ResolvablePreselectPatches: Wrong parameter '" + kind + "', use: `all, `interactive, `reboot_needed or `affects_pkg_manager", YCPInteger(0LL));
+ }
+
+ try
+ {
+ const zypp::ResPool & pool = zypp_ptr()->pool();
+
+ // pseudo code from
+ // http://svn.suse.de/trac/zypp/wiki/ZMD/YaST/update/yast
+
+ zypp::ResPool::const_iterator
+ b = pool.begin (),
+ e = pool.end (),
+ i;
+ for (i = b; i != e; ++i)
+ {
+ zypp::Patch::constPtr pch = zypp::asKind<zypp::Patch>(i->resolvable());
+
+ // is it a patch?
+ if (pch)
+ {
+ if (i->status().isNeeded()) // uninstalled
+ {
+ // dont auto-install optional patches
+ if (pch->category () != "optional")
+ {
+ if (kind == "all"
+ || (kind == "interactive" && pch->interactive())
+ || (kind == "affects_pkg_manager" && pch->affects_pkg_manager())
+ || (kind == "reboot_needed" && pch->reboot_needed())
+ )
+ {
+ if (!preselect)
+ {
+ selected_patches++;
+ }
+ else if (DoProvideNameKind(pch->name(), pch->kind(), pch->arch(),"",
+ true // only Needed patches
+ ))
+ // schedule for installation
+ // but take the best edition. Bug #206927
+ {
+ stringstream str;
+ str << *i << endl;
+ y2milestone( "Setting '%s' to transact", str.str().c_str() );
+ // selected successfully - increase the counter
+ selected_patches++;
+ }
+ }
+ else
+ {
+ y2milestone("Ignoring patch id: %s", pch->id().c_str());
+ }
+ }
+ else
+ {
+ y2milestone("Ignoring optional patch (id): %s", pch->id().c_str());
+ }
+ }
+ else
+ {
+ y2milestone("Patch %s is not applicable", pch->id().c_str());
+ }
+ }
+ }
+ }
+ catch (...)
+ {
+ y2error("An error occurred during patch selection.");
+ }
+
+ return YCPInteger(selected_patches);
+}
+
+
+
Added: trunk/pkg-bindings/src/Resolvable_Properties.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Prop…
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Properties.cc (added)
+++ trunk/pkg-bindings/src/Resolvable_Properties.cc Thu Dec 6 15:42:40 2007
@@ -0,0 +1,414 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2007 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/*
+ File: $Id$
+ Author: Ladislav Slezák <lslezak(a)novell.com>
+ Summary: Resolvable properties
+*/
+
+#include "PkgModuleFunctions.h"
+
+#include <ycp/YCPVoid.h>
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPSymbol.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+
+#include <zypp/Product.h>
+#include <zypp/Patch.h>
+#include <zypp/Pattern.h>
+#include <zypp/Language.h>
+#include <zypp/Package.h>
+#include <zypp/Dep.h>
+#include <zypp/CapSet.h>
+
+/**
+ @builtin ResolvableProperties
+
+ @short Return properties of resolvable
+ @description
+ return list of resolvables of selected kind with required name
+
+ @param name name of the resolvable, if empty returns all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern or `language
+ @param version version of the resolvable, if empty all versions are returned
+
+ @return list<map<string,any>> list of $[ "name":string, "version":string, "arch":string, "source":integer, "status":symbol, "locked":boolean ] maps
+ status is `installed, `removed, `selected or `available, source is source ID or -1 if the resolvable is installed in the target
+ if status is `available and locked is true then the object is set to taboo,
+ if status is `installed and locked is true then the object locked
+*/
+
+YCPValue
+PkgModuleFunctions::ResolvableProperties(const YCPString& name, const YCPSymbol& kind_r, const YCPString& version)
+{
+ return ResolvablePropertiesEx (name, kind_r, version, false);
+}
+
+/*
+ @builtin ResolvableDependencies
+ @description
+ return list of resolvables with dependencies
+
+ @see ResolvableProperties for more information
+*/
+YCPValue
+PkgModuleFunctions::ResolvableDependencies(const YCPString& name, const YCPSymbol& kind_r, const YCPString& version)
+{
+ return ResolvablePropertiesEx (name, kind_r, version, true);
+}
+
+YCPValue
+PkgModuleFunctions::ResolvablePropertiesEx(const YCPString& name, const YCPSymbol& kind_r, const YCPString& version, bool dependencies)
+{
+ zypp::Resolvable::Kind kind;
+ std::string req_kind = kind_r->symbol ();
+ std::string nm = name->value();
+ std::string vers = version->value();
+ YCPList ret;
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else if ( req_kind == "language" ) {
+ kind = zypp::ResTraits<zypp::Language>::kind;
+ }
+ else
+ {
+ y2error("Pkg::ResolvableProperties: unknown symbol: %s", req_kind.c_str());
+ return ret;
+ }
+
+ try
+ {
+ for (zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(kind);
+ it != zypp_ptr()->pool().byKindEnd(kind);
+ ++it)
+ {
+ if ((nm.empty() || nm == (*it)->name())
+ && (vers.empty() || vers == (*it)->edition().asString()))
+ {
+ YCPMap info;
+
+ info->add(YCPString("name"), YCPString((*it)->name()));
+ info->add(YCPString("version"), YCPString((*it)->edition().asString()));
+ info->add(YCPString("arch"), YCPString((*it)->arch().asString()));
+ info->add(YCPString("description"), YCPString((*it)->description()));
+
+ std::string resolvable_summary = (*it)->summary();
+ if (resolvable_summary.size() > 0)
+ {
+ info->add(YCPString("summary"), YCPString((*it)->summary()));
+ }
+
+ // status
+ std::string stat;
+
+ if (it->status().isInstalled())
+ {
+ stat = (it->status().isToBeUninstalled()) ? "removed" : "installed";
+ }
+ else if (it->status().isToBeInstalled())
+ {
+ stat = "selected";
+ }
+ else
+ {
+ stat = "available";
+ }
+
+ info->add(YCPString("status"), YCPSymbol(stat));
+
+ // is the resolvable locked? (Locked or Taboo in the UI)
+ info->add(YCPString("locked"), YCPBoolean(it->status().isLocked()));
+
+ // source
+ zypp::Repository repo = (*it)->repository();
+ info->add(YCPString("source"), YCPInteger(logFindAlias(repo.info().alias())));
+
+ // add license info if it is defined
+ std::string license = (*it)->licenseToConfirm();
+ if (!license.empty())
+ {
+ info->add(YCPString("license_confirmed"), YCPBoolean(it->status().isLicenceConfirmed()));
+ info->add(YCPString("license"), YCPString(license));
+ }
+
+ info->add(YCPString("download_size"), YCPInteger((*it)->downloadSize()));
+ info->add(YCPString("inst_size"), YCPInteger((*it)->size()));
+
+ info->add(YCPString("medium_nr"), YCPInteger((*it)->mediaNr()));
+ info->add(YCPString("vendor"), YCPString((*it)->vendor()));
+
+
+ // package specific info
+ if( req_kind == "package" )
+ {
+ zypp::Package::constPtr pkg = boost::dynamic_pointer_cast<const zypp::Package>(it->resolvable());
+
+ std::string tmp = pkg->location().filename().asString();
+ if (!tmp.empty())
+ {
+ info->add(YCPString("path"), YCPString(tmp));
+ }
+
+ tmp = pkg->location().filename().basename();
+ if (!tmp.empty())
+ {
+ info->add(YCPString("location"), YCPString(tmp));
+ }
+ }
+ // product specific info
+ else if( req_kind == "product" ) {
+ zypp::Product::constPtr product = boost::dynamic_pointer_cast<const zypp::Product>(it->resolvable());
+ info->add(YCPString("category"), YCPString(product->category()));
+ info->add(YCPString("relnotes_url"), YCPString(product->releaseNotesUrl().asString()));
+
+ std::string product_summary = product->summary();
+ if (product_summary.size() > 0)
+ {
+ info->add(YCPString("display_name"), YCPString(product_summary));
+ }
+
+ std::string product_shortname = product->shortName();
+ if (product_shortname.size() > 0)
+ {
+ info->add(YCPString("short_name"), YCPString(product_shortname));
+ }
+ // use summary for the short name if it's defined
+ else if (product_summary.size() > 0)
+ {
+ info->add(YCPString("short_name"), YCPString(product_summary));
+ }
+
+ info->add(YCPString("type"), YCPString(product->type()));
+
+ YCPList updateUrls;
+ std::list<zypp::Url> pupdateUrls = product->updateUrls();
+ for (std::list<zypp::Url>::const_iterator it = pupdateUrls.begin(); it != pupdateUrls.end(); ++it)
+ {
+ updateUrls->add(YCPString(it->asString()));
+ }
+ info->add(YCPString("update_urls"), updateUrls);
+
+ YCPList flags;
+ std::list<std::string> pflags = product->flags();
+ for (std::list<std::string>::const_iterator flag_it = pflags.begin();
+ flag_it != pflags.end(); ++flag_it)
+ {
+ flags->add(YCPString(*flag_it));
+ }
+ info->add(YCPString("flags"), flags);
+
+ std::list<zypp::Url> pextraUrls = product->extraUrls();
+ if (pextraUrls.size() > 0)
+ {
+ YCPList extraUrls;
+ for (std::list<zypp::Url>::const_iterator it = pextraUrls.begin(); it != pextraUrls.end(); ++it)
+ {
+ extraUrls->add(YCPString(it->asString()));
+ }
+ info->add(YCPString("extra_urls"), extraUrls);
+ }
+
+ std::list<zypp::Url> poptionalUrls = product->optionalUrls();
+ if (poptionalUrls.size() > 0)
+ {
+ YCPList optionalUrls;
+ for (std::list<zypp::Url>::const_iterator it = poptionalUrls.begin(); it != poptionalUrls.end(); ++it)
+ {
+ optionalUrls->add(YCPString(it->asString()));
+ }
+ info->add(YCPString("optional_urls"), optionalUrls);
+ }
+ }
+ // pattern specific info
+ else if ( req_kind == "pattern" ) {
+ zypp::Pattern::constPtr pattern = boost::dynamic_pointer_cast<const zypp::Pattern>(it->resolvable());
+ info->add(YCPString("category"), YCPString(pattern->category()));
+ info->add(YCPString("user_visible"), YCPBoolean(pattern->userVisible()));
+ info->add(YCPString("default"), YCPBoolean(pattern->isDefault()));
+ info->add(YCPString("icon"), YCPString(pattern->icon().asString()));
+ info->add(YCPString("script"), YCPString(pattern->script().asString()));
+ }
+ // patch specific info
+ else if ( req_kind == "patch" )
+ {
+ zypp::Patch::constPtr patch_ptr = boost::dynamic_pointer_cast<const zypp::Patch>(it->resolvable());
+
+ info->add(YCPString("interactive"), YCPBoolean(patch_ptr->interactive()));
+ info->add(YCPString("reboot_needed"), YCPBoolean(patch_ptr->reboot_needed()));
+ info->add(YCPString("affects_pkg_manager"), YCPBoolean(patch_ptr->affects_pkg_manager()));
+ info->add(YCPString("is_needed"), YCPBoolean(it->status().isNeeded()));
+ }
+
+ // dependency info
+ if (dependencies)
+ {
+ std::set<std::string> _kinds;
+ _kinds.insert("provides");
+ _kinds.insert("prerequires");
+ _kinds.insert("requires");
+ _kinds.insert("conflicts");
+ _kinds.insert("obsoletes");
+ _kinds.insert("recommends");
+ _kinds.insert("suggests");
+ _kinds.insert("freshens");
+ _kinds.insert("enhances");
+ _kinds.insert("supplements");
+ YCPList ycpdeps;
+ for (std::set<std::string>::const_iterator kind_it = _kinds.begin();
+ kind_it != _kinds.end(); ++kind_it)
+ {
+ try {
+ zypp::Dep depkind(*kind_it);
+ zypp::CapSet deps = it->resolvable()->dep(depkind);
+ for (zypp::CapSet::const_iterator d = deps.begin(); d != deps.end(); ++d)
+ {
+ YCPMap ycpdep;
+ ycpdep->add (YCPString ("res_kind"), YCPString (d->refers().asString()));
+ ycpdep->add (YCPString ("name"), YCPString (d->asString()));
+ ycpdep->add (YCPString ("dep_kind"), YCPString (*kind_it));
+ ycpdeps->add (ycpdep);
+ }
+
+ }
+ catch (...)
+ {}
+ }
+ info->add (YCPString ("dependencies"), ycpdeps);
+ }
+ ret->add(info);
+ }
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return ret;
+}
+
+
+/**
+ @builtin IsAnyResolvable
+ @short Is there any resolvable in the requried state?
+ @param symbol kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern, `language or `any for any kind of resolvable
+ @param symbol status status of resolvable, can be `to_install or `to_remove
+ @return boolean true if a resolvable with the requested status was found
+*/
+YCPValue
+PkgModuleFunctions::IsAnyResolvable(const YCPSymbol& kind_r, const YCPSymbol& status)
+{
+ zypp::Resolvable::Kind kind;
+
+ std::string req_kind = kind_r->symbol ();
+ std::string stat_str = status->symbol();
+
+ if( req_kind == "product" ) {
+ kind = zypp::ResTraits<zypp::Product>::kind;
+ }
+ else if ( req_kind == "patch" ) {
+ kind = zypp::ResTraits<zypp::Patch>::kind;
+ }
+ else if ( req_kind == "package" ) {
+ kind = zypp::ResTraits<zypp::Package>::kind;
+ }
+ else if ( req_kind == "selection" ) {
+ kind = zypp::ResTraits<zypp::Selection>::kind;
+ }
+ else if ( req_kind == "pattern" ) {
+ kind = zypp::ResTraits<zypp::Pattern>::kind;
+ }
+ else if ( req_kind == "language" ) {
+ kind = zypp::ResTraits<zypp::Language>::kind;
+ }
+ else if ( req_kind == "any" ) {
+ try
+ {
+ for (zypp::ResPool::const_iterator it = zypp_ptr()->pool().begin();
+ it != zypp_ptr()->pool().end();
+ ++it)
+ {
+ if (stat_str == "to_install" && it->status().isToBeInstalled())
+ {
+ return YCPBoolean(true);
+ }
+ else if (stat_str == "to_remove" && it->status().isToBeUninstalled())
+ {
+ return YCPBoolean(true);
+ }
+ }
+ }
+ catch (...)
+ {
+ y2error("An error occurred during resolvable search.");
+ return YCPNull();
+ }
+
+ return YCPBoolean(false);
+ }
+ else
+ {
+ y2error("Pkg::IsAnyResolvable: unknown symbol: %s", req_kind.c_str());
+ return YCPNull();
+ }
+
+
+ try
+ {
+ for (zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(kind);
+ it != zypp_ptr()->pool().byKindEnd(kind);
+ ++it)
+ {
+ if (stat_str == "to_install" && it->status().isToBeInstalled())
+ {
+ return YCPBoolean(true);
+ }
+ else if (stat_str == "to_remove" && it->status().isToBeUninstalled())
+ {
+ return YCPBoolean(true);
+ }
+ }
+ }
+ catch (...)
+ {
+ y2error("An error occurred during resolvable search.");
+ return YCPNull();
+ }
+
+ return YCPBoolean(false);
+}
+
Modified: trunk/pkg-bindings/src/Source_Load.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Source_Load.cc?…
==============================================================================
--- trunk/pkg-bindings/src/Source_Load.cc (original)
+++ trunk/pkg-bindings/src/Source_Load.cc Thu Dec 6 15:42:40 2007
@@ -103,14 +103,14 @@
PkgModuleFunctions::SourceLoad()
{
std::list<std::string> stages;
- stages.push_back("Refresh Sources");
- stages.push_back("Rebuild Cache");
- stages.push_back("Load Data");
+ stages.push_back(_("Refresh Sources"));
+ stages.push_back(_("Rebuild Cache"));
+ stages.push_back(_("Load Data"));
PkgProgress pkgprogress(_callbackHandler);
// 3 steps per repository (download, cache rebuild, load resolvables)
- pkgprogress.Start("Loading the Package Manager...", stages, "help");
+ pkgprogress.Start(_("Loading the Package Manager..."), stages, _("help"));
YCPValue ret = SourceLoadImpl(pkgprogress);
@@ -289,13 +289,13 @@
if (enable->value())
{
std::list<std::string> stages;
- stages.push_back("Load Sources");
- stages.push_back("Refresh Sources");
- stages.push_back("Rebuild Cache");
- stages.push_back("Load Data");
+ stages.push_back(_("Load Sources"));
+ stages.push_back(_("Refresh Sources"));
+ stages.push_back(_("Rebuild Cache"));
+ stages.push_back(_("Load Data"));
// 3 steps per repository (download, cache rebuild, load resolvables)
- pkgprogress.Start("Loading the Package Manager...", stages, "help");
+ pkgprogress.Start(_("Loading the Package Manager..."), stages, _("help"));
}
YCPValue ret = SourceStartManagerImpl(enable, pkgprogress);
Modified: trunk/pkg-bindings/src/Target.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Target.cc?rev=4…
==============================================================================
--- trunk/pkg-bindings/src/Target.cc (original)
+++ trunk/pkg-bindings/src/Target.cc Thu Dec 6 15:42:40 2007
@@ -33,99 +33,14 @@
#include <ycp/YCPList.h>
#include <ycp/YCPMap.h>
-#include <sys/statvfs.h>
-
-#include <zypp/target/rpm/RpmDb.h>
#include <zypp/Product.h>
-#include <zypp/DiskUsageCounter.h>
+#include <zypp/target/rpm/RpmDb.h>
#include <zypp/target/store/PersistentStorage.h>
using namespace zypp;
/** ------------------------
*
- * @builtin TargetInit
- * @deprecated
- * @short Initialize Target and load resolvables
- * @param string root Root Directory
- * @param boolean new If true, initialize new rpm database
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetInit (const YCPString& root, const YCPBoolean & /*unused_and_broken*/)
-{
- std::string r = root->value();
-
- try
- {
- zypp_ptr()->initTarget(r);
- zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInit has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- _target_root = zypp::Pathname(root->value());
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetInitialize
- * @short Initialize Target, read the keys.
- * @param string root Root Directory
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetInitialize (const YCPString& root)
-{
- std::string r = root->value();
-
- try
- {
- zypp_ptr()->initializeTarget(r);
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInit has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- _target_root = zypp::Pathname(root->value());
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetLoad
- * @short Load target resolvables into the pool
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetLoad ()
-{
- try
- {
- zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetLoad has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
* @builtin TargetDisableSources
* @short Disable all sources configured on the target. Typically
* used on upgrade.
@@ -161,30 +76,6 @@
/** ------------------------
*
- * @builtin TargetFinish
- *
- * @short finish target usage
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetFinish ()
-{
- try
- {
- zypp_ptr()->finishTarget();
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetFinish has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
* @builtin TargetInstall
*
* @short install rpm package by filename
@@ -268,102 +159,6 @@
/** ------------------------
- * INTERNAL
- * get_disk_stats
- *
- * return capacity and usage of partition at directory
- */
-static void
-get_disk_stats (const char *fs, long long *used, long long *size, long long *bsize, long long *available)
-{
- struct statvfs sb;
- if (statvfs (fs, &sb) < 0)
- {
- *used = *size = *bsize = *available = -1;
- y2error("statvfs() failed: %s", strerror(errno));
- return;
- }
- *bsize = sb.f_frsize ? : sb.f_bsize; // block size
- *size = sb.f_blocks * *bsize; // total size
- *used = (sb.f_blocks - sb.f_bfree) * *bsize;
- *available = sb.f_bavail * *bsize; // available for non-root user
-
- y2debug("stavfs: dir: %s, sb.f_frsize: %lu, sb.f_bsize: %lu, sb.f_blocks: %lu, sb.f_bfree: %lu, sb.f_bavail: %lu, bsize: %lld, size: %lld, used: %lld, available: %lld", fs, sb.f_frsize, sb.f_bsize, sb.f_blocks, sb.f_bfree, sb.f_bavail, *bsize, *size, *used, *available);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetCapacity
- *
- * @short return capacity of partition at directory
- * @param string directory
- * @return integer
- */
-YCPInteger
-PkgModuleFunctions::TargetCapacity (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (size);
-}
-
-/** ------------------------
- *
- * @builtin TargetUsed
- *
- * @short Return usage of partition at directory
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetUsed (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (used);
-}
-
-/** ------------------------
- *
- * @builtin TargetAvailable
- *
- * @short Return free space for non-root user (use Pkg::TargetCapacity(dir) - Pkg::TargetUsed(dir) to get free space including the space reserved for root user).
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetAvailable(const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (avail);
-}
-
-/** ------------------------
- *
- * @builtin TargetBlockSize
- *
- * @short Return block size of partition at directory
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetBlockSize (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (bsize);
-}
-
-/** ------------------------
*
* @builtin TargetProducts
*
@@ -470,226 +265,6 @@
return YCPBoolean(true);
}
-// helper funtion
-// initialize the disk usage counter with the current values from the system
-void PkgModuleFunctions::SetCurrentDU()
-{
- // read data from system
- zypp::DiskUsageCounter::MountPointSet system = zypp::DiskUsageCounter::detectMountPoints();
-
- // set the mount points
- zypp_ptr()->setPartitions(system);
-}
-
-YCPMap PkgModuleFunctions::MPS2YCPMap(const zypp::DiskUsageCounter::MountPointSet &mps)
-{
- YCPMap dirmap;
-
- // create result data structure from the stored info and calculated disk usage
- for (zypp::DiskUsageCounter::MountPointSet::const_iterator mpit = mps.begin();
- mpit != mps.end();
- mpit++)
- {
- YCPList sizelist;
- // partition size
- sizelist->add (YCPInteger (mpit->total_size));
- // already used
- sizelist->add (YCPInteger (mpit->used_size));
- // used size after PkgCommit()
- sizelist->add (YCPInteger (mpit->pkg_size));
- // readonly flag
- sizelist->add (YCPInteger (mpit->readonly ? 1 : 0));
-
- std::string dir = mpit->dir;
- if (dir.size() > 1 && dir[0] != '/')
- {
- dir.insert(dir.begin(), '/');
- }
-
- // add the map
- dirmap->add (YCPString(mpit->dir), sizelist);
- }
-
- return dirmap;
-}
-
-
-/** ------------------------
- *
- * @builtin TargetInitDU
- *
- * @short Initialize Disk Usage Calculation
- * @description
- * init DU calculation for given directories
- *
- * <code>
- * parameter: [ $["name":"dir-without-leading-slash",
- * "free":int_free,
- * "used":int_used,
- * "readonly":bool] ]
- *
- * </code>
- * @param list<map> param
- * @return void
- */
-YCPValue
-PkgModuleFunctions::TargetInitDU (const YCPList& dirlist)
-{
- // remember partitioning
- if (dirlist->size() == 0)
- {
- y2milestone("Initializing Disk Usage couter from the system");
- SetCurrentDU();
- return YCPVoid();
- }
-
- zypp::DiskUsageCounter::MountPointSet mount_points;
-
- for (int i = 0; i < dirlist->size(); ++i)
- {
- bool good = true;
- YCPMap partmap;
- std::string dname;
- long long bsize = 4096LL;
- long long dfree = 0LL;
- long long dused = 0LL;
- bool readonly = false;
-
- if (dirlist->value(i)->isMap())
- {
- partmap = dirlist->value(i)->asMap();
- }
- else
- {
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("name")).isNull()
- && partmap->value(YCPString("name"))->isString())
- {
- dname = partmap->value(YCPString("name"))->asString()->value();
- if (dname[0] == '/' && dname.size() > 1)
- {
- // remove the first character (/)
- dname.erase(dname.begin());
- }
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"name\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("free")).isNull()
- && partmap->value(YCPString("free"))->isInteger())
- {
- dfree = partmap->value(YCPString("free"))->asInteger()->value();
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"free\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("used")).isNull()
- && partmap->value(YCPString("used"))->isInteger())
- {
- dused = partmap->value(YCPString("used"))->asInteger()->value();
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"used\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("readonly")).isNull()
- && partmap->value(YCPString("readonly"))->isBoolean())
- {
- readonly = partmap->value(YCPString("readonly"))->asBoolean()->value();
- }
- // else: optional arg, using default
-
- if (!good)
- {
- y2error ("TargetDUInit: bad item %d: %s", i, dirlist->value(i)->toString().c_str());
- continue;
- }
-
- y2milestone("Adding %s", dname.c_str());
-
- long long dirsize = dfree + dused;
-
- // pkg_size is 0
- zypp::DiskUsageCounter::MountPoint mpoint(dname, bsize, dirsize, dused, 0LL, readonly);
- mount_points.insert(mpoint);
- }
-
- try
- {
- zypp_ptr()->setPartitions(mount_points);
- }
- catch (...)
- {
- }
-
- return YCPVoid();
-}
-
-/** ------------------------
- *
- * @builtin TargetGetDU
- *
- * @short return current DU calculations
- * @description
- * <code>
- * $[ "dir" : [ total, used, pkgusage, readonly ], .... ]
- * </code>
- *
- * total == total size for this partition
- *
- * used == current used size on target
- *
- * pkgusage == future used size on target based on current package selection
- *
- * readonly == true/false telling whether the partition is mounted readonly
- *
- * @return map
- */
-YCPValue
-PkgModuleFunctions::TargetGetDU ()
-{
- YCPMap dirmap;
-
- try
- {
- zypp::DiskUsageCounter::MountPointSet mps = zypp_ptr()->diskUsage();
-
- if (mps.empty())
- {
- // mount points have not been defined
- y2warning("Pkg::TargetDUInit() has not been called, using data from system...");
-
- // set the values from the system
- SetCurrentDU();
-
- // try it again
- mps = zypp_ptr()->diskUsage();
- }
-
- dirmap = MPS2YCPMap(mps);
- }
- catch (...)
- {
- }
-
- return dirmap;
-}
-
-
/**
@builtin TargetFileHasOwner
Copied: trunk/pkg-bindings/src/Target_DU.cc (from r42708, trunk/pkg-bindings/src/Target.cc)
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Target_DU.cc?p2…
==============================================================================
--- trunk/pkg-bindings/src/Target.cc (original)
+++ trunk/pkg-bindings/src/Target_DU.cc Thu Dec 6 15:42:40 2007
@@ -1,26 +1,3 @@
-/*---------------------------------------------------------------------\
-| |
-| __ __ ____ _____ ____ |
-| \ \ / /_ _/ ___|_ _|___ \ |
-| \ V / _` \___ \ | | __) | |
-| | | (_| |___) || | / __/ |
-| |_|\__,_|____/ |_| |_____| |
-| |
-| core system |
-| (C) SuSE GmbH |
-\----------------------------------------------------------------------/
-
- File: PkgModuleFunctionsTarget.cc
-
- Author: Klaus Kaempf <kkaempf(a)suse.de>
- Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
- Summary: Access to Installation Target
- Namespace: Pkg
- Purpose: Access to InstTarget
- Handles target related Pkg::function (list_of_arguments) calls
- from WFMInterpreter.
-/-*/
-
#include <PkgModule.h>
#include <PkgModuleFunctions.h>
@@ -35,237 +12,7 @@
#include <sys/statvfs.h>
-#include <zypp/target/rpm/RpmDb.h>
-#include <zypp/Product.h>
#include <zypp/DiskUsageCounter.h>
-#include <zypp/target/store/PersistentStorage.h>
-
-using namespace zypp;
-
-/** ------------------------
- *
- * @builtin TargetInit
- * @deprecated
- * @short Initialize Target and load resolvables
- * @param string root Root Directory
- * @param boolean new If true, initialize new rpm database
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetInit (const YCPString& root, const YCPBoolean & /*unused_and_broken*/)
-{
- std::string r = root->value();
-
- try
- {
- zypp_ptr()->initTarget(r);
- zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInit has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- _target_root = zypp::Pathname(root->value());
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetInitialize
- * @short Initialize Target, read the keys.
- * @param string root Root Directory
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetInitialize (const YCPString& root)
-{
- std::string r = root->value();
-
- try
- {
- zypp_ptr()->initializeTarget(r);
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInit has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- _target_root = zypp::Pathname(root->value());
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetLoad
- * @short Load target resolvables into the pool
- * @return boolean
- */
-YCPValue
-PkgModuleFunctions::TargetLoad ()
-{
- try
- {
- zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetLoad has failed: %s", excpt.msg().c_str() );
- return YCPError(excpt.msg().c_str(), YCPBoolean(false));
- }
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetDisableSources
- * @short Disable all sources configured on the target. Typically
- * used on upgrade.
- * @return boolean true on success.
- */
-YCPBoolean
-PkgModuleFunctions::TargetDisableSources ()
-{
- try
- {
-// FIXME: should it also remove from pool?
-
- zypp::RepoManager repomanager = CreateRepoManager();
- std::list<zypp::RepoInfo> all_sources = repomanager.knownRepositories();
-
- for (std::list<zypp::RepoInfo>::iterator it = all_sources.begin(); it != all_sources.end(); ++it)
- {
- y2milestone("Disabling source '%s'", it->alias().c_str());
- it->setAutorefresh(false);
-
- repomanager.modifyRepository(it->alias(), *it);
- }
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetDisableSources has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetFinish
- *
- * @short finish target usage
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetFinish ()
-{
- try
- {
- zypp_ptr()->finishTarget();
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetFinish has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetInstall
- *
- * @short install rpm package by filename
- * @description
- * the filename must be an absolute path to a file which can
- * be accessed by the package manager.
- *
- * @note This builtin uses callbacks * You should do an 'import "PackageCallbacks"' before calling this.
- * @param string filename
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetInstall(const YCPString& filename)
-{
- try
- {
- zypp_ptr()->target()->rpmDb().installPackage(filename->value());
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInstall has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetRemove
- *
- * @short Install package by name
- * @description
- * Install package by name
- * @note This builtin uses callbacks * You should do an 'import "PackageCallbacks"' before calling this.
- * @param string name
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetRemove(const YCPString& name)
-{
- try
- {
- zypp_ptr()->target()->rpmDb().removePackage(name->value());
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetRemove has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
-
- return YCPBoolean (true);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetLogfile
- * @short init logfile for target
- * @param string name
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetLogfile (const YCPString& name)
-{
- try
- {
- return YCPBoolean (zypp_ptr()->target()->setInstallationLogfile (name->value()));
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetLogfile has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
- return YCPBoolean (true); // never reached
-}
-
/** ------------------------
* INTERNAL
@@ -363,113 +110,6 @@
return YCPInteger (bsize);
}
-/** ------------------------
- *
- * @builtin TargetProducts
- *
- * @short Return list of maps of all installed products
- * @description
- * return list of maps of all installed products in reverse
- * installation order (product installed last comes first)
- *
- * Deprecated, will be replaced by ResolvableProperties() in the future.
- *
- * @return list
- */
-
-YCPList
-PkgModuleFunctions::TargetProducts ()
-{
- YCPList products;
-
- try
- {
- for (ResStore::resfilter_const_iterator it = zypp_ptr()->target()->byKindBegin(ResTraits<Product>::kind); it != zypp_ptr()->target()->byKindEnd(ResTraits<Product>::kind); ++it)
- {
- zypp::Product::constPtr product = asKind<const zypp::Product>( *it );
-#warning TargetProducts does not return all keys
- YCPMap prod;
- // see also PkgModuleFunctions::Descr2Map and Product.ycp::Product
-// FIXME unify with code in Pkg::ResolvablePropertiesEx
- prod->add( YCPString("name"), YCPString( product->name() ) );
- prod->add( YCPString("version"), YCPString( product->edition().version() ) );
- prod->add(YCPString("category"), YCPString(product->category()));
- prod->add(YCPString("vendor"), YCPString(product->vendor()));
- prod->add(YCPString("relnotes_url"), YCPString(product->releaseNotesUrl().asString()));
- std::string product_summary = product->summary();
- if (product_summary.size() > 0)
- {
- prod->add(YCPString("display_name"), YCPString(product_summary));
- }
- std::string product_shortname = product->shortName();
- if (product_shortname.size() > 0)
- {
- prod->add(YCPString("short_name"), YCPString(product_shortname));
- }
- // use summary for the short name if it's defined
- else if (product_summary.size() > 0)
- {
- prod->add(YCPString("short_name"), YCPString(product_summary));
- }
- prod->add(YCPString("description"), YCPString((*it)->description()));
-
- std::string resolvable_summary = (*it)->summary();
- if (resolvable_summary.size() > 0)
- {
- prod->add(YCPString("summary"), YCPString((*it)->summary()));
- }
- YCPList updateUrls;
- std::list<zypp::Url> pupdateUrls = product->updateUrls();
- for (std::list<zypp::Url>::const_iterator it = pupdateUrls.begin(); it != pupdateUrls.end(); ++it)
- {
- updateUrls->add(YCPString(it->asString()));
- }
- prod->add(YCPString("update_urls"), updateUrls);
-
- YCPList flags;
- std::list<std::string> pflags = product->flags();
- for (std::list<std::string>::const_iterator flag_it = pflags.begin();
- flag_it != pflags.end(); ++flag_it)
- {
- flags->add(YCPString(*flag_it));
- }
- prod->add(YCPString("flags"), flags);
-
- products->add(prod);
- }
- }
- catch(...)
- {
- }
-
- return products;
-}
-
-/** ------------------------
- *
- * @builtin TargetRebuildDB
- *
- * @short call "rpm --rebuilddb"
- * @return boolean
- */
-
-YCPBoolean
-PkgModuleFunctions::TargetRebuildDB ()
-{
- try
- {
- zypp_ptr()->target()->rpmDb().rebuildDatabase();
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetRebuildDB has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
// helper funtion
// initialize the disk usage counter with the current values from the system
void PkgModuleFunctions::SetCurrentDU()
@@ -691,107 +331,3 @@
-/**
- @builtin TargetFileHasOwner
-
- @short returns true if the file is owned by a package
- @param string filepath
- @return boolean
-*/
-
-YCPBoolean
-PkgModuleFunctions::TargetFileHasOwner (const YCPString& filepath)
-{
- try
- {
- return YCPBoolean (zypp_ptr()->target()->whoOwnsFile(filepath->value()));
- }
- catch (...)
- {
- }
-
- return YCPBoolean(false);
-}
-
-
-/**
- @builtin TargetStoreRemove
-
- @short remove all resolvables from the DB in the target system (removes only metadata in the package manager!)
- @description
- Use this function only in a special case, direct access to the DB should not be used in general!
- Warning: this built in can cause inconsistency between the package manager and the system!
- @param root path to the root directory
- @param kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern or `language
- @return boolean true = success
-*/
-YCPBoolean
-PkgModuleFunctions::TargetStoreRemove(const YCPString& root, const YCPSymbol& kind_r)
-{
- zypp::Resolvable::Kind kind;
- std::string req_kind = kind_r->symbol();
-
- if( req_kind == "product" ) {
- kind = zypp::ResTraits<zypp::Product>::kind;
- }
- else if ( req_kind == "patch" ) {
- kind = zypp::ResTraits<zypp::Patch>::kind;
- }
- else if ( req_kind == "package" ) {
- kind = zypp::ResTraits<zypp::Package>::kind;
- }
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraits<zypp::Selection>::kind;
- }
- else if ( req_kind == "pattern" ) {
- kind = zypp::ResTraits<zypp::Pattern>::kind;
- }
- else if ( req_kind == "language" ) {
- kind = zypp::ResTraits<zypp::Language>::kind;
- }
- else
- {
- y2error("Pkg::TargetStoreRemove: unknown symbol: %s", req_kind.c_str());
- return YCPBoolean(false);
- }
-
- bool success = true;
-
- std::string target_root = root->value();
- if (target_root.empty())
- {
- y2error("Pkg::TargetStoreRemove: parameter root is empty");
- return YCPBoolean(false);
- }
-
- try
- {
- // create a storage
- zypp::storage::PersistentStorage store;
- store.init( target_root );
-
- // get all resolvables of the required kind
- std::list<ResObject::Ptr> objects = store.storedObjects(kind);
-
- y2warning("Removing %zd objects of kind '%s' from %s", objects.size(), req_kind.c_str(), target_root.c_str());
-
- // remove the resolvables
- for( std::list<ResObject::Ptr>::const_iterator it = objects.begin(); it != objects.end(); ++it)
- {
- try {
- store.deleteObject(*it);
- } catch( const zypp::Exception& excpt )
- {
- y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
- success = false;
- }
- }
- }
- catch( const zypp::Exception& excpt )
- {
- y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
- success = false;
- }
-
- return YCPBoolean(success);
-}
Copied: trunk/pkg-bindings/src/Target_Load.cc (from r42708, trunk/pkg-bindings/src/Target.cc)
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Target_Load.cc?…
==============================================================================
--- trunk/pkg-bindings/src/Target.cc (original)
+++ trunk/pkg-bindings/src/Target_Load.cc Thu Dec 6 15:42:40 2007
@@ -1,26 +1,28 @@
-/*---------------------------------------------------------------------\
-| |
-| __ __ ____ _____ ____ |
-| \ \ / /_ _/ ___|_ _|___ \ |
-| \ V / _` \___ \ | | __) | |
-| | | (_| |___) || | / __/ |
-| |_|\__,_|____/ |_| |_____| |
-| |
-| core system |
-| (C) SuSE GmbH |
-\----------------------------------------------------------------------/
-
- File: PkgModuleFunctionsTarget.cc
-
- Author: Klaus Kaempf <kkaempf(a)suse.de>
- Maintainer: Klaus Kaempf <kkaempf(a)suse.de>
- Summary: Access to Installation Target
- Namespace: Pkg
- Purpose: Access to InstTarget
- Handles target related Pkg::function (list_of_arguments) calls
- from WFMInterpreter.
-/-*/
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2007 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+/*
+ File: $Id$
+ Author: Ladislav Slezák <lslezak(a)novell.com>
+ Summary: Functions for initializing the package manager (target system)
+*/
#include <PkgModule.h>
#include <PkgModuleFunctions.h>
@@ -33,14 +35,8 @@
#include <ycp/YCPList.h>
#include <ycp/YCPMap.h>
-#include <sys/statvfs.h>
-
-#include <zypp/target/rpm/RpmDb.h>
-#include <zypp/Product.h>
-#include <zypp/DiskUsageCounter.h>
-#include <zypp/target/store/PersistentStorage.h>
-
-using namespace zypp;
+#include <zypp/Target.h>
+#include "PkgProgress.h"
/** ------------------------
*
@@ -56,9 +52,17 @@
{
std::string r = root->value();
+ std::list<std::string> stages;
+ stages.push_back(_("Initialize the Target System"));
+ stages.push_back(_("Read Installed Packages"));
+
+ PkgProgress pkgprogress(_callbackHandler);
+ pkgprogress.Start(_("Loading the Package Manager..."), stages, _("help"));
+
try
{
zypp_ptr()->initTarget(r);
+ pkgprogress.NextStage();
zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
}
catch (zypp::Exception & excpt)
@@ -69,6 +73,8 @@
}
_target_root = zypp::Pathname(root->value());
+
+ pkgprogress.Done();
return YCPBoolean(true);
}
@@ -110,6 +116,13 @@
YCPValue
PkgModuleFunctions::TargetLoad ()
{
+ std::list<std::string> stages;
+ stages.push_back(_("Read Installed Packages"));
+
+ PkgProgress pkgprogress(_callbackHandler);
+
+ pkgprogress.Start(_("Loading the Package Manager..."), stages, _("help"));
+
try
{
zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
@@ -120,42 +133,9 @@
ycperror("TargetLoad has failed: %s", excpt.msg().c_str() );
return YCPError(excpt.msg().c_str(), YCPBoolean(false));
}
-
- return YCPBoolean(true);
-}
-
-/** ------------------------
- *
- * @builtin TargetDisableSources
- * @short Disable all sources configured on the target. Typically
- * used on upgrade.
- * @return boolean true on success.
- */
-YCPBoolean
-PkgModuleFunctions::TargetDisableSources ()
-{
- try
- {
-// FIXME: should it also remove from pool?
-
- zypp::RepoManager repomanager = CreateRepoManager();
- std::list<zypp::RepoInfo> all_sources = repomanager.knownRepositories();
-
- for (std::list<zypp::RepoInfo>::iterator it = all_sources.begin(); it != all_sources.end(); ++it)
- {
- y2milestone("Disabling source '%s'", it->alias().c_str());
- it->setAutorefresh(false);
-
- repomanager.modifyRepository(it->alias(), *it);
- }
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetDisableSources has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
+ pkgprogress.Done();
+
return YCPBoolean(true);
}
@@ -183,615 +163,4 @@
return YCPBoolean(true);
}
-/** ------------------------
- *
- * @builtin TargetInstall
- *
- * @short install rpm package by filename
- * @description
- * the filename must be an absolute path to a file which can
- * be accessed by the package manager.
- *
- * @note This builtin uses callbacks * You should do an 'import "PackageCallbacks"' before calling this.
- * @param string filename
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetInstall(const YCPString& filename)
-{
- try
- {
- zypp_ptr()->target()->rpmDb().installPackage(filename->value());
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetInstall has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetRemove
- *
- * @short Install package by name
- * @description
- * Install package by name
- * @note This builtin uses callbacks * You should do an 'import "PackageCallbacks"' before calling this.
- * @param string name
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetRemove(const YCPString& name)
-{
- try
- {
- zypp_ptr()->target()->rpmDb().removePackage(name->value());
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetRemove has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
-
- return YCPBoolean (true);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetLogfile
- * @short init logfile for target
- * @param string name
- * @return boolean
- */
-YCPBoolean
-PkgModuleFunctions::TargetLogfile (const YCPString& name)
-{
- try
- {
- return YCPBoolean (zypp_ptr()->target()->setInstallationLogfile (name->value()));
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetLogfile has failed: %s", excpt.asString().c_str());
- return YCPBoolean(false);
- }
- return YCPBoolean (true); // never reached
-}
-
-
-/** ------------------------
- * INTERNAL
- * get_disk_stats
- *
- * return capacity and usage of partition at directory
- */
-static void
-get_disk_stats (const char *fs, long long *used, long long *size, long long *bsize, long long *available)
-{
- struct statvfs sb;
- if (statvfs (fs, &sb) < 0)
- {
- *used = *size = *bsize = *available = -1;
- y2error("statvfs() failed: %s", strerror(errno));
- return;
- }
- *bsize = sb.f_frsize ? : sb.f_bsize; // block size
- *size = sb.f_blocks * *bsize; // total size
- *used = (sb.f_blocks - sb.f_bfree) * *bsize;
- *available = sb.f_bavail * *bsize; // available for non-root user
-
- y2debug("stavfs: dir: %s, sb.f_frsize: %lu, sb.f_bsize: %lu, sb.f_blocks: %lu, sb.f_bfree: %lu, sb.f_bavail: %lu, bsize: %lld, size: %lld, used: %lld, available: %lld", fs, sb.f_frsize, sb.f_bsize, sb.f_blocks, sb.f_bfree, sb.f_bavail, *bsize, *size, *used, *available);
-}
-
-
-/** ------------------------
- *
- * @builtin TargetCapacity
- *
- * @short return capacity of partition at directory
- * @param string directory
- * @return integer
- */
-YCPInteger
-PkgModuleFunctions::TargetCapacity (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (size);
-}
-
-/** ------------------------
- *
- * @builtin TargetUsed
- *
- * @short Return usage of partition at directory
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetUsed (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (used);
-}
-
-/** ------------------------
- *
- * @builtin TargetAvailable
- *
- * @short Return free space for non-root user (use Pkg::TargetCapacity(dir) - Pkg::TargetUsed(dir) to get free space including the space reserved for root user).
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetAvailable(const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (avail);
-}
-
-/** ------------------------
- *
- * @builtin TargetBlockSize
- *
- * @short Return block size of partition at directory
- * @param string directory
- * @return integer
- *
- */
-YCPInteger
-PkgModuleFunctions::TargetBlockSize (const YCPString& dir)
-{
- long long used, size, bsize, avail;
- get_disk_stats (dir->value().c_str(), &used, &size, &bsize, &avail);
-
- return YCPInteger (bsize);
-}
-
-/** ------------------------
- *
- * @builtin TargetProducts
- *
- * @short Return list of maps of all installed products
- * @description
- * return list of maps of all installed products in reverse
- * installation order (product installed last comes first)
- *
- * Deprecated, will be replaced by ResolvableProperties() in the future.
- *
- * @return list
- */
-
-YCPList
-PkgModuleFunctions::TargetProducts ()
-{
- YCPList products;
-
- try
- {
- for (ResStore::resfilter_const_iterator it = zypp_ptr()->target()->byKindBegin(ResTraits<Product>::kind); it != zypp_ptr()->target()->byKindEnd(ResTraits<Product>::kind); ++it)
- {
- zypp::Product::constPtr product = asKind<const zypp::Product>( *it );
-#warning TargetProducts does not return all keys
- YCPMap prod;
- // see also PkgModuleFunctions::Descr2Map and Product.ycp::Product
-// FIXME unify with code in Pkg::ResolvablePropertiesEx
- prod->add( YCPString("name"), YCPString( product->name() ) );
- prod->add( YCPString("version"), YCPString( product->edition().version() ) );
- prod->add(YCPString("category"), YCPString(product->category()));
- prod->add(YCPString("vendor"), YCPString(product->vendor()));
- prod->add(YCPString("relnotes_url"), YCPString(product->releaseNotesUrl().asString()));
- std::string product_summary = product->summary();
- if (product_summary.size() > 0)
- {
- prod->add(YCPString("display_name"), YCPString(product_summary));
- }
- std::string product_shortname = product->shortName();
- if (product_shortname.size() > 0)
- {
- prod->add(YCPString("short_name"), YCPString(product_shortname));
- }
- // use summary for the short name if it's defined
- else if (product_summary.size() > 0)
- {
- prod->add(YCPString("short_name"), YCPString(product_summary));
- }
- prod->add(YCPString("description"), YCPString((*it)->description()));
-
- std::string resolvable_summary = (*it)->summary();
- if (resolvable_summary.size() > 0)
- {
- prod->add(YCPString("summary"), YCPString((*it)->summary()));
- }
- YCPList updateUrls;
- std::list<zypp::Url> pupdateUrls = product->updateUrls();
- for (std::list<zypp::Url>::const_iterator it = pupdateUrls.begin(); it != pupdateUrls.end(); ++it)
- {
- updateUrls->add(YCPString(it->asString()));
- }
- prod->add(YCPString("update_urls"), updateUrls);
-
- YCPList flags;
- std::list<std::string> pflags = product->flags();
- for (std::list<std::string>::const_iterator flag_it = pflags.begin();
- flag_it != pflags.end(); ++flag_it)
- {
- flags->add(YCPString(*flag_it));
- }
- prod->add(YCPString("flags"), flags);
-
- products->add(prod);
- }
- }
- catch(...)
- {
- }
-
- return products;
-}
-
-/** ------------------------
- *
- * @builtin TargetRebuildDB
- *
- * @short call "rpm --rebuilddb"
- * @return boolean
- */
-
-YCPBoolean
-PkgModuleFunctions::TargetRebuildDB ()
-{
- try
- {
- zypp_ptr()->target()->rpmDb().rebuildDatabase();
- }
- catch (zypp::Exception & excpt)
- {
- _last_error.setLastError(ExceptionAsString(excpt));
- ycperror("TargetRebuildDB has failed: %s", excpt.msg().c_str() );
- return YCPBoolean(false);
- }
-
- return YCPBoolean(true);
-}
-
-// helper funtion
-// initialize the disk usage counter with the current values from the system
-void PkgModuleFunctions::SetCurrentDU()
-{
- // read data from system
- zypp::DiskUsageCounter::MountPointSet system = zypp::DiskUsageCounter::detectMountPoints();
-
- // set the mount points
- zypp_ptr()->setPartitions(system);
-}
-
-YCPMap PkgModuleFunctions::MPS2YCPMap(const zypp::DiskUsageCounter::MountPointSet &mps)
-{
- YCPMap dirmap;
-
- // create result data structure from the stored info and calculated disk usage
- for (zypp::DiskUsageCounter::MountPointSet::const_iterator mpit = mps.begin();
- mpit != mps.end();
- mpit++)
- {
- YCPList sizelist;
- // partition size
- sizelist->add (YCPInteger (mpit->total_size));
- // already used
- sizelist->add (YCPInteger (mpit->used_size));
- // used size after PkgCommit()
- sizelist->add (YCPInteger (mpit->pkg_size));
- // readonly flag
- sizelist->add (YCPInteger (mpit->readonly ? 1 : 0));
-
- std::string dir = mpit->dir;
- if (dir.size() > 1 && dir[0] != '/')
- {
- dir.insert(dir.begin(), '/');
- }
-
- // add the map
- dirmap->add (YCPString(mpit->dir), sizelist);
- }
-
- return dirmap;
-}
-
-
-/** ------------------------
- *
- * @builtin TargetInitDU
- *
- * @short Initialize Disk Usage Calculation
- * @description
- * init DU calculation for given directories
- *
- * <code>
- * parameter: [ $["name":"dir-without-leading-slash",
- * "free":int_free,
- * "used":int_used,
- * "readonly":bool] ]
- *
- * </code>
- * @param list<map> param
- * @return void
- */
-YCPValue
-PkgModuleFunctions::TargetInitDU (const YCPList& dirlist)
-{
- // remember partitioning
- if (dirlist->size() == 0)
- {
- y2milestone("Initializing Disk Usage couter from the system");
- SetCurrentDU();
- return YCPVoid();
- }
-
- zypp::DiskUsageCounter::MountPointSet mount_points;
-
- for (int i = 0; i < dirlist->size(); ++i)
- {
- bool good = true;
- YCPMap partmap;
- std::string dname;
- long long bsize = 4096LL;
- long long dfree = 0LL;
- long long dused = 0LL;
- bool readonly = false;
-
- if (dirlist->value(i)->isMap())
- {
- partmap = dirlist->value(i)->asMap();
- }
- else
- {
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("name")).isNull()
- && partmap->value(YCPString("name"))->isString())
- {
- dname = partmap->value(YCPString("name"))->asString()->value();
- if (dname[0] == '/' && dname.size() > 1)
- {
- // remove the first character (/)
- dname.erase(dname.begin());
- }
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"name\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("free")).isNull()
- && partmap->value(YCPString("free"))->isInteger())
- {
- dfree = partmap->value(YCPString("free"))->asInteger()->value();
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"free\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("used")).isNull()
- && partmap->value(YCPString("used"))->isInteger())
- {
- dused = partmap->value(YCPString("used"))->asInteger()->value();
- }
- else
- {
- y2error("Pkg::TargetInitDU: \"used\" key is missing");
- good = false;
- }
-
- if (good
- && !partmap->value(YCPString("readonly")).isNull()
- && partmap->value(YCPString("readonly"))->isBoolean())
- {
- readonly = partmap->value(YCPString("readonly"))->asBoolean()->value();
- }
- // else: optional arg, using default
-
- if (!good)
- {
- y2error ("TargetDUInit: bad item %d: %s", i, dirlist->value(i)->toString().c_str());
- continue;
- }
-
- y2milestone("Adding %s", dname.c_str());
-
- long long dirsize = dfree + dused;
-
- // pkg_size is 0
- zypp::DiskUsageCounter::MountPoint mpoint(dname, bsize, dirsize, dused, 0LL, readonly);
- mount_points.insert(mpoint);
- }
-
- try
- {
- zypp_ptr()->setPartitions(mount_points);
- }
- catch (...)
- {
- }
-
- return YCPVoid();
-}
-
-/** ------------------------
- *
- * @builtin TargetGetDU
- *
- * @short return current DU calculations
- * @description
- * <code>
- * $[ "dir" : [ total, used, pkgusage, readonly ], .... ]
- * </code>
- *
- * total == total size for this partition
- *
- * used == current used size on target
- *
- * pkgusage == future used size on target based on current package selection
- *
- * readonly == true/false telling whether the partition is mounted readonly
- *
- * @return map
- */
-YCPValue
-PkgModuleFunctions::TargetGetDU ()
-{
- YCPMap dirmap;
- try
- {
- zypp::DiskUsageCounter::MountPointSet mps = zypp_ptr()->diskUsage();
-
- if (mps.empty())
- {
- // mount points have not been defined
- y2warning("Pkg::TargetDUInit() has not been called, using data from system...");
-
- // set the values from the system
- SetCurrentDU();
-
- // try it again
- mps = zypp_ptr()->diskUsage();
- }
-
- dirmap = MPS2YCPMap(mps);
- }
- catch (...)
- {
- }
-
- return dirmap;
-}
-
-
-
-/**
- @builtin TargetFileHasOwner
-
- @short returns true if the file is owned by a package
- @param string filepath
- @return boolean
-*/
-
-YCPBoolean
-PkgModuleFunctions::TargetFileHasOwner (const YCPString& filepath)
-{
- try
- {
- return YCPBoolean (zypp_ptr()->target()->whoOwnsFile(filepath->value()));
- }
- catch (...)
- {
- }
-
- return YCPBoolean(false);
-}
-
-
-/**
- @builtin TargetStoreRemove
-
- @short remove all resolvables from the DB in the target system (removes only metadata in the package manager!)
- @description
- Use this function only in a special case, direct access to the DB should not be used in general!
- Warning: this built in can cause inconsistency between the package manager and the system!
- @param root path to the root directory
- @param kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern or `language
- @return boolean true = success
-*/
-YCPBoolean
-PkgModuleFunctions::TargetStoreRemove(const YCPString& root, const YCPSymbol& kind_r)
-{
- zypp::Resolvable::Kind kind;
- std::string req_kind = kind_r->symbol();
-
- if( req_kind == "product" ) {
- kind = zypp::ResTraits<zypp::Product>::kind;
- }
- else if ( req_kind == "patch" ) {
- kind = zypp::ResTraits<zypp::Patch>::kind;
- }
- else if ( req_kind == "package" ) {
- kind = zypp::ResTraits<zypp::Package>::kind;
- }
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraits<zypp::Selection>::kind;
- }
- else if ( req_kind == "pattern" ) {
- kind = zypp::ResTraits<zypp::Pattern>::kind;
- }
- else if ( req_kind == "language" ) {
- kind = zypp::ResTraits<zypp::Language>::kind;
- }
- else
- {
- y2error("Pkg::TargetStoreRemove: unknown symbol: %s", req_kind.c_str());
- return YCPBoolean(false);
- }
-
- bool success = true;
-
- std::string target_root = root->value();
- if (target_root.empty())
- {
- y2error("Pkg::TargetStoreRemove: parameter root is empty");
- return YCPBoolean(false);
- }
-
- try
- {
- // create a storage
- zypp::storage::PersistentStorage store;
- store.init( target_root );
-
- // get all resolvables of the required kind
- std::list<ResObject::Ptr> objects = store.storedObjects(kind);
-
- y2warning("Removing %zd objects of kind '%s' from %s", objects.size(), req_kind.c_str(), target_root.c_str());
-
- // remove the resolvables
- for( std::list<ResObject::Ptr>::const_iterator it = objects.begin(); it != objects.end(); ++it)
- {
- try {
- store.deleteObject(*it);
- } catch( const zypp::Exception& excpt )
- {
- y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
- success = false;
- }
- }
- }
- catch( const zypp::Exception& excpt )
- {
- y2error("TargetStoreRemove has failed: %s", excpt.msg().c_str());
- success = false;
- }
-
- return YCPBoolean(success);
-}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: coolo
Date: Thu Dec 6 15:24:09 2007
New Revision: 42763
URL: http://svn.opensuse.org/viewcvs/yast?rev=42763&view=rev
Log:
fixing spec file
Modified:
trunk/qt4/yast2-qt4.spec.in
Modified: trunk/qt4/yast2-qt4.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/yast2-qt4.spec.in?rev=42763&…
==============================================================================
--- trunk/qt4/yast2-qt4.spec.in (original)
+++ trunk/qt4/yast2-qt4.spec.in Thu Dec 6 15:24:09 2007
@@ -2,7 +2,7 @@
@HEADER@
-BuildRequires: dbus-1-devel boost-devel libzypp-devel curl-devel docbook-xsl-stylesheets doxygen libdrm-devel libjpeg-devel libxcrypt-devel libxslt perl-XML-Writer libqt4-devel rpm-devel sgml-skel update-desktop-files yast2-devtools yast2-core-devel hal-devel
+BuildRequires: dbus-1-devel boost-devel libzypp-devel curl-devel docbook-xsl-stylesheets doxygen libdrm-devel libjpeg-devel libxcrypt-devel libxslt perl-XML-Writer libqt4-devel rpm-devel sgml-skel update-desktop-files yast2-devtools hal-devel
Summary: -
BuildRequires: yast2-core-devel >= 2.16.11
@@ -25,7 +25,7 @@
%build
mkdir build
cd build
-cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
+cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB=%{_lib} \
-DCMAKE_C_FLAGS="%{optflags}" \
-DCMAKE_CXX_FLAGS="%{optflags}" \
@@ -51,15 +51,10 @@
%files
%defattr (-, root, root)
-@YAST_PLUGIN_DIR@/libpy2qt4.so.*
-@YAST_PLUGIN_DIR@/libpy2qt4.so
-@YAST_PLUGIN_DIR@/libpy2qt4_pkg.so.*
-@YAST_PLUGIN_DIR@/libpy2qt4_pkg.so
-@YAST_IMAGE_DIR@
-%dir %{_xorg7fonts}/uni
-%verify(not md5 size mtime) %{_xorg7fonts}/uni/fonts.dir
-%{_xorg7fonts}/uni/newunifont.pcf.gz
-%{_xorg7fonts}/uni/unifont.pcf.gz
-%dir @YAST_DATA_DIR@
-@YAST_DATA_DIR@/lang_fonts
-%doc %{prefix}/share/doc/packages/%{name}
+%_prefix/lib/YaST2/plugin/libpy2qt4.so.*
+%_prefix/lib/YaST2/plugin/libpy2qt4.so
+%_prefix/lib/YaST2/plugin/libpy2qt4_pkg.so.*
+%_prefix/lib/YaST2/plugin/libpy2qt4_pkg.so
+%_prefix/share/YaST2/theme
+
+%changelog
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
06 Dec '07
Author: coolo
Date: Thu Dec 6 14:49:57 2007
New Revision: 42762
URL: http://svn.opensuse.org/viewcvs/yast?rev=42762&view=rev
Log:
copy changes
Modified:
trunk/qt4/package/yast2-qt4.changes
Modified: trunk/qt4/package/yast2-qt4.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/package/yast2-qt4.changes?re…
==============================================================================
--- trunk/qt4/package/yast2-qt4.changes (original)
+++ trunk/qt4/package/yast2-qt4.changes Thu Dec 6 14:49:57 2007
@@ -1,4 +1,22 @@
-------------------------------------------------------------------
+Wed Dec 5 20:41:15 CET 2007 - sh(a)suse.de
+
+- Moved main dialog handling out of YQUI and into a new class
+ YQMainWinDock
+- Don't proactively grab keyboard focus any longer (bug #246934)
+- V 2.16.7
+
+-------------------------------------------------------------------
+Wed Dec 5 11:13:05 CET 2007 - tgoettlicher(a)suse.de
+
+- Changed conflict dialog to better fit to sat solver's output
+
+-------------------------------------------------------------------
+Tue Dec 4 14:57:50 CET 2007 - tgoettlicher(a)suse.de
+
+- Fixed popup windows without decorations (#345825)
+
+-------------------------------------------------------------------
Mon Dec 3 22:01:29 CET 2007 - coolo(a)suse.de
- make it build again
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: coolo
Date: Thu Dec 6 14:48:04 2007
New Revision: 42761
URL: http://svn.opensuse.org/viewcvs/yast?rev=42761&view=rev
Log:
unpack the tar
Modified:
trunk/qt4/yast2-qt4.spec.in
Modified: trunk/qt4/yast2-qt4.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/yast2-qt4.spec.in?rev=42761&…
==============================================================================
--- trunk/qt4/yast2-qt4.spec.in (original)
+++ trunk/qt4/yast2-qt4.spec.in Thu Dec 6 14:48:04 2007
@@ -19,6 +19,9 @@
%description
-
+%prep
+%setup
+
%build
mkdir build
cd build
--
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] r42760 - /branches/tmp/coolo/qt4-port/ /trunk/qt4/
by coolo@svn.opensuse.org 06 Dec '07
by coolo@svn.opensuse.org 06 Dec '07
06 Dec '07
Author: coolo
Date: Thu Dec 6 14:45:57 2007
New Revision: 42760
URL: http://svn.opensuse.org/viewcvs/yast?rev=42760&view=rev
Log:
it's not coolo's
Added:
trunk/qt4/ (props changed)
- copied from r42759, branches/tmp/coolo/qt4-port/
Removed:
branches/tmp/coolo/qt4-port/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0