abtlinux-svn Mailing List for ABout Time Linux (AbTLinux) (Page 8)
Status: Alpha
Brought to you by:
eschabell
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(4) |
May
(61) |
Jun
(5) |
Jul
(12) |
Aug
(1) |
Sep
|
Oct
(29) |
Nov
(89) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(4) |
Feb
(33) |
Mar
(12) |
Apr
|
May
(2) |
Jun
(13) |
Jul
(76) |
Aug
(7) |
Sep
(21) |
Oct
|
Nov
|
Dec
(33) |
2008 |
Jan
(32) |
Feb
(24) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
From: <esc...@us...> - 2007-07-19 21:34:16
|
Revision: 386 http://svn.sourceforge.net/abtlinux/?rev=386&view=rev Author: eschabell Date: 2007-07-19 14:34:14 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Implemented show installed packages and updated unit test to properly deal with a void method. Another test passed, 24 to go. Modified Paths: -------------- src/trunk/abt.rb src/trunk/abtreportmanager.rb src/trunk/testabtreportmanager.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-19 19:26:52 UTC (rev 385) +++ src/trunk/abt.rb 2007-07-19 21:34:14 UTC (rev 386) @@ -244,8 +244,12 @@ end when "show-installed" - puts "Display all installed packages." - show.usage( "queries" ) + if ( ARGV.length == 1 ) + reporter.show_installed_packages() + else + show.usage( "queries" ) + exit + end when "show-frozen" puts "Display all packages frozen at current version." Modified: src/trunk/abtreportmanager.rb =================================================================== --- src/trunk/abtreportmanager.rb 2007-07-19 19:26:52 UTC (rev 385) +++ src/trunk/abtreportmanager.rb 2007-07-19 21:34:14 UTC (rev 386) @@ -96,6 +96,14 @@ # <b>RETURN</b> <i>void.</i> ## def show_installed_packages + if ( Dir.entries( $PACKAGE_INSTALLED ) - [ '.', '..' ] ).empty? + puts "\nNo AbTLinux packages are listed as installed, is your #{$PACKAGE_INSTALLED} empty?\n\n" + else + puts "\nInstalled AbTLinux packages:" + puts "============================" + Dir.foreach( $PACKAGE_INSTALLED ) { |package| puts package if package != "." && package != ".." } + puts "\n" + end end ## Modified: src/trunk/testabtreportmanager.rb =================================================================== --- src/trunk/testabtreportmanager.rb 2007-07-19 19:26:52 UTC (rev 385) +++ src/trunk/testabtreportmanager.rb 2007-07-19 21:34:14 UTC (rev 386) @@ -54,7 +54,7 @@ # Test method for 'AbtReportManager.test_show_installed_packages()' ## def test_show_installed_packages - assert( @report.show_installed_packages(), "test_show_installed_packages()" ) + assert_nil( @report.show_installed_packages(), "test_show_installed_packages()" ) end ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-19 19:26:51
|
Revision: 385 http://svn.sourceforge.net/abtlinux/?rev=385&view=rev Author: eschabell Date: 2007-07-19 12:26:52 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Regenerated docs. Modified Paths: -------------- src/trunk/doc/classes/AbtDepEngine.html src/trunk/doc/classes/AbtDownloadManager.html src/trunk/doc/classes/AbtLogManager.html src/trunk/doc/classes/AbtPackage.html src/trunk/doc/classes/AbtPackageManager.html src/trunk/doc/classes/AbtQueueManager.html src/trunk/doc/classes/AbtReportManager.html src/trunk/doc/classes/AbtUsage.html src/trunk/doc/classes/TestAbtDepEngine.html src/trunk/doc/classes/TestAbtDownloadManager.html src/trunk/doc/classes/TestAbtLogManager.html src/trunk/doc/classes/TestAbtPackage.html src/trunk/doc/classes/TestAbtPackageManager.html src/trunk/doc/classes/TestAbtQueueManager.html src/trunk/doc/classes/TestAbtReportManager.html src/trunk/doc/classes/TestAbtSystemManager.html src/trunk/doc/created.rid src/trunk/doc/files/abtdownloadmanager_rb.html src/trunk/doc/files/abtpackage_rb.html src/trunk/doc/files/abtpackagemanager_rb.html src/trunk/doc/files/testabtdownloadmanager_rb.html src/trunk/doc/fr_method_index.html Modified: src/trunk/doc/classes/AbtDepEngine.html =================================================================== --- src/trunk/doc/classes/AbtDepEngine.html 2007-07-19 19:23:35 UTC (rev 384) +++ src/trunk/doc/classes/AbtDepEngine.html 2007-07-19 19:26:52 UTC (rev 385) @@ -118,7 +118,7 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000094">new</a></li> + <li><a href="#M000096">new</a></li> </ul> @@ -129,7 +129,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000094"></a><b>new</b>() + <a name="M000096"></a><b>new</b>() </div> <div class="description"> <p> @@ -141,8 +141,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000094_source')" id="l_M000094_source">show source</a> ]</p> - <div id="M000094_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000096_source')" id="l_M000096_source">show source</a> ]</p> + <div id="M000096_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdepengine.rb, line 41</span> 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> Modified: src/trunk/doc/classes/AbtDownloadManager.html =================================================================== --- src/trunk/doc/classes/AbtDownloadManager.html 2007-07-19 19:23:35 UTC (rev 384) +++ src/trunk/doc/classes/AbtDownloadManager.html 2007-07-19 19:26:52 UTC (rev 385) @@ -123,6 +123,7 @@ <li><a href="#M000014">retrieve_package_tree</a></li> <li><a href="#M000016">update_package</a></li> <li><a href="#M000017">update_package_tree</a></li> + <li><a href="#M000018">validated</a></li> </ul> @@ -354,7 +355,47 @@ </div> </div> </div> +<div class="method"> + <div class="title"> + <a name="M000018"></a><b>validated</b>( hashvalue, path ) + </div> + <div class="description"> + <p> +Validates the sources based on package hash value. +</p> +<p> +<b>PARAM</b> <em>String</em> - security hash value from the packages +description. <b>PARAM</b> <em>String</em> - source tarball location to be +checked. +</p> +<p> +<b>RETURNS:</b> <em>boolean</em> - True if the completes sucessfully, +otherwise false. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000018_source')" id="l_M000018_source">show source</a> ]</p> + <div id="M000018_source" class="dyn-source"> +<pre> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 171</span> +171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validated</span>( <span class="ruby-identifier">hashvalue</span>, <span class="ruby-identifier">path</span> ) +172: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> +173: +174: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hashvalue</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">hexdigest</span>( <span class="ruby-identifier">path</span> ) +175: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Source hash validated successfully..."</span> +176: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Validated sources successfully..."</span> ) +177: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +178: <span class="ruby-keyword kw">end</span> +179: +180: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Source hash failed validation..."</span> +181: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Validating sources failed..."</span> ) +182: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +183: <span class="ruby-keyword kw">end</span> +</pre> + </div> </div> +</div> +</div> </div> Modified: src/trunk/doc/classes/AbtLogManager.html =================================================================== --- src/trunk/doc/classes/AbtLogManager.html 2007-07-19 19:23:35 UTC (rev 384) +++ src/trunk/doc/classes/AbtLogManager.html 2007-07-19 19:26:52 UTC (rev 385) @@ -117,13 +117,13 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000068">cache_package</a></li> - <li><a href="#M000063">get_log</a></li> - <li><a href="#M000067">log_package_build</a></li> - <li><a href="#M000066">log_package_install</a></li> - <li><a href="#M000065">log_package_integrity</a></li> - <li><a href="#M000064">new</a></li> - <li><a href="#M000069">to_journal</a></li> + <li><a href="#M000069">cache_package</a></li> + <li><a href="#M000064">get_log</a></li> + <li><a href="#M000068">log_package_build</a></li> + <li><a href="#M000067">log_package_install</a></li> + <li><a href="#M000066">log_package_integrity</a></li> + <li><a href="#M000065">new</a></li> + <li><a href="#M000070">to_journal</a></li> </ul> @@ -134,7 +134,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>new</b>() + <a name="M000065"></a><b>new</b>() </div> <div class="description"> <p> @@ -147,8 +147,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> - <div id="M000064_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> + <div id="M000065_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 80</span> 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> @@ -168,7 +168,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000068"></a><b>cache_package</b>( package ) + <a name="M000069"></a><b>cache_package</b>( package ) </div> <div class="description"> <p> @@ -184,8 +184,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> - <div id="M000068_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p> + <div id="M000069_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 208</span> 208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_package</span>( <span class="ruby-identifier">package</span> ) @@ -271,7 +271,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000063"></a><b>get_log</b>( package, type ) + <a name="M000064"></a><b>get_log</b>( package, type ) </div> <div class="description"> <p> @@ -285,8 +285,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p> - <div id="M000063_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> + <div id="M000064_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 43</span> 43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">type</span> ) @@ -324,7 +324,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000067"></a><b>log_package_build</b>( package ) + <a name="M000068"></a><b>log_package_build</b>( package ) </div> <div class="description"> <p> @@ -340,8 +340,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> - <div id="M000067_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> + <div id="M000068_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 188</span> 188: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_build</span>( <span class="ruby-identifier">package</span> ) @@ -360,7 +360,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>log_package_install</b>( package ) + <a name="M000067"></a><b>log_package_install</b>( package ) </div> <div class="description"> <p> @@ -376,8 +376,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> - <div id="M000066_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> + <div id="M000067_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 141</span> 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_install</span>( <span class="ruby-identifier">package</span> ) @@ -423,7 +423,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>log_package_integrity</b>( package ) + <a name="M000066"></a><b>log_package_integrity</b>( package ) </div> <div class="description"> <p> @@ -440,8 +440,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> - <div id="M000065_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> + <div id="M000066_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 101</span> 101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_integrity</span>( <span class="ruby-identifier">package</span> ) @@ -480,7 +480,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000069"></a><b>to_journal</b>( message ) + <a name="M000070"></a><b>to_journal</b>( message ) </div> <div class="description"> <p> @@ -495,8 +495,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p> - <div id="M000069_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000070_source')" id="l_M000070_source">show source</a> ]</p> + <div id="M000070_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 294</span> 294: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_journal</span>( <span class="ruby-identifier">message</span> ) Modified: src/trunk/doc/classes/AbtPackage.html =================================================================== --- src/trunk/doc/classes/AbtPackage.html 2007-07-19 19:23:35 UTC (rev 384) +++ src/trunk/doc/classes/AbtPackage.html 2007-07-19 19:26:52 UTC (rev 385) @@ -90,7 +90,7 @@ inheriting from this class (class Fortune < <a href="AbtPackage.html">AbtPackage</a>) one picks up all supported standard functions for the abt <a href="AbtPackage.html">AbtPackage</a> manager to -make use of the <a href="AbtPackage.html#M000026">new</a> <a +make use of the <a href="AbtPackage.html#M000027">new</a> <a href="AbtPackage.html">AbtPackage</a>. </p> <p> @@ -109,7 +109,7 @@ AbTLinux 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 <a -href="AbtPackage.html#M000027">details</a>. +href="AbtPackage.html#M000028">details</a>. </p> <p> You should have received a copy of the GNU General Public License along @@ -122,16 +122,16 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000030">build</a></li> - <li><a href="#M000029">configure</a></li> - <li><a href="#M000027">details</a></li> - <li><a href="#M000032">install</a></li> - <li><a href="#M000026">new</a></li> - <li><a href="#M000033">post</a></li> - <li><a href="#M000028">pre</a></li> - <li><a href="#M000031">preinstall</a></li> - <li><a href="#M000034">remove_build</a></li> - <li><a href="#M000025">unpack_sources</a></li> + <li><a href="#M000031">build</a></li> + <li><a href="#M000030">configure</a></li> + <li><a href="#M000028">details</a></li> + <li><a href="#M000033">install</a></li> + <li><a href="#M000027">new</a></li> + <li><a href="#M000034">post</a></li> + <li><a href="#M000029">pre</a></li> + <li><a href="#M000032">preinstall</a></li> + <li><a href="#M000035">remove_build</a></li> + <li><a href="#M000026">unpack_sources</a></li> </ul> @@ -305,20 +305,20 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000026"></a><b>new</b>( data ) + <a name="M000027"></a><b>new</b>( data ) </div> <div class="description"> <p> Constructor for an <a href="AbtPackage.html">AbtPackage</a>, requires all -the packge <a href="AbtPackage.html#M000027">details</a>. +the packge <a href="AbtPackage.html#M000028">details</a>. </p> <p> <b>PARAM</b> <em>Hash</em> - hash containing all package data. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p> - <div id="M000026_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">show source</a> ]</p> + <div id="M000027_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackage.rb, line 147</span> 147: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">data</span> ) @@ -346,7 +346,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000030"></a><b>build</b>( verbose=true ) + <a name="M000031"></a><b>build</b>( verbose=true ) </div> <div class="description"> <p> @@ -363,40 +363,40 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p> - <div id="M000030_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p> + <div id="M000031_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 269</span> -269: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -270: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -271: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build"</span> -272: <span class="ruby-keyword kw">else</span> -273: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make > #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build 2>&1"</span> -274: <span class="ruby-keyword kw">end</span> -275: -276: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) -277: -278: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) -279: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section failed."</span> -280: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -281: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 274</span> +274: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +275: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +276: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build"</span> +277: <span class="ruby-keyword kw">else</span> +278: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make > #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build 2>&1"</span> +279: <span class="ruby-keyword kw">end</span> +280: +281: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) 282: -283: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -284: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -285: <span class="ruby-keyword kw">end</span> +283: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) +284: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section failed."</span> +285: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +286: <span class="ruby-keyword kw">end</span> +287: +288: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +289: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +290: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000029"></a><b>configure</b>( verbose=true ) + <a name="M000030"></a><b>configure</b>( verbose=true ) </div> <div class="description"> <p> -Here we manage the ./<a href="AbtPackage.html#M000029">configure</a> step +Here we manage the ./<a href="AbtPackage.html#M000030">configure</a> step (or equivalent). We need to give ./<a -href="AbtPackage.html#M000029">configure</a> (or autogen.sh, or whatever) +href="AbtPackage.html#M000030">configure</a> (or autogen.sh, or whatever) the correct options so files are to be placed later in the right directories, so doc files and man pages are all in the same common location, etc. Don‘t forget too that it‘s here where we @@ -412,34 +412,34 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p> - <div id="M000029_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p> + <div id="M000030_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 241</span> -241: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -242: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -243: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure"</span> -244: <span class="ruby-keyword kw">else</span> -245: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} 1> #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure 2>&1"</span> -246: <span class="ruby-keyword kw">end</span> -247: -248: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) -249: -250: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) -251: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.configure] - configure section failed."</span> -252: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -253: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 246</span> +246: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +247: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +248: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure"</span> +249: <span class="ruby-keyword kw">else</span> +250: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} 1> #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure 2>&1"</span> +251: <span class="ruby-keyword kw">end</span> +252: +253: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) 254: -255: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nDEBUG: [AbtPackage.configure] - configure section completed!"</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">verbose</span> ) -256: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -257: <span class="ruby-keyword kw">end</span> +255: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) +256: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.configure] - configure section failed."</span> +257: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +258: <span class="ruby-keyword kw">end</span> +259: +260: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nDEBUG: [AbtPackage.configure] - configure section completed!"</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">verbose</span> ) +261: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +262: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000027"></a><b>details</b>() + <a name="M000028"></a><b>details</b>() </div> <div class="description"> <p> @@ -452,8 +452,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">show source</a> ]</p> - <div id="M000027_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p> + <div id="M000028_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackage.rb, line 172</span> 172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">details</span> @@ -482,7 +482,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000032"></a><b>install</b>( verbose=true ) + <a name="M000033"></a><b>install</b>( verbose=true ) </div> <div class="description"> <p> @@ -498,38 +498,38 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p> - <div id="M000032_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p> + <div id="M000033_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 313</span> -313: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -314: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -315: <span class="ruby-identifier">command</span> = <span class="ruby-value str">"installwatch --transl=no --backup=no "</span> <span class="ruby-operator">+</span> -316: <span class="ruby-value str">"--exclude=/dev,/proc,/tmp,/var/tmp,/usr/src,/sys "</span> <span class="ruby-operator">+</span> -317: <span class="ruby-node">"--logfile=#{$ABT_TMP}/#{@srcDir}.watch make install"</span> -318: <span class="ruby-keyword kw">else</span> -319: <span class="ruby-identifier">command</span> = <span class="ruby-value str">"installwatch --transl=no --backup=no "</span> <span class="ruby-operator">+</span> -320: <span class="ruby-value str">"--exclude=/dev,/proc,/tmp,/var/tmp,/usr/src,/sys "</span> <span class="ruby-operator">+</span> -321: <span class="ruby-node">"--logfile=#{$ABT_TMP}/#{@srcDir}.watch make install >/dev/null"</span> -322: <span class="ruby-keyword kw">end</span> -323: -324: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) -325: -326: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) -327: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.install] - install section failed."</span> -328: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -329: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 318</span> +318: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +319: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +320: <span class="ruby-identifier">command</span> = <span class="ruby-value str">"installwatch --transl=no --backup=no "</span> <span class="ruby-operator">+</span> +321: <span class="ruby-value str">"--exclude=/dev,/proc,/tmp,/var/tmp,/usr/src,/sys "</span> <span class="ruby-operator">+</span> +322: <span class="ruby-node">"--logfile=#{$ABT_TMP}/#{@srcDir}.watch make install"</span> +323: <span class="ruby-keyword kw">else</span> +324: <span class="ruby-identifier">command</span> = <span class="ruby-value str">"installwatch --transl=no --backup=no "</span> <span class="ruby-operator">+</span> +325: <span class="ruby-value str">"--exclude=/dev,/proc,/tmp,/var/tmp,/usr/src,/sys "</span> <span class="ruby-operator">+</span> +326: <span class="ruby-node">"--logfile=#{$ABT_TMP}/#{@srcDir}.watch make install >/dev/null"</span> +327: <span class="ruby-keyword kw">end</span> +328: +329: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) 330: -331: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.install] - install section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -332: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -333: <span class="ruby-keyword kw">end</span> +331: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) +332: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.install] - install section failed."</span> +333: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +334: <span class="ruby-keyword kw">end</span> +335: +336: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.install] - install section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +337: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +338: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000033"></a><b>post</b>( verbose=true ) + <a name="M000034"></a><b>post</b>( verbose=true ) </div> <div class="description"> <p> @@ -546,21 +546,21 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p> - <div id="M000033_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p> + <div id="M000034_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 345</span> -345: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -346: <span class="ruby-comment cmt"># TODO: implement post section install init scripts service</span> -347: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -348: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 350</span> +350: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +351: <span class="ruby-comment cmt"># TODO: implement post section install init scripts service</span> +352: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +353: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000028"></a><b>pre</b>( verbose=true ) + <a name="M000029"></a><b>pre</b>( verbose=true ) </div> <div class="description"> <p> @@ -577,8 +577,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">show source</a> ]</p> - <div id="M000028_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p> + <div id="M000029_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackage.rb, line 203</span> 203: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pre</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) @@ -589,33 +589,38 @@ 208: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 209: <span class="ruby-keyword kw">end</span> 210: -211: <span class="ruby-comment cmt"># unpack sources.</span> -212: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">unpack_sources</span> ) +211: <span class="ruby-comment cmt"># validate sources sha1.</span> +212: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">downloader</span>.<span class="ruby-identifier">validated</span>( <span class="ruby-ivar">@hashCheck</span>, <span class="ruby-node">"#{$SOURCES_REPOSITORY}/#{File.basename( @srcUrl )}"</span> ) ) 213: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 214: <span class="ruby-keyword kw">end</span> 215: -216: <span class="ruby-comment cmt"># ensure we have an installed directory to use.</span> -217: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{@srcDir}"</span> ) ) -218: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{@srcDir}"</span> ) +216: <span class="ruby-comment cmt"># unpack sources.</span> +217: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">unpack_sources</span> ) +218: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 219: <span class="ruby-keyword kw">end</span> 220: -221: <span class="ruby-comment cmt"># TODO: implement pre section retrieve patches?</span> -222: <span class="ruby-comment cmt"># TODO: implement pre section apply patches?</span> -223: -224: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -225: <span class="ruby-keyword kw">end</span> +221: <span class="ruby-comment cmt"># ensure we have an installed directory to use.</span> +222: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{@srcDir}"</span> ) ) +223: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{@srcDir}"</span> ) +224: <span class="ruby-keyword kw">end</span> +225: +226: <span class="ruby-comment cmt"># TODO: implement pre section retrieve patches?</span> +227: <span class="ruby-comment cmt"># TODO: implement pre section apply patches?</span> +228: +229: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +230: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000031"></a><b>preinstall</b>( verbose=true ) + <a name="M000032"></a><b>preinstall</b>( verbose=true ) </div> <div class="description"> <p> Any actions needed before the installation can occur will happen here, such -as creating <a href="AbtPackage.html#M000026">new</a> user accounts, +as creating <a href="AbtPackage.html#M000027">new</a> user accounts, dealing with existing configuration files, etc. </p> <p> @@ -628,26 +633,26 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p> - <div id="M000031_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p> + <div id="M000032_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 298</span> -298: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">preinstall</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -299: <span class="ruby-comment cmt"># TODO: preinstall section create_group?</span> -300: <span class="ruby-comment cmt"># TODO: preinstall section create_user?</span> -301: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; -302: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 303</span> +303: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">preinstall</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +304: <span class="ruby-comment cmt"># TODO: preinstall section create_group?</span> +305: <span class="ruby-comment cmt"># TODO: preinstall section create_user?</span> +306: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; +307: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000034"></a><b>remove_build</b>() + <a name="M000035"></a><b>remove_build</b>() </div> <div class="description"> <p> -Cleans up this packages source <a href="AbtPackage.html#M000030">build</a> +Cleans up this packages source <a href="AbtPackage.html#M000031">build</a> directory. </p> <p> @@ -656,26 +661,26 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p> - <div id="M000034_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p> + <div id="M000035_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 356</span> -356: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_build</span> -357: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Removings build..."</span> -358: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">$REMOVE_BUILD_SOURCES</span> ) -359: <span class="ruby-identifier">buildSourcesLocation</span> = <span class="ruby-node">"#{$BUILD_LOCATION}/#{srcDir}"</span> -360: -361: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">buildSourcesLocation</span> ) ) -362: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -363: <span class="ruby-keyword kw">end</span> -364: -365: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span> <span class="ruby-identifier">buildSourcesLocation</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span> ) -366: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -367: <span class="ruby-keyword kw">end</span> -368: <span class="ruby-keyword kw">end</span> -369: -370: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -371: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 361</span> +361: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_build</span> +362: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"Removings build..."</span> +363: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">$REMOVE_BUILD_SOURCES</span> ) +364: <span class="ruby-identifier">buildSourcesLocation</span> = <span class="ruby-node">"#{$BUILD_LOCATION}/#{srcDir}"</span> +365: +366: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">buildSourcesLocation</span> ) ) +367: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +368: <span class="ruby-keyword kw">end</span> +369: +370: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span> <span class="ruby-identifier">buildSourcesLocation</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span> ) +371: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +372: <span class="ruby-keyword kw">end</span> +373: <span class="ruby-keyword kw">end</span> +374: +375: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +376: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -683,12 +688,12 @@ <div class="sectiontitle">Protected Instance methods</div> <div class="method"> <div class="title"> - <a name="M000025"></a><b>unpack_sources</b>() + <a name="M000026"></a><b>unpack_sources</b>() </div> <div class="description"> <p> Unpacks this packages source file into the standard <a -href="AbtPackage.html#M000030">build</a> location. +href="AbtPackage.html#M000031">build</a> location. </p> <p> <b>RETURNS:</b> <em>boolean</em> - True if the completes sucessfully, @@ -696,8 +701,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p> - <div id="M000025_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p> + <div id="M000026_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackage.rb, line 40</span> 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unpack_sources</span> Modified: src/trunk/doc/classes/AbtPackageManager.html =================================================================== --- src/trunk/doc/classes/AbtPackageManager.html 2007-07-19 19:23:35 UTC (rev 384) +++ src/trunk/doc/classes/AbtPackageManager.html 2007-07-19 19:26:52 UTC (rev 385) @@ -118,13 +118,13 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000046">downgrade_package</a></li> - <li><a href="#M000047">freeze_package</a></li> - <li><a href="#M000043">install_package</a></li> - <li><a href="#M000042">new</a></li> - <li><a href="#M000044">reinstall_package</a></li> - <li><a href="#M000045">remove_package</a></li> - <li><a href="#M000048">root_login</a></li> + <li><a href="#M000047">downgrade_package</a></li> + <li><a href="#M000048">freeze_package</a></li> + <li><a href="#M000044">install_package</a></li> + <li><a href="#M000043">new</a></li> + <li><a href="#M000045">reinstall_package</a></li> + <li><a href="#M000046">remove_package</a></li> + <li><a href="#M000049">root_login</a></li> </ul> @@ -135,7 +135,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000042"></a><b>new</b>() + <a name="M000043"></a><b>new</b>() </div> <div class="description"> <p> @@ -148,8 +148,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p> - <div id="M000042_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p> + <div id="M000043_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 83</span> 83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> @@ -161,7 +161,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000046"></a><b>downgrade_package</b>( package, version ) + <a name="M000047"></a><b>downgrade_package</b>( package, version ) </div> <div class="description"> <p> @@ -179,20 +179,20 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p> - <div id="M000046_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p> + <div id="M000047_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 292</span> -292: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) -293: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -294: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 301</span> +301: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) +302: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +303: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000047"></a><b>freeze_package</b>( package ) + <a name="M000048"></a><b>freeze_package</b>( package ) </div> <div class="description"> <p> @@ -208,20 +208,20 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p> - <div id="M000047_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p> + <div id="M000048_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 305</span> -305: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) -306: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -307: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 314</span> +314: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) +315: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +316: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000043"></a><b>install_package</b>( package, verbose=true ) + <a name="M000044"></a><b>install_package</b>( package, verbose=true ) </div> <div class="description"> <p> @@ -238,8 +238,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p> - <div id="M000043_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p> + <div id="M000044_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 96</span> 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) @@ -361,7 +361,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000044"></a><b>reinstall_package</b>( package ) + <a name="M000045"></a><b>reinstall_package</b>( package ) </div> <div class="description"> <p> @@ -376,8 +376,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p> - <div id="M000044_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p> + <div id="M000045_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 220</span> 220: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reinstall_package</span>( <span class="ruby-identifier">package</span> ) @@ -408,7 +408,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000045"></a><b>remove_package</b>( package ) + <a name="M000046"></a><b>remove_package</b>( package ) </div> <div class="description"> <p> @@ -423,8 +423,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p> - <div id="M000045_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p> + <div id="M000046_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 251</span> 251: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_package</span>( <span class="ruby-identifier">package</span> ) @@ -440,30 +440,39 @@ 261: <span class="ruby-comment cmt"># remove listings in install log.</span> 262: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) 263: -264: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -265: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) -266: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) -267: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed file #{line.chomp} from #{package} install log."</span>) -268: <span class="ruby-keyword kw">else</span> -269: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Unable to remove #{line.chomp} from #{package} install log, does not exist."</span>) -270: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -271: <span class="ruby-keyword kw">end</span> -272: <span class="ruby-keyword kw">end</span> -273: -274: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed files from #{File.basename( installLog )} for #{package}."</span> ) -275: -276: <span class="ruby-comment cmt"># remove entry in install listing.</span> -277: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> ) -278: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Removed entry from installed packages."</span> ) -279: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -280: <span class="ruby-keyword kw">end</span> +264: <span class="ruby-comment cmt"># only process install log if it exists, continue on with </span> +265: <span class="ruby-comment cmt"># journal log warning.</span> +266: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) +267: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +268: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) +269: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) +270: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed file #{line.chomp} from #{package} install log."</span>) +271: <span class="ruby-keyword kw">else</span> +272: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Unable to remove #{line.chomp} from #{package} install log, does not exist."</span>) +273: <span class="ruby-comment cmt"># do not return false, removed is ok, just put warning in journal log.</span> +274: <span class="ruby-keyword kw">end</span> +275: <span class="ruby-keyword kw">end</span> +276: +277: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed files from #{File.basename( installLog )} for #{package}."</span> ) +278: <span class="ruby-keyword kw">else</span> +279: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Install log missing for #{package}, see journal..."</span> +280: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Install log was missing for #{package}..."</span> ) +281: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"...continuing to remove package from install listing, but might have files still installed on system."</span> ) +282: <span class="ruby-keyword kw">end</span> +283: +284: +285: <span class="ruby-comment cmt"># remove entry in install listing.</span> +286: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> ) +287: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Removed entry from installed packages."</span> ) +288: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +289: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000048"></a><b>root_login</b>( arguments ) + <a name="M000049"></a><b>root_login</b>( arguments ) </div> <div class="description"> <p> @@ -477,23 +486,23 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p> - <div id="M000048_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p> + <div id="M000049_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 316</span> -316: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root_login</span>( <span class="ruby-identifier">arguments</span> ) -317: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">Process</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> ) -318: <span class="ruby-identifier">args</span> = <span class="ruby-value str">""</span> -319: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nEnter root password:"</span> -320: -321: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">length</span> -322: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-identifier">i</span>] -323: <span class="ruby-keyword kw">end</span> -324: -3... [truncated message content] |
From: <esc...@us...> - 2007-07-19 19:23:32
|
Revision: 384 http://svn.sourceforge.net/abtlinux/?rev=384&view=rev Author: eschabell Date: 2007-07-19 12:23:35 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Implemented source validation method in download manager using sha1 standard ruby library. This is a simple implementation, with absolute failure if hashes don't match for now. Modified Paths: -------------- src/trunk/abtconfig.rb src/trunk/abtdownloadmanager.rb src/trunk/abtpackage.rb src/trunk/testabtdownloadmanager.rb Modified: src/trunk/abtconfig.rb =================================================================== --- src/trunk/abtconfig.rb 2007-07-19 18:56:55 UTC (rev 383) +++ src/trunk/abtconfig.rb 2007-07-19 19:23:35 UTC (rev 384) @@ -38,6 +38,7 @@ require 'fileutils' require 'find' +require 'digest/sha1' # default paths / locations. $ABT_LOGS = "/var/log/abt" Modified: src/trunk/abtdownloadmanager.rb =================================================================== --- src/trunk/abtdownloadmanager.rb 2007-07-19 18:56:55 UTC (rev 383) +++ src/trunk/abtdownloadmanager.rb 2007-07-19 19:23:35 UTC (rev 384) @@ -159,4 +159,26 @@ def update_package_tree end + ## + # Validates the sources based on package hash value. + # + # <b>PARAM</b> <i>String</i> - security hash value from the packages description. + # <b>PARAM</b> <i>String</i> - source tarball location to be checked. + # + # <b>RETURNS:</b> <i>boolean</i> - True if the completes sucessfully, + # otherwise false. + ## + def validated( hashvalue, path ) + logger = AbtLogManager.new + + if hashvalue == Digest::SHA1.hexdigest( path ) + puts "Source hash validated successfully..." + logger.to_journal( "Validated sources successfully..." ) + return true + end + + puts "Source hash failed validation..." + logger.to_journal( "Validating sources failed..." ) + return false + end end Modified: src/trunk/abtpackage.rb =================================================================== --- src/trunk/abtpackage.rb 2007-07-19 18:56:55 UTC (rev 383) +++ src/trunk/abtpackage.rb 2007-07-19 19:23:35 UTC (rev 384) @@ -208,6 +208,11 @@ return false end + # validate sources sha1. + if ( !downloader.validated( @hashCheck, "#{$SOURCES_REPOSITORY}/#{File.basename( @srcUrl )}" ) ) + return false + end + # unpack sources. if ( !unpack_sources ) return false Modified: src/trunk/testabtdownloadmanager.rb =================================================================== --- src/trunk/testabtdownloadmanager.rb 2007-07-19 18:56:55 UTC (rev 383) +++ src/trunk/testabtdownloadmanager.rb 2007-07-19 19:23:35 UTC (rev 384) @@ -69,7 +69,7 @@ # Test method for 'AbtDownloadManager.test_update_package()' ## def test_update_package() - assert( @download.update_package(), "test_update_package()" ) + assert( @download.update_package() , "test_update_package()" ) end ## @@ -78,4 +78,11 @@ def test_update_package_tree() assert( @download.update_package_tree(), "test_update_package_tree()" ) end + + ## + # Test method for 'AbtDownloadManager.test_validated()' + ## + def test_validated() + assert( @download.validated( 'e81278607b1d65dcb18c3613ec00fbf588b50319', "#{$SOURCES_REPOSITORY}/ipc-1.4.tar.gz" ), "test_validated" ) + end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-19 18:56:53
|
Revision: 383 http://svn.sourceforge.net/abtlinux/?rev=383&view=rev Author: eschabell Date: 2007-07-19 11:56:55 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Fixed problem stopping removal of package. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-19 18:31:29 UTC (rev 382) +++ src/trunk/abtpackagemanager.rb 2007-07-19 18:56:55 UTC (rev 383) @@ -261,17 +261,26 @@ # remove listings in install log. installLog = logger.get_log( package, 'install' ) - IO.foreach( installLog ) do |line| - if File.exist?( line.chomp ) - FileUtils.rm( line.chomp ) - logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") - else - logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") - return false + # only process install log if it exists, continue on with + # journal log warning. + if File.exist?( installLog ) + IO.foreach( installLog ) do |line| + if File.exist?( line.chomp ) + FileUtils.rm( line.chomp ) + logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") + else + logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") + # do not return false, removed is ok, just put warning in journal log. + end end + + logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) + else + puts "Install log missing for #{package}, see journal..." + logger.to_journal( "Install log was missing for #{package}..." ) + logger.to_journal( "...continuing to remove package from install listing, but might have files still installed on system." ) end - logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) # remove entry in install listing. FileUtils.remove_dir( "#{$PACKAGE_INSTALLED}/#{details['Source location']}" ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-19 18:31:28
|
Revision: 382 http://svn.sourceforge.net/abtlinux/?rev=382&view=rev Author: eschabell Date: 2007-07-19 11:31:29 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Some coding standard adjustments (single quotes) and added ruby std lib digest/sha1 generated hash to be used in all packages. For some reason the function used to generate this hash is not the same as the command line 'sha1sum' tool generates... so be it, by using the ruby generated hash we avoid system calls. Modified Paths: -------------- src/trunk/packages/ipc.rb Modified: src/trunk/packages/ipc.rb =================================================================== --- src/trunk/packages/ipc.rb 2007-07-18 14:54:29 UTC (rev 381) +++ src/trunk/packages/ipc.rb 2007-07-19 18:31:29 UTC (rev 382) @@ -1,6 +1,6 @@ #!/usr/bin/ruby -w -require "abtpackage" +require 'abtpackage' ## # ipc.rb @@ -33,26 +33,27 @@ private - $name = "Ipc" + $name = "Ipc" $version = "1.4" - $srcDir = "#{$name.downcase}-#{$version}" + $srcDir = "#{$name.downcase}-#{$version}" + $srcFile = "#{$srcDir}.tar.gz" $packageData = { - 'name' => $name, - 'execName' => $name.downcase, - 'version' => $version, - 'srcDir' => $srcDir, - 'homepage' => "http://isotopatcalc.sourceforge.net/", - 'srcUrl' => "#{$SOURCEFORGE_URL}/isotopatcalc/#{$srcDir}.tar.gz", - 'dependsOn' => "", - 'reliesOn' => "", - 'optionalDO' => "", - 'optionalRO' => "", - 'hashCheck' => "sha512:d759b651e343beddc0b3bd06af85881486b72319c979a2e7f752d5a34edd8b7c1c19391c5c7a2e8f6685746cc7a046bf2c8e082b31458a1dd043ed90a4cebcd1", - 'patches' => "", + 'name' => $name, + 'execName' => $name.downcase, + 'version' => $version, + 'srcDir' => $srcDir, + 'homepage' => "http://isotopatcalc.sourceforge.net/", + 'srcUrl' => "#{$SOURCEFORGE_URL}/isotopatcalc/#{$srcFile}", + 'dependsOn' => "", + 'reliesOn' => "", + 'optionalDO' => "", + 'optionalRO' => "", + 'hashCheck' => "e81278607b1d65dcb18c3613ec00fbf588b50319", + 'patches' => "", 'patchesHashCheck' => "", - 'mirrorPath' => "", - 'license' => "GPL", - 'description' => "IPC is a program that calculates the isotopic distribution of a given chemical formula." + 'mirrorPath' => "", + 'license' => "GPL", + 'description' => "IPC is a program that calculates the isotopic distribution of a given chemical formula." } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-18 14:54:27
|
Revision: 381 http://svn.sourceforge.net/abtlinux/?rev=381&view=rev Author: eschabell Date: 2007-07-18 07:54:29 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Regenerated docs. Modified Paths: -------------- src/trunk/doc/classes/AbtPackageManager.html src/trunk/doc/created.rid src/trunk/doc/files/abtpackagemanager_rb.html Modified: src/trunk/doc/classes/AbtPackageManager.html =================================================================== --- src/trunk/doc/classes/AbtPackageManager.html 2007-07-18 14:52:59 UTC (rev 380) +++ src/trunk/doc/classes/AbtPackageManager.html 2007-07-18 14:54:29 UTC (rev 381) @@ -182,10 +182,10 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p> <div id="M000046_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 273</span> -273: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) -274: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -275: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 292</span> +292: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) +293: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +294: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -211,10 +211,10 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p> <div id="M000047_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 286</span> -286: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) -287: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -288: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 305</span> +305: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) +306: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +307: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -381,8 +381,27 @@ <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 220</span> 220: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reinstall_package</span>( <span class="ruby-identifier">package</span> ) -221: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -222: <span class="ruby-keyword kw">end</span> +221: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> +222: +223: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">install_package</span>( <span class="ruby-identifier">package</span> ) ) +224: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n\n"</span> +225: <span class="ruby-identifier">puts</span> <span class="ruby-node">"*** Completed reinstall of #{package}. ***"</span> +226: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n\n"</span> +227: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Completed reinstall of #{package}."</span> ) +228: +229: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">cache_package</span>( <span class="ruby-identifier">package</span> ) ) +230: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n\n"</span> +231: <span class="ruby-identifier">puts</span> <span class="ruby-node">"*** Completed caching of package #{package}. ***"</span> +232: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n\n"</span> +233: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Caching completed for package #{package}."</span> ) +234: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +235: <span class="ruby-keyword kw">else</span> +236: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Caching of package #{package} failed."</span>) +237: <span class="ruby-keyword kw">end</span> +238: <span class="ruby-keyword kw">end</span> +239: +240: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +241: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -407,37 +426,37 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p> <div id="M000045_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 232</span> -232: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_package</span>( <span class="ruby-identifier">package</span> ) -233: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{$PACKAGE_PATH}#{package}"</span> -234: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) -235: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> -236: -237: <span class="ruby-comment cmt"># get package details.</span> -238: <span class="ruby-identifier">details</span> = <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">details</span> -239: -240: <span class="ruby-comment cmt"># TODO: something with possible /etc or other configure files before removal, check maybe integrity for changes since install?</span> -241: -242: <span class="ruby-comment cmt"># remove listings in install log.</span> -243: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -244: -245: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -246: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) -247: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) -248: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed file #{line.chomp} from #{package} install log."</span>) -249: <span class="ruby-keyword kw">else</span> -250: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Unable to remove #{line.chomp} from #{package} install log, does not exist."</span>) -251: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -252: <span class="ruby-keyword kw">end</span> -253: <span class="ruby-keyword kw">end</span> -254: -255: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed files from #{File.basename( installLog )} for #{package}."</span> ) -256: -257: <span class="ruby-comment cmt"># remove entry in install listing.</span> -258: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> ) -259: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Removed entry from installed packages."</span> ) -260: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -261: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 251</span> +251: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_package</span>( <span class="ruby-identifier">package</span> ) +252: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{$PACKAGE_PATH}#{package}"</span> +253: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) +254: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> +255: +256: <span class="ruby-comment cmt"># get package details.</span> +257: <span class="ruby-identifier">details</span> = <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">details</span> +258: +259: <span class="ruby-comment cmt"># TODO: something with possible /etc or other configure files before removal, check maybe integrity for changes since install?</span> +260: +261: <span class="ruby-comment cmt"># remove listings in install log.</span> +262: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +263: +264: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +265: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) +266: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) +267: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed file #{line.chomp} from #{package} install log."</span>) +268: <span class="ruby-keyword kw">else</span> +269: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Unable to remove #{line.chomp} from #{package} install log, does not exist."</span>) +270: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +271: <span class="ruby-keyword kw">end</span> +272: <span class="ruby-keyword kw">end</span> +273: +274: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Removed files from #{File.basename( installLog )} for #{package}."</span> ) +275: +276: <span class="ruby-comment cmt"># remove entry in install listing.</span> +277: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_dir</span>( <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> ) +278: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-value str">"Removed entry from installed packages."</span> ) +279: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +280: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -461,20 +480,20 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p> <div id="M000048_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 297</span> -297: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root_login</span>( <span class="ruby-identifier">arguments</span> ) -298: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">Process</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> ) -299: <span class="ruby-identifier">args</span> = <span class="ruby-value str">""</span> -300: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nEnter root password:"</span> -301: -302: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">length</span> -303: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-identifier">i</span>] -304: <span class="ruby-keyword kw">end</span> -305: -306: <span class="ruby-identifier">system</span>( <span class="ruby-value str">'su -c "./abt '</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'" root'</span> ) -307: <span class="ruby-identifier">exit</span> -308: <span class="ruby-keyword kw">end</span> -309: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 316</span> +316: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root_login</span>( <span class="ruby-identifier">arguments</span> ) +317: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">Process</span>.<span class="ruby-identifier">uid</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> ) +318: <span class="ruby-identifier">args</span> = <span class="ruby-value str">""</span> +319: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nEnter root password:"</span> +320: +321: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">length</span> +322: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-identifier">i</span>] +323: <span class="ruby-keyword kw">end</span> +324: +325: <span class="ruby-identifier">system</span>( <span class="ruby-value str">'su -c "./abt '</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'" root'</span> ) +326: <span class="ruby-identifier">exit</span> +327: <span class="ruby-keyword kw">end</span> +328: <span class="ruby-keyword kw">end</span> </pre> </div> </div> Modified: src/trunk/doc/created.rid =================================================================== --- src/trunk/doc/created.rid 2007-07-18 14:52:59 UTC (rev 380) +++ src/trunk/doc/created.rid 2007-07-18 14:54:29 UTC (rev 381) @@ -1 +1 @@ -Tue Jul 17 23:27:24 +0200 2007 +Wed Jul 18 16:50:02 +0200 2007 Modified: src/trunk/doc/files/abtpackagemanager_rb.html =================================================================== --- src/trunk/doc/files/abtpackagemanager_rb.html 2007-07-18 14:52:59 UTC (rev 380) +++ src/trunk/doc/files/abtpackagemanager_rb.html 2007-07-18 14:54:29 UTC (rev 381) @@ -63,7 +63,7 @@ </tr> <tr> <td>Modified:</td> - <td>Tue Jul 17 23:27:18 +0200 2007</td> + <td>Wed Jul 18 16:49:56 +0200 2007</td> </tr> </table> </td></tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-18 14:52:57
|
Revision: 380 http://svn.sourceforge.net/abtlinux/?rev=380&view=rev Author: eschabell Date: 2007-07-18 07:52:59 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Implemented reinstall package, completes another unit test, 25 to go! Modified Paths: -------------- src/trunk/abt.rb src/trunk/abtpackagemanager.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-17 21:32:45 UTC (rev 379) +++ src/trunk/abt.rb 2007-07-18 14:52:59 UTC (rev 380) @@ -77,8 +77,7 @@ logger.to_journal( "Caching of package #{options['package']} failed.") end else - puts "*** #{options['package'].capitalize} install failed, " + - "see journal. ***" + puts "*** #{options['package'].capitalize} install failed, see journal. ***" end else show.usage( "packages" ) @@ -86,9 +85,42 @@ end when "reinstall", "-ri" - if ( ARGV.length == 2 ) + if ( ARGV.length == 2 && File.exist?( "#{$PACKAGE_PATH}#{ARGV[1]}.rb" ) ) options['package'] = ARGV[1] - puts "Reinstalling package : " + options['package'] + logger.to_journal( "Starting to reinstall #{options['package']}" ) + + # check if already installed. + if ( system.package_installed( options['package'] ) ) + puts "\n*** Package #{options['package']} is already installed! ***\n" + puts "Are you sure you want to proceed with a reinstall? (y/n)" + + while answer = STDIN.gets + answer.chomp! + if answer == "y" + break + elsif answer == "n" + exit + else + puts "Are you sure you want to reinstall #{options['package']}? (y/n)" + end + end + else + puts "\n*** Package #{options['package']} is not installed, we will install it for you now! ***\n" + puts "Hit enter to continue..." + while continue = STDIN.gets + continue.chomp! + break + end + end + + if ( manager.reinstall_package( options['package'] ) ) + puts "\n\n" + puts "*** Completed reinstall of #{options['package']}. ***" + puts "\n\n" + logger.to_journal( "Completed reinstall of #{options['package']}." ) + else + puts "*** #{options['package'].capitalize} reinstall failed, see journal. ***" + end else show.usage( "packages" ) exit Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 21:32:45 UTC (rev 379) +++ src/trunk/abtpackagemanager.rb 2007-07-18 14:52:59 UTC (rev 380) @@ -218,6 +218,25 @@ # otherwise false. ## def reinstall_package( package ) + logger = AbtLogManager.new + + if ( install_package( package ) ) + puts "\n\n" + puts "*** Completed reinstall of #{package}. ***" + puts "\n\n" + logger.to_journal( "Completed reinstall of #{package}." ) + + if ( logger.cache_package( package ) ) + puts "\n\n" + puts "*** Completed caching of package #{package}. ***" + puts "\n\n" + logger.to_journal( "Caching completed for package #{package}." ) + return true + else + logger.to_journal( "Caching of package #{package} failed.") + end + end + return false end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 21:32:43
|
Revision: 379 http://svn.sourceforge.net/abtlinux/?rev=379&view=rev Author: eschabell Date: 2007-07-17 14:32:45 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Regenerated docs. Modified Paths: -------------- src/trunk/doc/classes/AbtDepEngine.html src/trunk/doc/classes/AbtDownloadManager.html src/trunk/doc/classes/AbtLogManager.html src/trunk/doc/classes/AbtPackage.html src/trunk/doc/classes/AbtPackageManager.html src/trunk/doc/classes/AbtQueueManager.html src/trunk/doc/classes/AbtReportManager.html src/trunk/doc/classes/AbtSystemManager.html src/trunk/doc/classes/AbtUsage.html src/trunk/doc/classes/TestAbtDepEngine.html src/trunk/doc/classes/TestAbtDownloadManager.html src/trunk/doc/classes/TestAbtLogManager.html src/trunk/doc/classes/TestAbtPackage.html src/trunk/doc/classes/TestAbtPackageManager.html src/trunk/doc/classes/TestAbtQueueManager.html src/trunk/doc/classes/TestAbtReportManager.html src/trunk/doc/classes/TestAbtSystemManager.html src/trunk/doc/created.rid src/trunk/doc/dot/f_0.png src/trunk/doc/dot/f_1.png src/trunk/doc/dot/f_10.png src/trunk/doc/dot/f_11.png src/trunk/doc/dot/f_12.png src/trunk/doc/dot/f_13.png src/trunk/doc/dot/f_14.png src/trunk/doc/dot/f_15.png src/trunk/doc/dot/f_16.png src/trunk/doc/dot/f_2.png src/trunk/doc/dot/f_3.png src/trunk/doc/dot/f_4.png src/trunk/doc/dot/f_5.png src/trunk/doc/dot/f_6.png src/trunk/doc/dot/f_7.png src/trunk/doc/dot/f_8.png src/trunk/doc/dot/f_9.png src/trunk/doc/files/abtdepengine_rb.html src/trunk/doc/files/abtdownloadmanager_rb.html src/trunk/doc/files/abtlogmanager_rb.html src/trunk/doc/files/abtpackage_rb.html src/trunk/doc/files/abtpackagemanager_rb.html src/trunk/doc/files/abtqueuemanager_rb.html src/trunk/doc/files/abtreportmanager_rb.html src/trunk/doc/files/abtsystemmanager_rb.html src/trunk/doc/files/abtusage_rb.html src/trunk/doc/files/testabtdepengine_rb.html src/trunk/doc/files/testabtdownloadmanager_rb.html src/trunk/doc/files/testabtlogmanager_rb.html src/trunk/doc/files/testabtpackage_rb.html src/trunk/doc/files/testabtpackagemanager_rb.html src/trunk/doc/files/testabtqueuemanager_rb.html src/trunk/doc/files/testabtreportmanager_rb.html src/trunk/doc/files/testabtsystemmanager_rb.html src/trunk/doc/fr_method_index.html Modified: src/trunk/doc/classes/AbtDepEngine.html =================================================================== --- src/trunk/doc/classes/AbtDepEngine.html 2007-07-17 21:21:37 UTC (rev 378) +++ src/trunk/doc/classes/AbtDepEngine.html 2007-07-17 21:32:45 UTC (rev 379) @@ -76,7 +76,7 @@ <div id="content"> <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> <map id="map" name="map"> - <area shape="rect" coords="27,50,133,98" href="AbtDepEngine.html" alt="AbtDepEngine" /> + <area shape="rect" coords="27,50,125,98" href="AbtDepEngine.html" alt="AbtDepEngine" /> </map> <img src="../dot/f_0.png" usemap="#map" border="0" alt="dot/f_0.png"> </td></tr></table> @@ -118,7 +118,7 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000093">new</a></li> + <li><a href="#M000094">new</a></li> </ul> @@ -129,7 +129,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000093"></a><b>new</b>() + <a name="M000094"></a><b>new</b>() </div> <div class="description"> <p> @@ -141,8 +141,8 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show source</a> ]</p> - <div id="M000093_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000094_source')" id="l_M000094_source">show source</a> ]</p> + <div id="M000094_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdepengine.rb, line 41</span> 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> Modified: src/trunk/doc/classes/AbtDownloadManager.html =================================================================== --- src/trunk/doc/classes/AbtDownloadManager.html 2007-07-17 21:21:37 UTC (rev 378) +++ src/trunk/doc/classes/AbtDownloadManager.html 2007-07-17 21:32:45 UTC (rev 379) @@ -76,7 +76,7 @@ <div id="content"> <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> <map id="map" name="map"> - <area shape="rect" coords="27,50,176,98" href="AbtDownloadManager.html" alt="AbtDownloadManager" /> + <area shape="rect" coords="27,50,160,98" href="AbtDownloadManager.html" alt="AbtDownloadManager" /> </map> <img src="../dot/f_1.png" usemap="#map" border="0" alt="dot/f_1.png"> </td></tr></table> Modified: src/trunk/doc/classes/AbtLogManager.html =================================================================== --- src/trunk/doc/classes/AbtLogManager.html 2007-07-17 21:21:37 UTC (rev 378) +++ src/trunk/doc/classes/AbtLogManager.html 2007-07-17 21:32:45 UTC (rev 379) @@ -76,7 +76,7 @@ <div id="content"> <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> <map id="map" name="map"> - <area shape="rect" coords="27,50,141,98" href="AbtLogManager.html" alt="AbtLogManager" /> + <area shape="rect" coords="27,50,131,98" href="AbtLogManager.html" alt="AbtLogManager" /> </map> <img src="../dot/f_2.png" usemap="#map" border="0" alt="dot/f_2.png"> </td></tr></table> @@ -117,12 +117,13 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000067">cache_package</a></li> - <li><a href="#M000066">log_package_build</a></li> - <li><a href="#M000065">log_package_install</a></li> - <li><a href="#M000064">log_package_integrity</a></li> - <li><a href="#M000063">new</a></li> - <li><a href="#M000068">to_journal</a></li> + <li><a href="#M000068">cache_package</a></li> + <li><a href="#M000063">get_log</a></li> + <li><a href="#M000067">log_package_build</a></li> + <li><a href="#M000066">log_package_install</a></li> + <li><a href="#M000065">log_package_integrity</a></li> + <li><a href="#M000064">new</a></li> + <li><a href="#M000069">to_journal</a></li> </ul> @@ -133,7 +134,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000063"></a><b>new</b>() + <a name="M000064"></a><b>new</b>() </div> <div class="description"> <p> @@ -146,20 +147,20 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p> - <div id="M000063_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> + <div id="M000064_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 81</span> -81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> -82: [<span class="ruby-identifier">$ABT_LOGS</span>, <span class="ruby-identifier">$ABT_CACHES</span>, <span class="ruby-identifier">$ABT_STATE</span>, <span class="ruby-identifier">$BUILD_LOCATION</span>, <span class="ruby-identifier">$PACKAGE_INSTALLED</span>, -83: <span class="ruby-identifier">$PACKAGE_CACHED</span>, <span class="ruby-identifier">$ABT_TMP</span>, <span class="ruby-identifier">$SOURCES_REPOSITORY</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> -84: -85: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">dir</span> ) ) -86: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">dir</span> ) -87: <span class="ruby-identifier">to_journal</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Created directory: #{dir}."</span> -88: <span class="ruby-keyword kw">end</span> -89: } -90: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 80</span> +80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> +81: [<span class="ruby-identifier">$ABT_LOGS</span>, <span class="ruby-identifier">$ABT_CACHES</span>, <span class="ruby-identifier">$ABT_STATE</span>, <span class="ruby-identifier">$BUILD_LOCATION</span>, <span class="ruby-identifier">$PACKAGE_INSTALLED</span>, +82: <span class="ruby-identifier">$PACKAGE_CACHED</span>, <span class="ruby-identifier">$ABT_TMP</span>, <span class="ruby-identifier">$SOURCES_REPOSITORY</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> +83: +84: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">dir</span> ) ) +85: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">dir</span> ) +86: <span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Created directory: #{dir}."</span> ) +87: <span class="ruby-keyword kw">end</span> +88: } +89: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -167,7 +168,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000067"></a><b>cache_package</b>( package ) + <a name="M000068"></a><b>cache_package</b>( package ) </div> <div class="description"> <p> @@ -183,97 +184,150 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> - <div id="M000067_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> + <div id="M000068_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 209</span> -209: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_package</span>( <span class="ruby-identifier">package</span> ) -210: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> -211: -212: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">package_installed</span>( <span class="ruby-identifier">package</span> ) ) -213: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) -214: <span class="ruby-identifier">cachedDir</span> = <span class="ruby-identifier">$PACKAGE_CACHED</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcDir</span> -215: <span class="ruby-identifier">sourcePath</span> = <span class="ruby-identifier">$SOURCES_REPOSITORY</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) -216: <span class="ruby-identifier">sourceFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) -217: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -218: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -219: <span class="ruby-identifier">configureLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -220: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -221: <span class="ruby-identifier">packageFile</span> = <span class="ruby-node">"#{$PACKAGE_PATH}#{package}.rb"</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 208</span> +208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_package</span>( <span class="ruby-identifier">package</span> ) +209: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> +210: +211: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">package_installed</span>( <span class="ruby-identifier">package</span> ) ) +212: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) +213: <span class="ruby-identifier">cachedDir</span> = <span class="ruby-identifier">$PACKAGE_CACHED</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcDir</span> +214: <span class="ruby-identifier">sourcePath</span> = <span class="ruby-identifier">$SOURCES_REPOSITORY</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +215: <span class="ruby-identifier">sourceFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +216: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +217: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) +218: <span class="ruby-identifier">configureLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'configure'</span> ) +219: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'integrity'</span> ) +220: <span class="ruby-identifier">packageFile</span> = <span class="ruby-node">"#{$PACKAGE_PATH}#{package}.rb"</span> +221: 222: -223: -224: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">cachedDir</span> ) -225: -226: <span class="ruby-comment cmt"># collect package source.</span> -227: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">sourcePath</span> ) ) -228: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">sourcePath</span>, <span class="ruby-node">"#{cachedDir}/#{sourceFile}"</span> ) -229: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} source."</span> -230: <span class="ruby-keyword kw">else</span> -231: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} source."</span> -232: <span class="ruby-keyword kw">end</span> -233: -234: <span class="ruby-comment cmt"># collect package install log. </span> -235: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) -236: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.install"</span> ) -237: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} install log."</span> -238: <span class="ruby-keyword kw">else</span> -239: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} install log."</span> -240: <span class="ruby-keyword kw">end</span> -241: -242: <span class="ruby-comment cmt"># collect package build log. </span> -243: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) -244: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">buildLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.build"</span> ) -245: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} build log."</span> -246: <span class="ruby-keyword kw">else</span> -247: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} build log."</span> -248: <span class="ruby-keyword kw">end</span> -249: -250: <span class="ruby-comment cmt"># collect package configure log. </span> -251: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">configureLog</span> ) ) -252: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">configureLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.configure"</span> ) -253: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} configure log."</span> -254: <span class="ruby-keyword kw">else</span> -255: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} configure log."</span> -256: <span class="ruby-keyword kw">end</span> -257: -258: <span class="ruby-comment cmt"># collect package integrity log.</span> -259: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">integrityLog</span> ) ) -260: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.integrity"</span> ) -261: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} integrity log."</span> -262: <span class="ruby-keyword kw">else</span> -263: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} integrity log."</span> -264: <span class="ruby-keyword kw">end</span> -265: -266: <span class="ruby-comment cmt"># collect package description (class file).</span> -267: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">packageFile</span> ) ) -268: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">packageFile</span>, <span class="ruby-node">"#{cachedDir}/#{package}.rb"</span> ) -269: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} package description."</span> -270: <span class="ruby-keyword kw">else</span> -271: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} package description, from location #{packageFile}"</span> -272: <span class="ruby-keyword kw">end</span> -273: -274: <span class="ruby-comment cmt"># tar and bzip this directory (package-cache-version.tar.bz2) </span> -275: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">$PACKAGE_CACHED</span> ) -276: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"tar -cf #{sw.srcDir}.tar #{sw.srcDir}"</span> ) <span class="ruby-operator">&&</span> -277: <span class="ruby-identifier">system</span>( <span class="ruby-node">"bzip2 -f #{sw.srcDir}.tar"</span> ) ) -278: <span class="ruby-comment cmt"># last but not least, remove our tarball directory</span> -279: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>( <span class="ruby-identifier">cachedDir</span> ) -280: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -281: <span class="ruby-keyword kw">end</span> -282: <span class="ruby-keyword kw">end</span> -283: -284: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># package not installed, can't cache it.</span> -285: <span class="ruby-keyword kw">end</span> +223: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">cachedDir</span> ) +224: +225: <span class="ruby-comment cmt"># collect package source.</span> +226: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">sourcePath</span> ) ) +227: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">sourcePath</span>, <span class="ruby-node">"#{cachedDir}/#{sourceFile}"</span> ) +228: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} source."</span> +229: <span class="ruby-keyword kw">else</span> +230: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} source."</span> +231: <span class="ruby-keyword kw">end</span> +232: +233: <span class="ruby-comment cmt"># collect package install log. </span> +234: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) +235: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.install"</span> ) +236: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} install log."</span> +237: <span class="ruby-keyword kw">else</span> +238: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} install log."</span> +239: <span class="ruby-keyword kw">end</span> +240: +241: <span class="ruby-comment cmt"># collect package build log. </span> +242: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +243: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">buildLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.build"</span> ) +244: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} build log."</span> +245: <span class="ruby-keyword kw">else</span> +246: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} build log."</span> +247: <span class="ruby-keyword kw">end</span> +248: +249: <span class="ruby-comment cmt"># collect package configure log. </span> +250: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">configureLog</span> ) ) +251: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">configureLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.configure"</span> ) +252: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} configure log."</span> +253: <span class="ruby-keyword kw">else</span> +254: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} configure log."</span> +255: <span class="ruby-keyword kw">end</span> +256: +257: <span class="ruby-comment cmt"># collect package integrity log.</span> +258: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">integrityLog</span> ) ) +259: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.integrity"</span> ) +260: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} integrity log."</span> +261: <span class="ruby-keyword kw">else</span> +262: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} integrity log."</span> +263: <span class="ruby-keyword kw">end</span> +264: +265: <span class="ruby-comment cmt"># collect package description (class file).</span> +266: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">packageFile</span> ) ) +267: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">packageFile</span>, <span class="ruby-node">"#{cachedDir}/#{package}.rb"</span> ) +268: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} package description."</span> +269: <span class="ruby-keyword kw">else</span> +270: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} package description, from location #{packageFile}"</span> +271: <span class="ruby-keyword kw">end</span> +272: +273: <span class="ruby-comment cmt"># tar and bzip this directory (package-cache-version.tar.bz2) </span> +274: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">$PACKAGE_CACHED</span> ) +275: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"tar -cf #{sw.srcDir}.tar #{sw.srcDir}"</span> ) <span class="ruby-operator">&&</span> +276: <span class="ruby-identifier">system</span>( <span class="ruby-node">"bzip2 -f #{sw.srcDir}.tar"</span> ) ) +277: <span class="ruby-comment cmt"># last but not least, remove our tarball directory</span> +278: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>( <span class="ruby-identifier">cachedDir</span> ) +279: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +280: <span class="ruby-keyword kw">end</span> +281: <span class="ruby-keyword kw">end</span> +282: +283: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># package not installed, can't cache it.</span> +284: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>log_package_build</b>( package ) + <a name="M000063"></a><b>get_log</b>( package, type ) </div> <div class="description"> <p> +Returns the path to given packages install log. +</p> +<p> +<b>PARAM</b> <em>String</em> - Package name. +</p> +<p> +<b>RETURN</b> <em>String</em> - Full path to install log. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p> + <div id="M000063_source" class="dyn-source"> +<pre> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 43</span> +43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">type</span> ) +44: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{$PACKAGE_PATH}#{package}"</span> +45: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) +46: <span class="ruby-identifier">details</span> = <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">details</span> +47: +48: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span> +49: +50: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'install'</span> +51: <span class="ruby-identifier">log</span> = <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> <span class="ruby-operator">+</span> +52: <span class="ruby-node">"/#{details['Source location']}.install"</span> +53: +54: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'integrity'</span> +55: <span class="ruby-identifier">log</span> = <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> <span class="ruby-operator">+</span> +56: <span class="ruby-node">"/#{details['Source location']}.integrity"</span> +57: +58: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'tmpinstall'</span> +59: <span class="ruby-identifier">log</span> = <span class="ruby-node">"#{$ABT_TMP}/#{details['Source location']}.watch"</span> +60: +61: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'build'</span> +62: <span class="ruby-identifier">log</span> = <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> <span class="ruby-operator">+</span> +63: <span class="ruby-node">"/#{details['Source location']}.build"</span> +64: +65: <span class="ruby-keyword kw">else</span> +66: <span class="ruby-identifier">log</span> = <span class="ruby-value str">""</span> +67: +68: <span class="ruby-keyword kw">end</span> +69: +70: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">log</span> +71: <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000067"></a><b>log_package_build</b>( package ) + </div> + <div class="description"> + <p> Provides logging of all output produced during the build phase of the given package. Should be called as part of the install phase of the build. </p> @@ -286,27 +340,27 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> - <div id="M000066_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> + <div id="M000067_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 189</span> -189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_build</span>( <span class="ruby-identifier">package</span> ) -190: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) -191: -192: <span class="ruby-comment cmt"># make sure the build file exists.</span> -193: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) -194: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -195: <span class="ruby-keyword kw">end</span> -196: -197: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -198: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 188</span> +188: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_build</span>( <span class="ruby-identifier">package</span> ) +189: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) +190: +191: <span class="ruby-comment cmt"># make sure the build file exists.</span> +192: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +193: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +194: <span class="ruby-keyword kw">end</span> +195: +196: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +197: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>log_package_install</b>( package ) + <a name="M000066"></a><b>log_package_install</b>( package ) </div> <div class="description"> <p> @@ -322,54 +376,54 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> - <div id="M000065_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> + <div id="M000066_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 142</span> -142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_install</span>( <span class="ruby-identifier">package</span> ) -143: <span class="ruby-comment cmt"># some dirs we will not add to an install log.</span> -144: <span class="ruby-identifier">excluded_pattern</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) -145: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> -146: -147: <span class="ruby-comment cmt"># our log locations.</span> -148: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -149: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'tmpinstall'</span> ) -150: -151: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> -152: <span class="ruby-comment cmt"># into our install log.</span> -153: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) -154: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) -155: -156: <span class="ruby-comment cmt"># include only the file names from open calls</span> -157: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> -158: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -159: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) -160: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) -161: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> -162: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> -163: <span class="ruby-keyword kw">else</span> -164: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> -165: <span class="ruby-keyword kw">end</span> -166: -167: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) -168: <span class="ruby-comment cmt">#self.to_journal( "DEBUG: adding line to installFile!")</span> -169: <span class="ruby-identifier">installFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.split[2]}\n"</span> -170: <span class="ruby-keyword kw">end</span> -171: <span class="ruby-keyword kw">end</span> -172: <span class="ruby-keyword kw">end</span> -173: -174: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> -175: <span class="ruby-keyword kw">end</span> -176: -177: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; -178: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 141</span> +141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_install</span>( <span class="ruby-identifier">package</span> ) +142: <span class="ruby-comment cmt"># some dirs we will not add to an install log.</span> +143: <span class="ruby-identifier">excluded_pattern</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) +144: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> +145: +146: <span class="ruby-comment cmt"># our log locations.</span> +147: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +148: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'tmpinstall'</span> ) +149: +150: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> +151: <span class="ruby-comment cmt"># into our install log.</span> +152: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) +153: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) +154: +155: <span class="ruby-comment cmt"># include only the file names from open calls</span> +156: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> +157: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +158: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) +159: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) +160: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> +161: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> +162: <span class="ruby-keyword kw">else</span> +163: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> +164: <span class="ruby-keyword kw">end</span> +165: +166: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) +167: <span class="ruby-comment cmt">#self.to_journal( "DEBUG: adding line to installFile!")</span> +168: <span class="ruby-identifier">installFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.split[2]}\n"</span> +169: <span class="ruby-keyword kw">end</span> +170: <span class="ruby-keyword kw">end</span> +171: <span class="ruby-keyword kw">end</span> +172: +173: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> +174: <span class="ruby-keyword kw">end</span> +175: +176: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; +177: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>log_package_integrity</b>( package ) + <a name="M000065"></a><b>log_package_integrity</b>( package ) </div> <div class="description"> <p> @@ -386,47 +440,47 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> - <div id="M000064_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> + <div id="M000065_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 102</span> -102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_integrity</span>( <span class="ruby-identifier">package</span> ) -103: <span class="ruby-comment cmt">#require "#{$PACKAGE_PATH}#{package}"</span> -104: <span class="ruby-comment cmt">#sw = eval( "#{package.capitalize}.new" )</span> -105: <span class="ruby-comment cmt">#details = sw.details</span> -106: -107: <span class="ruby-comment cmt"># our log locations.</span> -108: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -109: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'integrity'</span> ) -110: -111: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> -112: <span class="ruby-comment cmt"># into our install log.</span> -113: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) -114: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'r'</span> ) -115: <span class="ruby-identifier">integrityFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-value str">'w'</span> ) -116: -117: <span class="ruby-comment cmt"># get the integrity for each file, initially just permissions. </span> -118: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -119: <span class="ruby-identifier">status</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) -120: <span class="ruby-identifier">octal</span> = <span class="ruby-identifier">sprintf</span>( <span class="ruby-value str">"%o"</span>, <span class="ruby-identifier">status</span>.<span class="ruby-identifier">mode</span> ) -121: <span class="ruby-identifier">integrityFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.chomp}:#{octal}\n"</span> -122: <span class="ruby-keyword kw">end</span> -123: -124: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> -125: <span class="ruby-identifier">integrityFile</span>.<span class="ruby-identifier">close</span> -126: <span class="ruby-keyword kw">else</span> -127: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># no install log!</span> -128: <span class="ruby-keyword kw">end</span> -129: -130: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; -131: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 101</span> +101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_integrity</span>( <span class="ruby-identifier">package</span> ) +102: <span class="ruby-comment cmt">#require "#{$PACKAGE_PATH}#{package}"</span> +103: <span class="ruby-comment cmt">#sw = eval( "#{package.capitalize}.new" )</span> +104: <span class="ruby-comment cmt">#details = sw.details</span> +105: +106: <span class="ruby-comment cmt"># our log locations.</span> +107: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +108: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'integrity'</span> ) +109: +110: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> +111: <span class="ruby-comment cmt"># into our install log.</span> +112: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) +113: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'r'</span> ) +114: <span class="ruby-identifier">integrityFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-value str">'w'</span> ) +115: +116: <span class="ruby-comment cmt"># get the integrity for each file, initially just permissions. </span> +117: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">installLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +118: <span class="ruby-identifier">status</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span> ) +119: <span class="ruby-identifier">octal</span> = <span class="ruby-identifier">sprintf</span>( <span class="ruby-value str">"%o"</span>, <span class="ruby-identifier">status</span>.<span class="ruby-identifier">mode</span> ) +120: <span class="ruby-identifier">integrityFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.chomp}:#{octal}\n"</span> +121: <span class="ruby-keyword kw">end</span> +122: +123: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> +124: <span class="ruby-identifier">integrityFile</span>.<span class="ruby-identifier">close</span> +125: <span class="ruby-keyword kw">else</span> +126: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># no install log!</span> +127: <span class="ruby-keyword kw">end</span> +128: +129: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; +130: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000068"></a><b>to_journal</b>( message ) + <a name="M000069"></a><b>to_journal</b>( message ) </div> <div class="description"> <p> @@ -441,19 +495,19 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> - <div id="M000068_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p> + <div id="M000069_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 295</span> -295: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_journal</span>( <span class="ruby-identifier">message</span> ) -296: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">log</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$JOURNAL</span>, <span class="ruby-value str">"a+"</span> ) ) -297: <span class="ruby-identifier">log</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$TIMESTAMP} : #{message}\n"</span> -298: <span class="ruby-identifier">log</span>.<span class="ruby-identifier">close</span> -299: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -300: <span class="ruby-keyword kw">end</span> -301: -302: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -303: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 294</span> +294: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_journal</span>( <span class="ruby-identifier">message</span> ) +295: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">log</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$JOURNAL</span>, <span class="ruby-value str">"a+"</span> ) ) +296: <span class="ruby-identifier">log</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$TIMESTAMP} : #{message}\n"</span> +297: <span class="ruby-identifier">log</span>.<span class="ruby-identifier">close</span> +298: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +299: <span class="ruby-keyword kw">end</span> +300: +301: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +302: <span class="ruby-keyword kw">end</span> </pre> </div> </div> Modified: src/trunk/doc/classes/AbtPackage.html =================================================================== --- src/trunk/doc/classes/AbtPackage.html 2007-07-17 21:21:37 UTC (rev 378) +++ src/trunk/doc/classes/AbtPackage.html 2007-07-17 21:32:45 UTC (rev 379) @@ -76,7 +76,7 @@ <div id="content"> <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> <map id="map" name="map"> - <area shape="rect" coords="27,50,120,98" href="AbtPackage.html" alt="AbtPackage" /> + <area shape="rect" coords="27,50,115,98" href="AbtPackage.html" alt="AbtPackage" /> </map> <img src="../dot/f_3.png" usemap="#map" border="0" alt="dot/f_3.png"> </td></tr></table> Modified: src/trunk/doc/classes/AbtPackageManager.html =================================================================== --- src/trunk/doc/classes/AbtPackageManager.html 2007-07-17 21:21:37 UTC (rev 378) +++ src/trunk/doc/classes/AbtPackageManager.html 2007-07-17 21:32:45 UTC (rev 379) @@ -76,7 +76,7 @@ <div id="content"> <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> <map id="map" name="map"> - <area shape="rect" coords="27,50,168,98" href="AbtPackageManager.html" alt="AbtPackageManager" /> + <area shape="rect" coords="27,50,155,98" href="AbtPackageManager.html" alt="AbtPackageManager" /> </map> <img src="../dot/f_4.png" usemap="#map" border="0" alt="dot/f_4.png"> </td></tr></table> @@ -182,9 +182,10 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p> <div id="M000046_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 251</span> -251: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) -252: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 273</span> +273: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downgrade_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">version</span> ) +274: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +275: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -210,9 +211,10 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p> <div id="M000047_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 263</span> -263: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) -264: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 286</span> +286: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freeze_package</span>( <span class="ruby-identifier">package</span> ) +287: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +288: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -241,127 +243,118 @@ <pre> <span class="ruby-comment cmt"># File abtpackagemanager.rb, line 96</span> 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_package</span>( <span class="ruby-identifier">package</span>, <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) - 97: - 98: <span class="ruby-comment cmt"># first check if installed.</span> - 99: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> -100: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">package_installed</span>( <span class="ruby-identifier">package</span> ) ) -101: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\n*** Package #{packa... [truncated message content] |
From: <esc...@us...> - 2007-07-17 21:21:36
|
Revision: 378 http://svn.sourceforge.net/abtlinux/?rev=378&view=rev Author: eschabell Date: 2007-07-17 14:21:37 -0700 (Tue, 17 Jul 2007) Log Message: ----------- This don't work, changed to method call. Modified Paths: -------------- src/trunk/testsuiteabt.rb Modified: src/trunk/testsuiteabt.rb =================================================================== --- src/trunk/testsuiteabt.rb 2007-07-17 21:21:03 UTC (rev 377) +++ src/trunk/testsuiteabt.rb 2007-07-17 21:21:37 UTC (rev 378) @@ -22,7 +22,7 @@ manager = AbtPackageManager.new system = AbtSystemManager.new if !system.package_installed( "ipc" ) - manager.install_package << "ipc" + manager.install_package( "ipc" ) end require 'testabtpackagemanager' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 21:21:03
|
Revision: 377 http://svn.sourceforge.net/abtlinux/?rev=377&view=rev Author: eschabell Date: 2007-07-17 14:21:03 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Implemented remove_package. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 21:18:45 UTC (rev 376) +++ src/trunk/abtpackagemanager.rb 2007-07-17 21:21:03 UTC (rev 377) @@ -218,6 +218,7 @@ # otherwise false. ## def reinstall_package( package ) + return false end ## @@ -235,9 +236,28 @@ # get package details. details = sw.details + + # TODO: something with possible /etc or other configure files before removal, check maybe integrity for changes since install? - # - puts "Removing #{package} now..." + # remove listings in install log. + installLog = logger.get_log( package, 'install' ) + + IO.foreach( installLog ) do |line| + if File.exist?( line.chomp ) + FileUtils.rm( line.chomp ) + logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") + else + logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") + return false + end + end + + logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) + + # remove entry in install listing. + FileUtils.remove_dir( "#{$PACKAGE_INSTALLED}/#{details['Source location']}" ) + logger.to_journal( "Removed entry from installed packages." ) + return true end ## @@ -251,6 +271,7 @@ # false. ## def downgrade_package( package, version ) + return false end ## @@ -263,6 +284,7 @@ # false. ## def freeze_package( package ) + return false end ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 21:18:44
|
Revision: 376 http://svn.sourceforge.net/abtlinux/?rev=376&view=rev Author: eschabell Date: 2007-07-17 14:18:45 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Went public (was private) with get_log method, caused by usage in removal of package method. Modified Paths: -------------- src/trunk/abtlogmanager.rb Modified: src/trunk/abtlogmanager.rb =================================================================== --- src/trunk/abtlogmanager.rb 2007-07-17 21:17:24 UTC (rev 375) +++ src/trunk/abtlogmanager.rb 2007-07-17 21:18:45 UTC (rev 376) @@ -30,6 +30,8 @@ protected private + + public ## # Returns the path to given packages install log. @@ -67,9 +69,6 @@ return log end - - - public ## # Constructor for the AbtLogManager. It ensures all needed logs paths are This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 21:17:21
|
Revision: 375 http://svn.sourceforge.net/abtlinux/?rev=375&view=rev Author: eschabell Date: 2007-07-17 14:17:24 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Small adjustments to help the removal of a package calls. Modified Paths: -------------- src/trunk/abt.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-17 20:04:48 UTC (rev 374) +++ src/trunk/abt.rb 2007-07-17 21:17:24 UTC (rev 375) @@ -72,9 +72,9 @@ puts "\n\n" puts "*** Completed caching of package #{options['package']}. ***" puts "\n\n" - logger.to_journal( "\nCaching completed for package #{options['package']}." ) + logger.to_journal( "Caching completed for package #{options['package']}." ) else - logger.to_journal( "\nCaching of package #{options['package']} failed.") + logger.to_journal( "Caching of package #{options['package']} failed.") end else puts "*** #{options['package'].capitalize} install failed, " + @@ -97,7 +97,8 @@ when "remove", "-r" if ( ARGV.length == 2 ) options['package'] = ARGV[1] - logger.to_journal( "Starting to remove #{options['package']}" ) + puts "Starting to remove #{options['package']}." + logger.to_journal( "Starting to remove #{options['package']}." ) # return if not installed. if ( !( system.package_installed( options['package'] ) ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 20:04:45
|
Revision: 374 http://svn.sourceforge.net/abtlinux/?rev=374&view=rev Author: eschabell Date: 2007-07-17 13:04:48 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Was only caching the copies of the install file for integrity, build, and configure files, doh! Modified Paths: -------------- src/trunk/abtlogmanager.rb Modified: src/trunk/abtlogmanager.rb =================================================================== --- src/trunk/abtlogmanager.rb 2007-07-17 19:30:37 UTC (rev 373) +++ src/trunk/abtlogmanager.rb 2007-07-17 20:04:48 UTC (rev 374) @@ -215,9 +215,9 @@ sourcePath = $SOURCES_REPOSITORY + "/" + File.basename( sw.srcUrl ) sourceFile = File.basename( sw.srcUrl ) installLog = get_log( package, 'install' ) - buildLog = get_log( package, 'install' ) - configureLog = get_log( package, 'install' ) - integrityLog = get_log( package, 'install' ) + buildLog = get_log( package, 'build' ) + configureLog = get_log( package, 'configure' ) + integrityLog = get_log( package, 'integrity' ) packageFile = "#{$PACKAGE_PATH}#{package}.rb" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 19:30:34
|
Revision: 373 http://svn.sourceforge.net/abtlinux/?rev=373&view=rev Author: eschabell Date: 2007-07-17 12:30:37 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Typo fixed in install_package to ensure call to journal works. Modified Paths: -------------- src/trunk/abt.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-17 19:29:39 UTC (rev 372) +++ src/trunk/abt.rb 2007-07-17 19:30:37 UTC (rev 373) @@ -72,7 +72,7 @@ puts "\n\n" puts "*** Completed caching of package #{options['package']}. ***" puts "\n\n" - logger.to_ournal( "\nCaching completed for package #{options['package']}." ) + logger.to_journal( "\nCaching completed for package #{options['package']}." ) else logger.to_journal( "\nCaching of package #{options['package']} failed.") end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 19:29:42
|
Revision: 372 http://svn.sourceforge.net/abtlinux/?rev=372&view=rev Author: eschabell Date: 2007-07-17 12:29:39 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Build process good enough to default to remove build directory. Modified Paths: -------------- src/trunk/abtconfig.rb Modified: src/trunk/abtconfig.rb =================================================================== --- src/trunk/abtconfig.rb 2007-07-17 18:59:34 UTC (rev 371) +++ src/trunk/abtconfig.rb 2007-07-17 19:29:39 UTC (rev 372) @@ -59,7 +59,7 @@ $BUILD_ARCHITECTURE = "i686" $BUILD_OPTIMIZATIONS = "strip" $DEFAULT_PREFIX = "/usr/local" -$REMOVE_BUILD_SOURCES = false +$REMOVE_BUILD_SOURCES = true $TIMESTAMP = Time.now.strftime( "%Y-%m-%d %H:%M:%S (%Z)" ) $PAGER_DEFAULT = "less -R -E -X -f" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 18:59:35
|
Revision: 371 http://svn.sourceforge.net/abtlinux/?rev=371&view=rev Author: eschabell Date: 2007-07-17 11:59:34 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Added todo for install_cached_package that needs to be added. Started to work on remove_package method implementation. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 17:31:31 UTC (rev 370) +++ src/trunk/abtpackagemanager.rb 2007-07-17 18:59:34 UTC (rev 371) @@ -94,7 +94,6 @@ # false. ## def install_package( package, verbose=true ) - require "#{$PACKAGE_PATH}#{package}" sw = eval( "#{package.capitalize}.new" ) queuer = AbtQueueManager.new @@ -208,6 +207,8 @@ return true # install completed! end + # TODO: add install_cached_package( package ) + ## # Reinstalls a given package. # @@ -228,6 +229,14 @@ # false. ## def remove_package( package ) + require "#{$PACKAGE_PATH}#{package}" + sw = eval( "#{package.capitalize}.new" ) + logger = AbtLogManager.new + + # get package details. + details = sw.details + + # puts "Removing #{package} now..." end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 17:31:35
|
Revision: 370 http://svn.sourceforge.net/abtlinux/?rev=370&view=rev Author: eschabell Date: 2007-07-17 10:31:31 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Refactored code for suggesting reinstall when install called on existing package out of package manager and into the calling abt file. This reduces complexity within package manager, no longer depending on system class. Added code for remove package call in abt file. Placeholder print line added to package manager remove pacakge method. Modified Paths: -------------- src/trunk/abt.rb src/trunk/abtpackagemanager.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-17 15:00:47 UTC (rev 369) +++ src/trunk/abt.rb 2007-07-17 17:31:31 UTC (rev 370) @@ -30,9 +30,10 @@ # Setup needed classes and get ready to parse arguments. ## manager = AbtPackageManager.new -logger = AbtLogManager.new # initialized all needed paths. +logger = AbtLogManager.new # initializes all needed paths. reporter = AbtReportManager.new downloader = AbtDownloadManager.new +system = AbtSystemManager.new options = Hash.new show = AbtUsage.new @@ -54,8 +55,12 @@ logger.to_journal( "Starting to install #{options['package']}" ) # return if already installed. - require "#{$PACKAGE_PATH}#{options['package']}" - sw = eval( "#{options['package'].capitalize}.new" ) + if ( system.package_installed( options['package'] ) ) + puts "\n*** Package #{options['package']} is installed, might want to try reinstall? ***" + puts "\n\tabt reinstall #{options['package']}\n\n" + logger.to_journal( "Completed install of #{options['package']}." ) + exit + end if ( manager.install_package( options['package'] ) ) puts "\n\n" @@ -75,9 +80,6 @@ puts "*** #{options['package'].capitalize} install failed, " + "see journal. ***" end - - - #reporter.showQueue( "install" ); # DEBUG. else show.usage( "packages" ) exit @@ -95,7 +97,24 @@ when "remove", "-r" if ( ARGV.length == 2 ) options['package'] = ARGV[1] - puts "Removing package : " + options['package'] + logger.to_journal( "Starting to remove #{options['package']}" ) + + # return if not installed. + if ( !( system.package_installed( options['package'] ) ) ) + puts "\n\n" + puts "*** No need to remove #{options['package']}, it was not installed! ***" + puts "\n\n" + logger.to_journal( "Completed removal of #{options['package']}." ) + exit + end + + # is installed, remove package. + if ( manager.remove_package( options['package'] ) ) + puts "\n\n" + puts "*** Completed removal of #{options['package']}. ***" + puts "\n\n" + logger.to_journal( "Completed removal of #{options['package']}." ) + end else show.usage( "packages" ) exit Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 15:00:47 UTC (rev 369) +++ src/trunk/abtpackagemanager.rb 2007-07-17 17:31:31 UTC (rev 370) @@ -95,14 +95,6 @@ ## def install_package( package, verbose=true ) - # first check if installed. - system = AbtSystemManager.new - if ( system.package_installed( package ) ) - puts "\n*** Package #{package} is installed, might want to try reinstall? ***" - puts "'abt reinstall #{package}'" - return true - end - require "#{$PACKAGE_PATH}#{package}" sw = eval( "#{package.capitalize}.new" ) queuer = AbtQueueManager.new @@ -236,6 +228,7 @@ # false. ## def remove_package( package ) + puts "Removing #{package} now..." end ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 15:00:59
|
Revision: 369 http://svn.sourceforge.net/abtlinux/?rev=369&view=rev Author: eschabell Date: 2007-07-17 08:00:47 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Ruby way of passing args to method with '<<' does not work here. Modified Paths: -------------- src/trunk/abtlogmanager.rb Modified: src/trunk/abtlogmanager.rb =================================================================== --- src/trunk/abtlogmanager.rb 2007-07-16 20:23:30 UTC (rev 368) +++ src/trunk/abtlogmanager.rb 2007-07-17 15:00:47 UTC (rev 369) @@ -84,7 +84,7 @@ if ( ! File.directory?( dir ) ) FileUtils.mkdir_p( dir ) - to_journal << "Created directory: #{dir}." + to_journal( "Created directory: #{dir}." ) end } end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-16 20:23:28
|
Revision: 368 http://svn.sourceforge.net/abtlinux/?rev=368&view=rev Author: eschabell Date: 2007-07-16 13:23:30 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Regenerated ruby docs. Modified Paths: -------------- src/trunk/doc/classes/AbtDownloadManager.html src/trunk/doc/classes/AbtLogManager.html src/trunk/doc/classes/AbtPackage.html src/trunk/doc/classes/AbtPackageManager.html src/trunk/doc/classes/AbtQueueManager.html src/trunk/doc/classes/AbtReportManager.html src/trunk/doc/classes/AbtSystemManager.html src/trunk/doc/classes/AbtUsage.html src/trunk/doc/classes/TestAbtDepEngine.html src/trunk/doc/classes/TestAbtDownloadManager.html src/trunk/doc/classes/TestAbtLogManager.html src/trunk/doc/classes/TestAbtPackage.html src/trunk/doc/classes/TestAbtPackageManager.html src/trunk/doc/classes/TestAbtQueueManager.html src/trunk/doc/classes/TestAbtReportManager.html src/trunk/doc/classes/TestAbtSystemManager.html src/trunk/doc/created.rid src/trunk/doc/files/abtdownloadmanager_rb.html src/trunk/doc/files/abtlogmanager_rb.html src/trunk/doc/files/abtpackage_rb.html src/trunk/doc/files/abtpackagemanager_rb.html src/trunk/doc/files/abtqueuemanager_rb.html src/trunk/doc/files/abtreportmanager_rb.html src/trunk/doc/files/abtsystemmanager_rb.html src/trunk/doc/files/abtusage_rb.html src/trunk/doc/files/testabtdepengine_rb.html src/trunk/doc/files/testabtdownloadmanager_rb.html src/trunk/doc/files/testabtlogmanager_rb.html src/trunk/doc/files/testabtpackage_rb.html src/trunk/doc/files/testabtpackagemanager_rb.html src/trunk/doc/files/testabtqueuemanager_rb.html src/trunk/doc/files/testabtreportmanager_rb.html src/trunk/doc/files/testabtsystemmanager_rb.html src/trunk/doc/fr_method_index.html Modified: src/trunk/doc/classes/AbtDownloadManager.html =================================================================== --- src/trunk/doc/classes/AbtDownloadManager.html 2007-07-16 20:22:31 UTC (rev 367) +++ src/trunk/doc/classes/AbtDownloadManager.html 2007-07-16 20:23:30 UTC (rev 368) @@ -118,11 +118,11 @@ <div class="sectiontitle">Methods</div> <ul> <li><a href="#M000012">new</a></li> - <li><a href="#M000015">retrieveNewsFeed</a></li> - <li><a href="#M000013">retrievePackageSource</a></li> - <li><a href="#M000014">retrievePackageTree</a></li> - <li><a href="#M000016">updatePackage</a></li> - <li><a href="#M000017">updatePackageTree</a></li> + <li><a href="#M000015">retrieve_news_feed</a></li> + <li><a href="#M000013">retrieve_package_source</a></li> + <li><a href="#M000014">retrieve_package_tree</a></li> + <li><a href="#M000016">update_package</a></li> + <li><a href="#M000017">update_package_tree</a></li> </ul> @@ -160,7 +160,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000015"></a><b>retrieveNewsFeed</b>( uri, cleanLog=true ) + <a name="M000015"></a><b>retrieve_news_feed</b>( uri, cleanLog=true ) </div> <div class="description"> <p> @@ -179,7 +179,7 @@ <div id="M000015_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 95</span> - 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieveNewsFeed</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">cleanLog</span>=<span class="ruby-keyword kw">true</span> ) + 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieve_news_feed</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">cleanLog</span>=<span class="ruby-keyword kw">true</span> ) 96: <span class="ruby-identifier">require</span> <span class="ruby-value str">'net/http'</span> 97: <span class="ruby-identifier">require</span> <span class="ruby-value str">'uri'</span> 98: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rss/1.0'</span> @@ -196,7 +196,7 @@ 109: 110: <span class="ruby-comment cmt"># pick up the abtlinux.org news feed.</span> 111: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">news</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">get</span>( <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">uri</span> ) ) ) -112: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to retrieve news feed #{uri}."</span> ) +112: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Failed to retrieve news feed #{uri}."</span> ) 113: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 114: <span class="ruby-keyword kw">end</span> 115: @@ -208,7 +208,7 @@ 121: <span class="ruby-keyword kw">end</span> 122: 123: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">rss</span>.<span class="ruby-identifier">nil?</span> ) -124: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to display news feed as feed #{uri} "</span> <span class="ruby-operator">+</span> +124: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Failed to display news feed as feed #{uri} "</span> <span class="ruby-operator">+</span> 125: <span class="ruby-value str">"is not RSS 1.0/2.0."</span> ) 126: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> 127: <span class="ruby-keyword kw">else</span> @@ -231,7 +231,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000013"></a><b>retrievePackageSource</b>( packageName, destination ) + <a name="M000013"></a><b>retrieve_package_source</b>( packageName, destination ) </div> <div class="description"> <p> @@ -253,19 +253,19 @@ <div id="M000013_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 56</span> -56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrievePackageSource</span>( <span class="ruby-identifier">packageName</span>, <span class="ruby-identifier">destination</span> ) +56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieve_package_source</span>( <span class="ruby-identifier">packageName</span>, <span class="ruby-identifier">destination</span> ) 57: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{$PACKAGE_PATH}#{packageName}"</span> 58: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> 59: <span class="ruby-identifier">package</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-identifier">packageName</span>.<span class="ruby-identifier">capitalize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.new'</span> ) 60: 61: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-node">"#{destination}/#{File.basename( package.srcUrl )}"</span> ) ) -62: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Download not needed, existing source found for #{packageName}"</span> ) +62: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Download not needed, existing source found for #{packageName}"</span> ) 63: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> 64: <span class="ruby-keyword kw">end</span> 65: 66: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">destination</span> ) 67: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"wget #{package.srcUrl}"</span> ) ) -68: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Download completed for #{packageName}"</span> ) +68: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">to_journal</span>( <span class="ruby-node">"Download completed for #{packageName}"</span> ) 69: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> 70: <span class="ruby-keyword kw">end</span> 71: @@ -277,7 +277,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000014"></a><b>retrievePackageTree</b>( packageTreeName ) + <a name="M000014"></a><b>retrieve_package_tree</b>( packageTreeName ) </div> <div class="description"> <p> @@ -297,7 +297,7 @@ <div id="M000014_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 83</span> -83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrievePackageTree</span>( <span class="ruby-identifier">packageTreeName</span> ) +83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieve_package_tree</span>( <span class="ruby-identifier">packageTreeName</span> ) 84: <span class="ruby-keyword kw">end</span> </pre> </div> @@ -305,7 +305,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000016"></a><b>updatePackage</b>() + <a name="M000016"></a><b>update_package</b>() </div> <div class="description"> <p> @@ -324,7 +324,7 @@ <div id="M000016_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 150</span> -150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackage</span> +150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_package</span> 151: <span class="ruby-keyword kw">end</span> </pre> </div> @@ -332,7 +332,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000017"></a><b>updatePackageTree</b>() + <a name="M000017"></a><b>update_package_tree</b>() </div> <div class="description"> <p> @@ -348,7 +348,7 @@ <div id="M000017_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 159</span> -159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackageTree</span> +159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_package_tree</span> 160: <span class="ruby-keyword kw">end</span> </pre> </div> Modified: src/trunk/doc/classes/AbtLogManager.html =================================================================== --- src/trunk/doc/classes/AbtLogManager.html 2007-07-16 20:22:31 UTC (rev 367) +++ src/trunk/doc/classes/AbtLogManager.html 2007-07-16 20:23:30 UTC (rev 368) @@ -117,12 +117,12 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000067">cachePackage</a></li> - <li><a href="#M000066">logPackageBuild</a></li> - <li><a href="#M000065">logPackageInstall</a></li> - <li><a href="#M000064">logPackageIntegrity</a></li> - <li><a href="#M000068">logToJournal</a></li> + <li><a href="#M000067">cache_package</a></li> + <li><a href="#M000066">log_package_build</a></li> + <li><a href="#M000065">log_package_install</a></li> + <li><a href="#M000064">log_package_integrity</a></li> <li><a href="#M000063">new</a></li> + <li><a href="#M000068">to_journal</a></li> </ul> @@ -156,7 +156,7 @@ 84: 85: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">dir</span> ) ) 86: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">dir</span> ) -87: <span class="ruby-identifier">logToJournal</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Created directory: #{dir}."</span> +87: <span class="ruby-identifier">to_journal</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Created directory: #{dir}."</span> 88: <span class="ruby-keyword kw">end</span> 89: } 90: <span class="ruby-keyword kw">end</span> @@ -167,7 +167,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000067"></a><b>cachePackage</b>( package ) + <a name="M000067"></a><b>cache_package</b>( package ) </div> <div class="description"> <p> @@ -186,91 +186,91 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> <div id="M000067_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 210</span> -210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachePackage</span>( <span class="ruby-identifier">package</span> ) -211: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> -212: -213: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">packageInstalled</span>( <span class="ruby-identifier">package</span> ) ) -214: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) -215: <span class="ruby-identifier">cachedDir</span> = <span class="ruby-identifier">$PACKAGE_CACHED</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcDir</span> -216: <span class="ruby-identifier">sourcePath</span> = <span class="ruby-identifier">$SOURCES_REPOSITORY</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) -217: <span class="ruby-identifier">sourceFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) -218: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -219: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -220: <span class="ruby-identifier">configureLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -221: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -222: <span class="ruby-identifier">packageFile</span> = <span class="ruby-node">"#{$PACKAGE_PATH}#{package}.rb"</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 209</span> +209: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_package</span>( <span class="ruby-identifier">package</span> ) +210: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> +211: +212: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">package_installed</span>( <span class="ruby-identifier">package</span> ) ) +213: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) +214: <span class="ruby-identifier">cachedDir</span> = <span class="ruby-identifier">$PACKAGE_CACHED</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcDir</span> +215: <span class="ruby-identifier">sourcePath</span> = <span class="ruby-identifier">$SOURCES_REPOSITORY</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +216: <span class="ruby-identifier">sourceFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +217: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +218: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +219: <span class="ruby-identifier">configureLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +220: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +221: <span class="ruby-identifier">packageFile</span> = <span class="ruby-node">"#{$PACKAGE_PATH}#{package}.rb"</span> +222: 223: -224: -225: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">cachedDir</span> ) -226: -227: <span class="ruby-comment cmt"># collect package source.</span> -228: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">sourcePath</span> ) ) -229: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">sourcePath</span>, <span class="ruby-node">"#{cachedDir}/#{sourceFile}"</span> ) -230: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} source."</span> -231: <span class="ruby-keyword kw">else</span> -232: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} source."</span> -233: <span class="ruby-keyword kw">end</span> -234: -235: <span class="ruby-comment cmt"># collect package install log. </span> -236: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) -237: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.install"</span> ) -238: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} install log."</span> -239: <span class="ruby-keyword kw">else</span> -240: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} install log."</span> -241: <span class="ruby-keyword kw">end</span> -242: -243: <span class="ruby-comment cmt"># collect package build log. </span> -244: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) -245: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">buildLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.build"</span> ) -246: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} build log."</span> -247: <span class="ruby-keyword kw">else</span> -248: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} build log."</span> -249: <span class="ruby-keyword kw">end</span> -250: -251: <span class="ruby-comment cmt"># collect package configure log. </span> -252: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">configureLog</span> ) ) -253: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">configureLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.configure"</span> ) -254: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} configure log."</span> -255: <span class="ruby-keyword kw">else</span> -256: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} configure log."</span> -257: <span class="ruby-keyword kw">end</span> -258: -259: <span class="ruby-comment cmt"># collect package integrity log.</span> -260: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">integrityLog</span> ) ) -261: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.integrity"</span> ) -262: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} integrity log."</span> -263: <span class="ruby-keyword kw">else</span> -264: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} integrity log."</span> -265: <span class="ruby-keyword kw">end</span> -266: -267: <span class="ruby-comment cmt"># collect package description (class file).</span> -268: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">packageFile</span> ) ) -269: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">packageFile</span>, <span class="ruby-node">"#{cachedDir}/#{package}.rb"</span> ) -270: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} package description."</span> -271: <span class="ruby-keyword kw">else</span> -272: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} package description, from location #{packageFile}"</span> -273: <span class="ruby-keyword kw">end</span> -274: -275: <span class="ruby-comment cmt"># tar and bzip this directory (package-cache-version.tar.bz2) </span> -276: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">$PACKAGE_CACHED</span> ) -277: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"tar -cf #{sw.srcDir}.tar #{sw.srcDir}"</span> ) <span class="ruby-operator">&&</span> -278: <span class="ruby-identifier">system</span>( <span class="ruby-node">"bzip2 -f #{sw.srcDir}.tar"</span> ) ) -279: <span class="ruby-comment cmt"># last but not least, remove our tarball directory</span> -280: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>( <span class="ruby-identifier">cachedDir</span> ) -281: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -282: <span class="ruby-keyword kw">end</span> -283: <span class="ruby-keyword kw">end</span> -284: -285: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># package not installed, can't cache it.</span> -286: <span class="ruby-keyword kw">end</span> +224: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">cachedDir</span> ) +225: +226: <span class="ruby-comment cmt"># collect package source.</span> +227: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">sourcePath</span> ) ) +228: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">sourcePath</span>, <span class="ruby-node">"#{cachedDir}/#{sourceFile}"</span> ) +229: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} source."</span> +230: <span class="ruby-keyword kw">else</span> +231: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} source."</span> +232: <span class="ruby-keyword kw">end</span> +233: +234: <span class="ruby-comment cmt"># collect package install log. </span> +235: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) +236: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.install"</span> ) +237: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} install log."</span> +238: <span class="ruby-keyword kw">else</span> +239: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} install log."</span> +240: <span class="ruby-keyword kw">end</span> +241: +242: <span class="ruby-comment cmt"># collect package build log. </span> +243: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +244: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">buildLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.build"</span> ) +245: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} build log."</span> +246: <span class="ruby-keyword kw">else</span> +247: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} build log."</span> +248: <span class="ruby-keyword kw">end</span> +249: +250: <span class="ruby-comment cmt"># collect package configure log. </span> +251: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">configureLog</span> ) ) +252: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">configureLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.configure"</span> ) +253: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} configure log."</span> +254: <span class="ruby-keyword kw">else</span> +255: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} configure log."</span> +256: <span class="ruby-keyword kw">end</span> +257: +258: <span class="ruby-comment cmt"># collect package integrity log.</span> +259: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">integrityLog</span> ) ) +260: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.integrity"</span> ) +261: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} integrity log."</span> +262: <span class="ruby-keyword kw">else</span> +263: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} integrity log."</span> +264: <span class="ruby-keyword kw">end</span> +265: +266: <span class="ruby-comment cmt"># collect package description (class file).</span> +267: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">packageFile</span> ) ) +268: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">packageFile</span>, <span class="ruby-node">"#{cachedDir}/#{package}.rb"</span> ) +269: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} package description."</span> +270: <span class="ruby-keyword kw">else</span> +271: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} package description, from location #{packageFile}"</span> +272: <span class="ruby-keyword kw">end</span> +273: +274: <span class="ruby-comment cmt"># tar and bzip this directory (package-cache-version.tar.bz2) </span> +275: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">$PACKAGE_CACHED</span> ) +276: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"tar -cf #{sw.srcDir}.tar #{sw.srcDir}"</span> ) <span class="ruby-operator">&&</span> +277: <span class="ruby-identifier">system</span>( <span class="ruby-node">"bzip2 -f #{sw.srcDir}.tar"</span> ) ) +278: <span class="ruby-comment cmt"># last but not least, remove our tarball directory</span> +279: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>( <span class="ruby-identifier">cachedDir</span> ) +280: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +281: <span class="ruby-keyword kw">end</span> +282: <span class="ruby-keyword kw">end</span> +283: +284: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># package not installed, can't cache it.</span> +285: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>logPackageBuild</b>( package ) + <a name="M000066"></a><b>log_package_build</b>( package ) </div> <div class="description"> <p> @@ -289,24 +289,24 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> <div id="M000066_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 190</span> -190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageBuild</span>( <span class="ruby-identifier">package</span> ) -191: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) -192: -193: <span class="ruby-comment cmt"># make sure the build file exists.</span> -194: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) -195: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -196: <span class="ruby-keyword kw">end</span> -197: -198: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -199: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 189</span> +189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_build</span>( <span class="ruby-identifier">package</span> ) +190: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) +191: +192: <span class="ruby-comment cmt"># make sure the build file exists.</span> +193: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +194: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +195: <span class="ruby-keyword kw">end</span> +196: +197: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +198: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>logPackageInstall</b>( package ) + <a name="M000065"></a><b>log_package_install</b>( package ) </div> <div class="description"> <p> @@ -326,51 +326,50 @@ <div id="M000065_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 142</span> -142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageInstall</span>( <span class="ruby-identifier">package</span> ) +142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_install</span>( <span class="ruby-identifier">package</span> ) 143: <span class="ruby-comment cmt"># some dirs we will not add to an install log.</span> -144: <span class="ruby-identifier">excluded_pattern</span> = -145: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) -146: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> -147: -148: <span class="ruby-comment cmt"># our log locations.</span> -149: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -150: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'tmpinstall'</span> ) -151: -152: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> -153: <span class="ruby-comment cmt"># into our install log.</span> -154: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) -155: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) -156: -157: <span class="ruby-comment cmt"># include only the file names from open calls</span> -158: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> -159: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -160: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) -161: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) -162: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> -163: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> -164: <span class="ruby-keyword kw">else</span> -165: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> -166: <span class="ruby-keyword kw">end</span> -167: -168: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) -169: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: adding line to installFile!")</span> -170: <span class="ruby-identifier">installFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.split[2]}\n"</span> -171: <span class="ruby-keyword kw">end</span> -172: <span class="ruby-keyword kw">end</span> -173: <span class="ruby-keyword kw">end</span> -174: -175: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> -176: <span class="ruby-keyword kw">end</span> -177: -178: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; -179: <span class="ruby-keyword kw">end</span> +144: <span class="ruby-identifier">excluded_pattern</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) +145: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> +146: +147: <span class="ruby-comment cmt"># our log locations.</span> +148: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +149: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'tmpinstall'</span> ) +150: +151: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> +152: <span class="ruby-comment cmt"># into our install log.</span> +153: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) +154: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) +155: +156: <span class="ruby-comment cmt"># include only the file names from open calls</span> +157: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> +158: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +159: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) +160: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) +161: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> +162: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> +163: <span class="ruby-keyword kw">else</span> +164: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> +165: <span class="ruby-keyword kw">end</span> +166: +167: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) +168: <span class="ruby-comment cmt">#self.to_journal( "DEBUG: adding line to installFile!")</span> +169: <span class="ruby-identifier">installFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.split[2]}\n"</span> +170: <span class="ruby-keyword kw">end</span> +171: <span class="ruby-keyword kw">end</span> +172: <span class="ruby-keyword kw">end</span> +173: +174: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> +175: <span class="ruby-keyword kw">end</span> +176: +177: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; +178: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>logPackageIntegrity</b>( package ) + <a name="M000064"></a><b>log_package_integrity</b>( package ) </div> <div class="description"> <p> @@ -391,14 +390,14 @@ <div id="M000064_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File abtlogmanager.rb, line 102</span> -102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageIntegrity</span>( <span class="ruby-identifier">package</span> ) +102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_package_integrity</span>( <span class="ruby-identifier">package</span> ) 103: <span class="ruby-comment cmt">#require "#{$PACKAGE_PATH}#{package}"</span> 104: <span class="ruby-comment cmt">#sw = eval( "#{package.capitalize}.new" )</span> 105: <span class="ruby-comment cmt">#details = sw.details</span> 106: 107: <span class="ruby-comment cmt"># our log locations.</span> -108: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) -109: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'integrity'</span> ) +108: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +109: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">get_log</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'integrity'</span> ) 110: 111: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> 112: <span class="ruby-comment cmt"># into our install log.</span> @@ -427,7 +426,7 @@ </div> <div class="method"> <div class="title"> - <a name="M000068"></a><b>logToJournal</b>( message ) + <a name="M000068"></a><b>to_journal</b>( message ) </div> <div class="description"> <p> @@ -445,16 +444,16 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> <div id="M000068_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtlogmanager.rb, line 296</span> -296: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logToJournal</span>( <span class="ruby-identifier">message</span> ) -297: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">log</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$JOURNAL</span>, <span class="ruby-value str">"a+"</span> ) ) -298: <span class="ruby-identifier">log</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$TIMESTAMP} : #{message}\n"</span> -299: <span class="ruby-identifier">log</span>.<span class="ruby-identifier">close</span> -300: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -301: <span class="ruby-keyword kw">end</span> -302: -303: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -304: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 295</span> +295: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_journal</span>( <span class="ruby-identifier">message</span> ) +296: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">log</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$JOURNAL</span>, <span class="ruby-value str">"a+"</span> ) ) +297: <span class="ruby-identifier">log</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{$TIMESTAMP} : #{message}\n"</span> +298: <span class="ruby-identifier">log</span>.<span class="ruby-identifier">close</span> +299: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +300: <span class="ruby-keyword kw">end</span> +301: +302: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +303: <span class="ruby-keyword kw">end</span> </pre> </div> </div> Modified: src/trunk/doc/classes/AbtPackage.html =================================================================== --- src/trunk/doc/classes/AbtPackage.html 2007-07-16 20:22:31 UTC (rev 367) +++ src/trunk/doc/classes/AbtPackage.html 2007-07-16 20:23:30 UTC (rev 368) @@ -130,8 +130,8 @@ <li><a href="#M000033">post</a></li> <li><a href="#M000028">pre</a></li> <li><a href="#M000031">preinstall</a></li> - <li><a href="#M000034">removeBuild</a></li> - <li><a href="#M000025">unpackSources</a></li> + <li><a href="#M000034">remove_build</a></li> + <li><a href="#M000025">unpack_sources</a></li> </ul> @@ -320,25 +320,25 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000026_source')" id="l_M000026_source">show source</a> ]</p> <div id="M000026_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 151</span> -151: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">data</span> ) -152: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'name'</span>] -153: <span class="ruby-ivar">@execName</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'execName'</span>] -154: <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'version'</span>] -155: <span class="ruby-ivar">@srcDir</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'srcDir'</span>] -156: <span class="ruby-ivar">@homepage</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'homepage'</span>] -157: <span class="ruby-ivar">@srcUrl</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'srcUrl'</span>] -158: <span class="ruby-ivar">@dependsOn</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'dependsOn'</span>] -159: <span class="ruby-ivar">@reliesOn</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'reliesOn'</span>] -160: <span class="ruby-ivar">@optionalDO</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'optionalDO'</span>] -161: <span class="ruby-ivar">@optionalRO</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'optionalRO'</span>] -162: <span class="ruby-ivar">@hashCheck</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'hashCheck'</span>] -163: <span class="ruby-ivar">@patches</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'patches'</span>] -164: <span class="ruby-ivar">@patchesHashCheck</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'patchesHashCheck'</span>] -165: <span class="ruby-ivar">@mirrorPath</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'mirrorPath'</span>] -166: <span class="ruby-ivar">@license</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'license'</span>] -167: <span class="ruby-ivar">@description</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'description'</span>] -168: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 147</span> +147: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>( <span class="ruby-identifier">data</span> ) +148: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'name'</span>] +149: <span class="ruby-ivar">@execName</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'execName'</span>] +150: <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'version'</span>] +151: <span class="ruby-ivar">@srcDir</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'srcDir'</span>] +152: <span class="ruby-ivar">@homepage</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'homepage'</span>] +153: <span class="ruby-ivar">@srcUrl</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'srcUrl'</span>] +154: <span class="ruby-ivar">@dependsOn</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'dependsOn'</span>] +155: <span class="ruby-ivar">@reliesOn</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'reliesOn'</span>] +156: <span class="ruby-ivar">@optionalDO</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'optionalDO'</span>] +157: <span class="ruby-ivar">@optionalRO</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'optionalRO'</span>] +158: <span class="ruby-ivar">@hashCheck</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'hashCheck'</span>] +159: <span class="ruby-ivar">@patches</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'patches'</span>] +160: <span class="ruby-ivar">@patchesHashCheck</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'patchesHashCheck'</span>] +161: <span class="ruby-ivar">@mirrorPath</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'mirrorPath'</span>] +162: <span class="ruby-ivar">@license</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'license'</span>] +163: <span class="ruby-ivar">@description</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value str">'description'</span>] +164: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -366,24 +366,24 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p> <div id="M000030_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 275</span> -275: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -276: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -277: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build"</span> -278: <span class="ruby-keyword kw">else</span> -279: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make > #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build 2>&1"</span> -280: <span class="ruby-keyword kw">end</span> -281: -282: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) -283: -284: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) -285: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section failed."</span> -286: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -287: <span class="ruby-keyword kw">end</span> -288: -289: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -290: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -291: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtpackage.rb, line 269</span> +269: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) +270: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +271: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build"</span> +272: <span class="ruby-keyword kw">else</span> +273: <span class="ruby-identifier">command</span> = <span class="ruby-node">"make > #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.build 2>&1"</span> +274: <span class="ruby-keyword kw">end</span> +275: +276: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-node">"#{$BUILD_LOCATION}/#{@srcDir}"</span> ) +277: +278: <span class="ruby-keyword kw">if</span>( <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>( <span class="ruby-identifier">command</span> ) ) +279: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section failed."</span> +280: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +281: <span class="ruby-keyword kw">end</span> +282: +283: <span class="ruby-identifier">puts</span> <span class="ruby-value str">"DEBUG: [AbtPackage.build] - build section completed!"</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) +284: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +285: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -415,26 +415,24 @@ <p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p> <div id="M000029_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File abtpackage.rb, line 245</span> -245: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>( <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">true</span> ) -246: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">verbose</span> ) -247: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} | tee "</span> <span class="ruby-operator">+</span> -248: <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure"</span> -249: <span class="ruby-keyword kw">else</span> -250: <span class="ruby-identifier">command</span> = <span class="ruby-node">"./configure --prefix=#{$DEFAULT_PREFIX} 1> "</span> <span class="ruby-operator">+</span> -251: <span class="ruby-node">"#{$PA... [truncated message content] |
From: <esc...@us...> - 2007-07-16 20:22:28
|
Revision: 367 http://svn.sourceforge.net/abtlinux/?rev=367&view=rev Author: eschabell Date: 2007-07-16 13:22:31 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Massive refactoring of the abt api method names, coverted all occurances to ruby standard naming (lowercase names with underscores for word separation). Modified Paths: -------------- src/trunk/abt.rb src/trunk/abtdownloadmanager.rb src/trunk/abtlogmanager.rb src/trunk/abtpackage.rb src/trunk/abtpackagemanager.rb src/trunk/abtqueuemanager.rb src/trunk/abtreportmanager.rb src/trunk/abtsystemmanager.rb src/trunk/abtusage.rb src/trunk/testabtdepengine.rb src/trunk/testabtdownloadmanager.rb src/trunk/testabtlogmanager.rb src/trunk/testabtpackage.rb src/trunk/testabtpackagemanager.rb src/trunk/testabtqueuemanager.rb src/trunk/testabtreportmanager.rb src/trunk/testabtsystemmanager.rb src/trunk/testsuiteabt.rb Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abt.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -42,7 +42,7 @@ end # login as root for the rest. -manager.rootLogin( ARGV ) +manager.root_login( ARGV ) # parse arguments. case ARGV[0] @@ -51,25 +51,25 @@ when "install", "-i" if ( ARGV.length == 2 && File.exist?( "#{$PACKAGE_PATH}#{ARGV[1]}.rb" ) ) options['package'] = ARGV[1] - logger.logToJournal( "Starting to install #{options['package']}" ) + logger.to_journal( "Starting to install #{options['package']}" ) # return if already installed. require "#{$PACKAGE_PATH}#{options['package']}" sw = eval( "#{options['package'].capitalize}.new" ) - if ( manager.installPackage( options['package'] ) ) + if ( manager.install_package( options['package'] ) ) puts "\n\n" puts "*** Completed install of #{options['package']}. ***" puts "\n\n" - logger.logToJournal( "Completed install of #{options['package']}." ) + logger.to_journal( "Completed install of #{options['package']}." ) - if ( logger.cachePackage( options['package'] ) ) + if ( logger.cache_package( options['package'] ) ) puts "\n\n" puts "*** Completed caching of package #{options['package']}. ***" puts "\n\n" - logger.logToJournal( "\nCaching completed for package #{options['package']}." ) + logger.to_ournal( "\nCaching completed for package #{options['package']}." ) else - logger.logToJournal( "\nCaching of package #{options['package']} failed.") + logger.to_journal( "\nCaching of package #{options['package']} failed.") end else puts "*** #{options['package'].capitalize} install failed, " + @@ -143,10 +143,10 @@ when "show-details" if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) options['pkg'] = ARGV[1] - logger.logToJournal( "Starting show details for #{options['pkg']}" ) + logger.to_journal( "Starting show details for #{options['pkg']}" ) - if ( reporter.showPackageDetails( options['pkg'] ) ) - logger.logToJournal( "Completed show details for #{options['pkg']}" ) + if ( reporter.show_package_details( options['pkg'] ) ) + logger.to_journal( "Completed show details for #{options['pkg']}" ) else puts "Problems processing the details for #{options['pkg']}." end @@ -205,10 +205,10 @@ # abt show-journal when "show-journal" - reporter.showJournal( $JOURNAL ) + reporter.show_journal( $JOURNAL ) when "show-iqueue" - reporter.showQueue( "install" ) + reporter.show_queue( "install" ) when "show-patches" puts "Display currently available patches for installed package tree." @@ -225,45 +225,45 @@ # abt news | -n when "news", "-n" - logger.logToJournal( "Starting to retrieve AbTLinux news." ) + logger.to_journal( "Starting to retrieve AbTLinux news." ) # abtlinux.org news feeds. puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS ) ) + if ( !downloader.retrieve_news_feed( $ABTNEWS ) ) puts "Failed to retrieve the AbTLinux news feed." end puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS_THREADS, false ) ) + if ( !downloader.retrieve_news_feed( $ABTNEWS_THREADS, false ) ) puts "Failed to retrieve the AbTLinux forum threads news feed." end puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS_POSTS, false ) ) + if ( !downloader.retrieve_news_feed( $ABTNEWS_POSTS, false ) ) puts "Failed to retrieve the AbTLinux new posts news feed." end # display the file contents. - reporter.showJournal( $ABTNEWS_LOG ) + reporter.show_journal( $ABTNEWS_LOG ) - logger.logToJournal( "Completed the retrieval of AbTLinux news." ) + logger.to_journal( "Completed the retrieval of AbTLinux news." ) # abt [-d | download ] <package> when "download", "-d" if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) options['pkg'] = ARGV[1] - logger.logToJournal( "Starting to download " + options['pkg'] ) + logger.to_journal( "Starting to download " + options['pkg'] ) manager = AbtDownloadManager.new - if ( manager.retrievePackageSource( options['pkg'], $SOURCES_REPOSITORY ) ) - logger.logToJournal( "Finished download for " + options['pkg'] ) + if ( manager.retrieve_package_source( options['pkg'], $SOURCES_REPOSITORY ) ) + logger.to_journal( "Finished download for " + options['pkg'] ) puts "\n"; print "Downloading of #{options['pkg']} to #{$SOURCES_REPOSITORY} " puts "completed." puts "\n\n" else - logger.logToJournal( "FAILURE to download " + options['pkg'] ) + logger.to_journal( "FAILURE to download " + options['pkg'] ) puts "\n" puts "DOWNLOADING - failed to download source for #{options['pkg']}" puts "\n\n" Modified: src/trunk/abtdownloadmanager.rb =================================================================== --- src/trunk/abtdownloadmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtdownloadmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -53,19 +53,19 @@ # <b>RETURN</b> <i>boolean</i> - True if the package source has been # downloaded, otherwise false. ## - def retrievePackageSource( packageName, destination ) + def retrieve_package_source( packageName, destination ) require "#{$PACKAGE_PATH}#{packageName}" logger = AbtLogManager.new package = eval( packageName.capitalize + '.new' ) if ( File.exist?( "#{destination}/#{File.basename( package.srcUrl )}" ) ) - logger.logToJournal( "Download not needed, existing source found for #{packageName}" ) + logger.to_journal( "Download not needed, existing source found for #{packageName}" ) return true end Dir.chdir( destination ) if ( system( "wget #{package.srcUrl}" ) ) - logger.logToJournal( "Download completed for #{packageName}" ) + logger.to_journal( "Download completed for #{packageName}" ) return true end @@ -80,7 +80,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package tree is retrieved, # otherwise false. ## - def retrievePackageTree( packageTreeName ) + def retrieve_package_tree( packageTreeName ) end ## @@ -92,7 +92,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the AbTLinux news feed has been # retrieved, otherwise false. ## - def retrieveNewsFeed( uri, cleanLog=true ) + def retrieve_news_feed( uri, cleanLog=true ) require 'net/http' require 'uri' require 'rss/1.0' @@ -109,7 +109,7 @@ # pick up the abtlinux.org news feed. if ( !news = Net::HTTP.get( URI.parse( uri ) ) ) - logger.logToJournal( "Failed to retrieve news feed #{uri}." ) + logger.to_journal( "Failed to retrieve news feed #{uri}." ) return false end @@ -121,7 +121,7 @@ end if ( rss.nil? ) - logger.logToJournal( "Failed to display news feed as feed #{uri} " + + logger.to_journal( "Failed to display news feed as feed #{uri} " + "is not RSS 1.0/2.0." ) return false else @@ -147,7 +147,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the given package has been updated, # otherwise false. ## - def updatePackage + def update_package end ## @@ -156,7 +156,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package tree has been updated, # otherwise false. ## - def updatePackageTree + def update_package_tree end end Modified: src/trunk/abtlogmanager.rb =================================================================== --- src/trunk/abtlogmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtlogmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -38,7 +38,7 @@ # # <b>RETURN</b> <i>String</i> - Full path to install log. ## - def getLog( package, type ) + def get_log( package, type ) require "#{$PACKAGE_PATH}#{package}" sw = eval( "#{package.capitalize}.new" ) details = sw.details @@ -84,7 +84,7 @@ if ( ! File.directory?( dir ) ) FileUtils.mkdir_p( dir ) - logToJournal << "Created directory: #{dir}." + to_journal << "Created directory: #{dir}." end } end @@ -99,14 +99,14 @@ # <b>RETURN</b> <i>boolean</i> - True if integrity log created successfully, # otherwise false. ## - def logPackageIntegrity( package ) + def log_package_integrity( package ) #require "#{$PACKAGE_PATH}#{package}" #sw = eval( "#{package.capitalize}.new" ) #details = sw.details # our log locations. - installLog = getLog( package, 'install' ) - integrityLog = getLog( package, 'integrity' ) + installLog = get_log( package, 'install' ) + integrityLog = get_log( package, 'integrity' ) # get the installed files from the tmp file # into our install log. @@ -139,15 +139,14 @@ # <b>RETURN</b> <i>boolean</i> - True if install log created successfully, # otherwise false. ## - def logPackageInstall( package ) + def log_package_install( package ) # some dirs we will not add to an install log. - excluded_pattern = - Regexp.new( "^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+" ) + excluded_pattern = Regexp.new( "^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+" ) badLine = false # used to mark excluded lines from installwatch log. # our log locations. - installLog = getLog( package, 'install' ) - tmpInstallLog = getLog( package, 'tmpinstall' ) + installLog = get_log( package, 'install' ) + tmpInstallLog = get_log( package, 'tmpinstall' ) # get the installed files from the tmp file # into our install log. @@ -166,7 +165,7 @@ end if ( !badLine ) - #self.logToJournal( "DEBUG: adding line to installFile!") + #self.to_journal( "DEBUG: adding line to installFile!") installFile << "#{line.split[2]}\n" end end @@ -187,8 +186,8 @@ # <b>RETURN</b> <i>boolean</i> - True if build log created successfully, # otherwise false. ## - def logPackageBuild( package ) - buildLog = getLog( package, 'build' ) + def log_package_build( package ) + buildLog = get_log( package, 'build' ) # make sure the build file exists. if ( !File.exist?( buildLog ) ) @@ -207,18 +206,18 @@ # <b>RETURN</b> <i>boolean</i> - True if package cache created successfully, # otherwise false. ## - def cachePackage( package ) + def cache_package( package ) system = AbtSystemManager.new - if ( system.packageInstalled( package ) ) + if ( system.package_installed( package ) ) sw = eval( "#{package.capitalize}.new" ) cachedDir = $PACKAGE_CACHED + "/" + sw.srcDir sourcePath = $SOURCES_REPOSITORY + "/" + File.basename( sw.srcUrl ) sourceFile = File.basename( sw.srcUrl ) - installLog = getLog( package, 'install' ) - buildLog = getLog( package, 'install' ) - configureLog = getLog( package, 'install' ) - integrityLog = getLog( package, 'install' ) + installLog = get_log( package, 'install' ) + buildLog = get_log( package, 'install' ) + configureLog = get_log( package, 'install' ) + integrityLog = get_log( package, 'install' ) packageFile = "#{$PACKAGE_PATH}#{package}.rb" @@ -293,7 +292,7 @@ # # <b>RETURN</b> <i>boolean</i> True if logged, otherwise false. ## - def logToJournal( message ) + def to_journal( message ) if ( log = File.new( $JOURNAL, "a+" ) ) log << "#{$TIMESTAMP} : #{message}\n" log.close Modified: src/trunk/abtpackage.rb =================================================================== --- src/trunk/abtpackage.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtpackage.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -37,7 +37,7 @@ # <b>RETURNS:</b> <i>boolean</i> - True if the completes sucessfully, # otherwise false. ## - def unpackSources + def unpack_sources srcFile = File.basename( @srcUrl ) sourcesToUnpack = "#{$SOURCES_REPOSITORY}/#{srcFile}" unpackTool = "" @@ -76,11 +76,7 @@ # unsupported format. return false end - - # DEBUG: - #logger = AbtLogManager.new - #logger.logToJournal( "DEBUG: unpack tool will be '#{unpackTool}'." ) - + Dir.chdir( $BUILD_LOCATION ) if ( !system( "#{unpackTool} #{sourcesToUnpack}" ) ) return false @@ -208,12 +204,12 @@ downloader = AbtDownloadManager.new # download sources. - if ( !downloader.retrievePackageSource( @name.downcase, $SOURCES_REPOSITORY ) ) + if ( !downloader.retrieve_package_source( @name.downcase, $SOURCES_REPOSITORY ) ) return false end # unpack sources. - if ( !self.unpackSources ) + if ( !unpack_sources ) return false end @@ -244,11 +240,9 @@ ## def configure( verbose=true ) if ( verbose ) - command = "./configure --prefix=#{$DEFAULT_PREFIX} | tee " + - "#{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure" + command = "./configure --prefix=#{$DEFAULT_PREFIX} | tee #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure" else - command = "./configure --prefix=#{$DEFAULT_PREFIX} 1> " + - "#{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure 2>&1" + command = "./configure --prefix=#{$DEFAULT_PREFIX} 1> #{$PACKAGE_INSTALLED}/#{@srcDir}/#{@srcDir}.configure 2>&1" end Dir.chdir( "#{$BUILD_LOCATION}/#{@srcDir}" ) @@ -359,7 +353,7 @@ # <b>RETURNS:</b> <i>boolean</i> - True if the completes sucessfully, # otherwise false. ## - def removeBuild + def remove_build puts "Removings build..." if ( $REMOVE_BUILD_SOURCES ) buildSourcesLocation = "#{$BUILD_LOCATION}/#{srcDir}" Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtpackagemanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -42,7 +42,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the action rolls back, otherwise # false. ## - def rollBack( type, details ) + def roll_back( type, details ) logFile = "#{$PACKAGE_INSTALLED}/#{details['Source location']}/" case type @@ -93,11 +93,11 @@ # <b>RETURN</b> <i>boolean</i> - True if the package is installed, otherwise # false. ## - def installPackage( package, verbose=true ) + def install_package( package, verbose=true ) # first check if installed. system = AbtSystemManager.new - if ( system.packageInstalled( package ) ) + if ( system.package_installed( package ) ) puts "\n*** Package #{package} is installed, might want to try reinstall? ***" puts "'abt reinstall #{package}'" return true @@ -116,8 +116,8 @@ # add to install queue. puts "\n*** Adding #{package} to the INSTALL QUEUE. ***" if ( verbose ) - if ( !queuer.actionPackageQueue( package, "install", "add" ) ) - logger.logToJournal( "Failed to add #{package} to install queue." ) + if ( !queuer.action_package_queue( package, "install", "add" ) ) + logger.to_journal( "Failed to add #{package} to install queue." ) return false end @@ -125,48 +125,48 @@ puts "\n*** Processing the PRE section for #{package}. ***" if (verbose ) if ( !sw.pre ) - logger.logToJournal( "Failed to process pre-section in the " + + logger.to_journal( "Failed to process pre-section in the " + "package description of #{package}." ) return false else - logger.logToJournal( "DEBUG: finished #{package} pre section." ) + logger.to_journal( "DEBUG: finished #{package} pre section." ) end # configure section. puts "\n*** Processing the CONFIGURE section for #{package}. ***" if ( verbose ) if ( !sw.configure( verbose ) ) - logger.logToJournal( "Failed to process configure section in the " + + logger.to_journal( "Failed to process configure section in the " + "package description of #{package}." ) return false else - logger.logToJournal( "DEBUG: finished #{package} configure section." ) + logger.to_journal( "DEBUG: finished #{package} configure section." ) end # build section. puts "\n*** Processing the BUILD section for #{package}. ***" if ( verbose ) if ( !sw.build( verbose ) ) - logger.logToJournal( "Failed to process build section in the " + + logger.to_journal( "Failed to process build section in the " + "package description of #{package}." ) return false else - if ( !logger.logPackageBuild( sw.name.downcase ) ) - logger.logToJournal( "Failed to create a package build log." ) + if ( !logger.log_package_build( sw.name.downcase ) ) + logger.to_journal( "Failed to create a package build log." ) return false end - logger.logToJournal( "DEBUG: finished #{package} build section." ) + logger.to_journal( "DEBUG: finished #{package} build section." ) end # preinstall section. puts "\n*** Processing the PREINSTALL section for #{package}. ***" if ( verbose ) if ( !sw.preinstall ) - logger.logToJournal( "Failed to process preinstall section in the " + + logger.to_journal( "Failed to process preinstall section in the " + "package description of #{package}." ) return false else - logger.logToJournal( "DEBUG: finished #{package} preinstall section." ) + logger.to_journal( "DEBUG: finished #{package} preinstall section." ) end # install section. @@ -174,47 +174,43 @@ if ( !sw.install ) # rollback installed files if any and remove install log. - logger.logToJournal( "Failed to process install section in the " + + logger.to_journal( "Failed to process install section in the " + "package description of #{package}." ) - logger.logPackageInstall( sw.name.downcase ) - logger.logToJournal( - "***Starting rollback of #{package} install and removing install log." ) - self.rollBack( "install", details ) + logger.log_package_install( sw.name.downcase ) + logger.to_journal( "***Starting rollback of #{package} install and removing install log." ) + roll_back( "install", details ) return false else - logger.logPackageInstall( sw.name.downcase ) - logger.logPackageIntegrity( sw.name.downcase ) + logger.log_package_install( sw.name.downcase ) + logger.log_package_integrity( sw.name.downcase ) # cleanup tmp files from installwatch. File.delete( "#{$ABT_TMP}/#{details['Source location']}.watch" ) - logger.logToJournal( "DEBUG: finished #{package} install section." ) + logger.to_journal( "DEBUG: finished #{package} install section." ) end # post section. puts "\n*** Processing the POST section for #{package}. ***" if ( verbose ) if ( !sw.post ) - logger.logToJournal( "Failed to process post section in the " + - "package description of #{package}." ) + logger.to_journal( "Failed to process post section in the package description of #{package}." ) return false else - logger.logToJournal( "DEBUG: finished #{package} post section." ) + logger.to_journal( "DEBUG: finished #{package} post section." ) end # clean out build sources. puts "\n*** Cleaning up the sources for #{package}. ***" if ( verbose ) - if ( !sw.removeBuild ) - logger.logToJournal( "Failed to remove the build sources for " + - "#{package}." ) + if ( !sw.remove_build ) + logger.to_journal( "Failed to remove the build sources for #{package}." ) #return false # commented out as this is not a reason to fail. end # remove pacakge from install queue. - if ( !queuer.actionPackageQueue( sw.name.downcase, "install", "remove" ) ) - logger.logToJournal( "Failed to remove #{sw.name.donwcase} " + - "from install queue." ) + if ( !queuer.action_package_queue( sw.name.downcase, "install", "remove" ) ) + logger.to_journal( "Failed to remove #{sw.name.donwcase} from install queue." ) end return true # install completed! @@ -228,7 +224,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package is reinstalled, # otherwise false. ## - def reinstallPackage( package ) + def reinstall_package( package ) end ## @@ -239,7 +235,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package is removed, otherwise # false. ## - def removePackage( package ) + def remove_package( package ) end ## @@ -252,7 +248,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package is downgraded, otherwise # false. ## - def downgradePackage( package, version ) + def downgrade_package( package, version ) end ## @@ -264,7 +260,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package is frozen, otherwise # false. ## - def freezePackage( package ) + def freeze_package( package ) end ## @@ -274,7 +270,7 @@ # # <b>RETURN</b> <i>void</i> ## - def rootLogin( arguments ) + def root_login( arguments ) if ( Process.uid != 0 ) args = "" puts "\nEnter root password:" Modified: src/trunk/abtqueuemanager.rb =================================================================== --- src/trunk/abtqueuemanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtqueuemanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -51,7 +51,7 @@ # # <b>RETURN</b> <i>boolean</i> - true if action succeeds, otherwise false. ## - def actionPackageQueue( package, queue, action="add" ) + def action_package_queue( package, queue, action="add" ) require 'fileutils' logger = AbtLogManager.new queueFile = "" # used to hold the queue location. @@ -65,8 +65,7 @@ if ( action == "add") if ( - log = File.new( - queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) + log = File.new( queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) # pickup queue contents to ensure no duplicates. checkingQueue = IO.readlines( queueFile ) @@ -75,9 +74,9 @@ !checkingQueue.collect{ |i| i.split( '|' )[0] }.include?( package ) ) log.puts "#{package}|#{$TIMESTAMP}" - logger.logToJournal( "Added #{package} to #{queue} queue." ) + logger.to_journal( "Added #{package} to #{queue} queue." ) else - logger.logToJournal( + logger.to_journal( "Did not add #{package} to #{queue}, already exists." ) end @@ -89,8 +88,7 @@ if ( action == "remove" ) # remove entry from given queue. if ( - log = File.new( - queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) + log = File.new( queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) # use temp file to filter out entry to be removed. temp = File.new(queueFile + ".tmp", "a+") @@ -110,7 +108,7 @@ return true end - logger.logToJournal( "Failed to open #{queueFile}." ) + logger.to_journal( "Failed to open #{queueFile}." ) return false end end Modified: src/trunk/abtreportmanager.rb =================================================================== --- src/trunk/abtreportmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtreportmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -50,7 +50,7 @@ # <b>RETURN</b> <i>boolean</i> - True if completes without error, # otherwise false. ## - def showPackageDetails( package ) + def show_package_details( package ) require "#{$PACKAGE_PATH}#{package}" if ( package = eval( "#{package.capitalize}.new" ) ) @@ -86,8 +86,7 @@ return true end - logger.logToJournal( "[AbtReportManger::showPackageDetails] - failed" + - "to show details for ${package}." ) + logger.to_journal( "[AbtReportManger::showPackageDetails] - failed to show details for ${package}." ) return false end @@ -96,7 +95,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showInstalledPackages + def show_installed_packages end ## @@ -109,7 +108,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showPackageLog( package, logType ) + def show_package_log( package, logType ) # install log # build log # integrity log @@ -120,7 +119,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showFrozenPackages + def show_frozen_packages end ## @@ -133,7 +132,7 @@ # <b>RETURN</b> <i>hash</i> - Empty hash if no problems found, otherwise # hash of problem files and their encountered errors. ## - def showPackageDependencies( package ) + def show_package_dependencies( package ) end ## @@ -143,7 +142,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showUntrackedFiles + def show_untracked_files end ## @@ -153,7 +152,7 @@ # # <b>RETURN</b> <i>iboolean</i> True if journal shown, otherwise false. ## - def showJournal( fileName ) + def show_journal( fileName ) if ( File.exist?( fileName ) ) puts "\n\n" puts "AbTLinux log:" @@ -178,7 +177,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showFileOwner( file ) + def show_file_owner( file ) end ## @@ -190,7 +189,7 @@ # <b>RETURN</b> <i>hash</i> - a hash of the search results, keys are package # names and values are matching descriptions. ## - def searchPackageDescriptions( searchText ) + def search_package_descriptions( searchText ) end ## @@ -201,7 +200,7 @@ # # <b>RETURN</b> <i>void.</i> ## - def showQueue( queueType ) + def show_queue( queueType ) case queueType @@ -233,7 +232,7 @@ # <b>RETURN</b> <i>boolean</i> - True if completes without error, otherwise # false. ## - def showUpdates( target ) + def show_updates( target ) end ## @@ -241,7 +240,6 @@ # # <b>RETURN</b> <i>void.</i> ## - def generateHTMLPackageListing - end - + def generate_HTML_package_listing + end end Modified: src/trunk/abtsystemmanager.rb =================================================================== --- src/trunk/abtsystemmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtsystemmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -41,7 +41,7 @@ # <b>RETURN</b> <i>boolean</i> - True if entry found in given directory, # otherwise false. ## - def foundEntry( directory, name ) + def found_entry( directory, name ) Find.find( directory ) do |path| Find.prune if [".", ".."].include? path @@ -75,7 +75,7 @@ # <b>RETURN</b> <i>boolean</i> - True if completes without error, otherwise # false. ## - def cleanupPackageSources + def cleanup_package_sources end ## @@ -84,7 +84,7 @@ # <b>RETURN</b> <i>boolean</i> - True if completes without error, otherwise # false. ## - def cleanupLogs + def cleanup_logs end ## @@ -95,7 +95,7 @@ # <b>RETURN</b> <i>boolean</i> - True if no installed files are missing, # otherwise false. ## - def verifyInstalledFiles( package ) + def verify_installed_files( package ) end ## @@ -106,7 +106,7 @@ # <b>RETURN</b> <i>boolean</i> - True if no symlinks found missing # or broken, otherwise false. ## - def verifySymlinks( package ) + def verify_symlinks( package ) end ## @@ -117,7 +117,7 @@ # <b>RETURN</b> <i>boolean</i> - True if dependencies intact, otherwise # false. ## - def verifyPackageDepends( package ) + def verify_package_depends( package ) end ## @@ -129,7 +129,7 @@ # <b>RETURN</b> <i>hash</i> - Empty hash if no problems found, otherwise # hash of problem files and their encountered errors. ## - def verifyPackageIntegrity( package ) + def verify_package_integrity( package ) end ## @@ -140,7 +140,7 @@ # <b>RETURN</b> <i>boolean</i> - True if completes without error, otherwise # false. ## - def fixPackage( package ) + def fix_package( package ) end ## @@ -151,7 +151,7 @@ # # <b>RETURN</b> <i>boolean</i> - True if the URI is set, otherwise false. ## - def setCentralRepo( uri ) + def set_central_repo( uri ) end ## @@ -163,7 +163,7 @@ # <b>RETURN</b> <i>boolean</i> - True if the package tree location is set, # otherwise false. ## - def setPackageTreeLocation( location ) + def set_package_tree_location( location ) end ## @@ -175,12 +175,12 @@ # <b>RETURN</b> <i>boolean</i> - True if package installed, otherwise # false. ## - def packageInstalled( package ) + def package_installed( package ) require "#{$PACKAGE_PATH}#{package}" sw = eval( "#{package.capitalize}.new" ) details = sw.details - if ( foundEntry( $PACKAGE_INSTALLED, sw.srcDir ) ) + if ( found_entry( $PACKAGE_INSTALLED, sw.srcDir ) ) return true end Modified: src/trunk/abtusage.rb =================================================================== --- src/trunk/abtusage.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/abtusage.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -39,30 +39,30 @@ case section when "packages" - usagePackages + usage_packages when "queries" - usageQueries + usage_queries when "generation" - usageGeneration + usage_generation when "downloads" - usageDownloads + usage_downloads when "fix" - usageFix + usage_fix when "maintenance" - usageMaintenance + usage_maintenance else - usagePackages - usageQueries - usageGeneration - usageDownloads - usageFix - usageMaintenance + usage_packages + usage_queries + usage_generation + usage_downloads + usage_fix + usage_maintenance end end @@ -71,7 +71,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usagePackages + def usage_packages puts "\npackages:" puts " -i, install [package]\t\tInstall given package." puts " -ri, reinstall [package]\t\tReinstall given package." @@ -85,7 +85,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usageQueries + def usage_queries puts "\nqueries:" puts " -s, search [string | regexp ]\tSearch package descriptions for given input." puts " -v, --version\t\t\tShow abt package manager version." @@ -107,7 +107,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usageGeneration + def usage_generation puts "\ngeneration:" puts " show-updates\t\tShow a package listing with available update versions." puts " html\t\t\tGenerate HTML page from installed packages:" @@ -119,7 +119,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usageDownloads + def usage_downloads puts "\ndownloads:" puts " -d, download [package]\t\tRetrieve given package sources." puts " -u, update [package]|[tree]\tUpdate given package or tree from AbTLinux repository." @@ -131,7 +131,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usageFix + def usage_fix puts "\nfix:" puts " purge-src\t\t\t\tRemove source caches for packages no longer installed." puts " purge-logs\t\t\t\tRemove log files for packages no longer installed." @@ -147,7 +147,7 @@ # # <b>RETURN</b> <i>void</i> ## - def usageMaintenance + def usage_maintenance puts "\nmaintenance:" puts " build-location [host]\t\tSets global location (default: localhost) for retrieving cached package builds." puts " package-repo [add|remove|list] [URI]" Modified: src/trunk/testabtdepengine.rb =================================================================== --- src/trunk/testabtdepengine.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtdepengine.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,10 +44,10 @@ end ## - # Test method for 'AbtDepEngine.testDepEngine()' + # Test method for 'AbtDepEngine.test_dep_engine()' ## - def testDepEngine - assert_equal( false, true, "testDepEngine()" ) + def test_dep_engine + assert_equal( false, true, "test_dep_engine()" ) end end Modified: src/trunk/testabtdownloadmanager.rb =================================================================== --- src/trunk/testabtdownloadmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtdownloadmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,39 +44,38 @@ end ## - # Test method for 'AbtDownloadManager.testRetrievePackageSource()' + # Test method for 'AbtDownloadManager.test_retrieve_package_source()' ## - def testRetrievePackageSource() - assert( @download.retrievePackageSource( "ipc", "#{$SOURCES_REPOSITORY}" ), - "testRetrievePackageSource()" ) + def test_retrieve_package_source() + assert( + @download.retrieve_package_source( "ipc", "#{$SOURCES_REPOSITORY}" ), "test_retrieve_package_source()" ) end ## - # Test method for 'AbtDownloadManager.testRetrievePackageTree()' + # Test method for 'AbtDownloadManager.test_retrieve_package_tree()' ## - def testRetrievePackageTree() - assert( @download.retrievePackageTree( "dummy" ), - "testRetrievePackageTree()" ) + def test_retrieve_package_tree() + assert( @download.retrieve_package_tree( "dummy" ), "test_retrieve_package_tree()" ) end ## - # Test method for 'AbtDownloadManager.testRetrieveNewsFeed()' + # Test method for 'AbtDownloadManager.test_retrieve_news_feed()' ## - def testRetrieveNewsFeed() - assert( @download.retrieveNewsFeed( $ABTNEWS ), "testRetrieveNewsFeed()" ) + def test_retrieve_news_feed() + assert( @download.retrieve_news_feed( $ABTNEWS ), "test_retrieve_news_feed()" ) end ## - # Test method for 'AbtDownloadManager.testUpdatePackage()' + # Test method for 'AbtDownloadManager.test_update_package()' ## - def testUpdatePackage() - assert( @download.updatePackage(), "testUpdatePackage()" ) + def test_update_package() + assert( @download.update_package(), "test_update_package()" ) end ## - # Test method for 'AbtDownloadManager.testUpdatePackageTree()' + # Test method for 'AbtDownloadManager.test_update_package_tree()' ## - def testUpdatePackageTree() - assert( @download.updatePackageTree(), "testUpdatePackageTree()" ) + def test_update_package_tree() + assert( @download.update_package_tree(), "test_update_package_tree()" ) end end Modified: src/trunk/testabtlogmanager.rb =================================================================== --- src/trunk/testabtlogmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtlogmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,39 +44,38 @@ end ## - # Test method for 'AbtLogManager.testLogPackageIntegrity()' + # Test method for 'AbtLogManager.test_log_package_integrity()' ## - def testLogPackageIntegrity() - assert( @log.logPackageIntegrity( "ipc" ), "testLogPackageIntegrity()" ) + def test_log_package_integrity() + assert( @log.log_package_integrity( "ipc" ), "test_log_package_integrity()" ) end ## - # Test method for 'AbtLogManager.testLogPackageInstall()' + # Test method for 'AbtLogManager.test_log_package_install()' ## - def testLogPackageInstall() - assert( @log.logPackageInstall( "ipc" ), "testLogPackageInstall()" ) + def test_log_package_install() + assert( @log.log_package_install( "ipc" ), "test_log_package_install()" ) end ## - # Test method for 'AbtLogManager.testLogPackageBuild()' + # Test method for 'AbtLogManager.test_log_package_build()' ## - def testLogPackageBuild() - assert( @log.logPackageBuild( "ipc" ), "testLogPackageBuild()" ) + def test_log_package_build() + assert( @log.log_package_build( "ipc" ), "test_log_package_build()" ) end ## - # Test method for 'AbtLogManager.testCachePackage()' + # Test method for 'AbtLogManager.test_cache_package()' ## - def testCachePackage() - assert( @log.cachePackage( "ipc" ), "testCachePackage()" ) + def test_cache_package() + assert( @log.cache_package( "ipc" ), "test_cache_package()" ) end ## - # Test method for 'AbtLogManager.testLogToJournal()' + # Test method for 'AbtLogManager.test_to_journal()' ## - def testLogToJournal() - assert( @log.logToJournal( "Test message from AbtTestSuite." ), - "testLogToJournal()" ) + def test_to_journal() + assert( @log.to_journal( "Test message from AbtTestSuite." ), "test_to_journal()" ) end end Modified: src/trunk/testabtpackage.rb =================================================================== --- src/trunk/testabtpackage.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtpackage.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -58,88 +58,83 @@ end ## - # Test method for 'AbtPackage.testDetails()' + # Test method for 'AbtPackage.test_details()' ## - def testDetails - assert_equal( $dataTest['name'], @ipc.details['Package name'], - "testDetails()" ) - assert_equal( $dataTest['execName'], @ipc.details['Executable'], - "testDetails()" ) - assert_equal( $dataTest['version'], @ipc.details['Version'], - "testDetails()" ) - assert_equal( $dataTest['srcDir'], @ipc.details['Source location'], - "testDetails()" ) - assert_equal( $dataTest['homepage'], @ipc.details['Homepage'], - "testDetails()" ) + def test_details + assert_equal( $dataTest['name'], @ipc.details['Package name'], "test_details(name)" ) + assert_equal( $dataTest['execName'], @ipc.details['Executable'], "test_details(execName)" ) + assert_equal( $dataTest['version'], @ipc.details['Version'], "test_details(version)" ) + assert_equal( $dataTest['srcDir'], @ipc.details['Source location'], "test_details(srcDir)" ) + assert_equal( $dataTest['homepage'], @ipc.details['Homepage'], "test_details(homepage)" ) end ## - # Test method for 'AbtPackage.testPre()' + # Test method for 'AbtPackage.test_pre()' ## - def testPre - assert( @ipc.pre( $verbose ), "testPre()" ) + def test_pre + assert( @ipc.pre( $verbose ), "test_pre()" ) end ## - # Test method for 'AbtPackage.testConfigure()' + # Test method for 'AbtPackage.test_configure()' ## - def testConfigure + def test_configure if ( !@ipc.pre( $verbose ) ) - assert_equals( true, false, "testConfigure()" ) + assert_equals( true, false, "test_configure(pre)" ) end - assert( @ipc.configure( $verbose ), "testConfigure()" ) + assert( @ipc.configure( $verbose ), "test_configure(configure)" ) end ## - # Test method for 'AbtPackage.testBuild()' + # Test method for 'AbtPackage.test_build()' ## - def testBuild + def test_build if ( !@ipc.pre( $verbose ) ) - assert_equals( true, false, "testBuild()" ) + assert_equals( true, false, "test_build(pre)" ) end if ( !@ipc.configure( $verbose ) ) - assert_equals( true, false, "testBuild()" ) + assert_equals( true, false, "test_build(configure)" ) end - assert( @ipc.build( $verbose ), "testBuild()" ) + assert( @ipc.build( $verbose ), "test_build(build)" ) end ## - # Test method for 'AbtPackage.testPreinstall()' + # Test method for 'AbtPackage.test_preinstall()' ## - def testPreinstall - assert( @ipc.preinstall( $verbose ), "testPreinstall()" ) + def test_preinstall + assert( @ipc.preinstall( $verbose ), "test_preinstall()" ) end ## - # Test method for 'AbtPackage.testInstall()' + # Test method for 'AbtPackage.test_install()' ## - def testInstall + def test_install if ( !@ipc.pre( $verbose ) ) - assert_equals( true, false, "testInstall()" ) + assert_equals( true, false, "test_install(pre)" ) end if ( !@ipc.configure( $verbose ) ) - assert_equals( true, false, "testInstall()" ) + assert_equals( true, false, "test_install(configure)" ) end if ( !@ipc.build( $verbose ) ) - assert_equals( true, false, "testInstall()" ) + assert_equals( true, false, "test_install(build)" ) end if ( !@ipc.preinstall( $verbose ) ) - assert_equals( true, false, "testInstall()" ) + assert_equals( true, false, "test_install(install)" ) end - assert( @ipc.install( $verbose ), "testInstall()" ) + assert( @ipc.install( $verbose ), "test_install(install)" ) end ## - # Test method for 'AbtPackage.testPost()' + # Test method for 'AbtPackage.test_post()' ## - def testPost - assert_equals( true, false, "testPost()" ) if ( !@ipc.pre( $verbose ) ) - assert_equals( true, false, "testPost()" ) if ( !@ipc.configure( $verbose ) ) - assert_equals( true, false, "testPost()" ) if ( !@ipc.build( $verbose ) ) - assert_equals( true, false, "testPost()" ) if ( !@ipc.preinstall( $verbose ) ) - assert_equals( true, false, "testPost()" ) if ( !@ipc.install( $verbose ) ) - assert( @ipc.post( $verbose ), "testPost()" ) + def test_post + assert_equals( true, false, "test_post(pre)" ) if ( !@ipc.pre( $verbose ) ) + assert_equals( true, false, "test_post(configure)" ) if ( !@ipc.configure( $verbose ) ) + assert_equals( true, false, "test_post(build)" ) if ( !@ipc.build( $verbose ) ) + assert_equals( true, false, "test_post(preinstall)" ) if ( !@ipc.preinstall( $verbose ) ) + assert_equals( true, false, "test_post(install)" ) if ( !@ipc.install( $verbose ) ) + assert( @ipc.post( $verbose ), "test_post(post)" ) end end Modified: src/trunk/testabtpackagemanager.rb =================================================================== --- src/trunk/testabtpackagemanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtpackagemanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -46,38 +46,38 @@ end ## - # Test method for 'AbtPackageManager.testInstallPackage()' + # Test method for 'AbtPackageManager.test_install_package()' ## - def testInstallPackage - assert( @pkgMgr.installPackage( "ipc", $verbose ), "testInstallPackage()" ) + def test_install_package + assert( @pkgMgr.install_package( "ipc", $verbose ), "test_install_package()" ) end ## - # Test method for 'AbtPackageManager.testReinstallPackage()' + # Test method for 'AbtPackageManager.test_reinstall_package()' ## - def testReinstallPackage - assert( @pkgMgr.reinstallPackage( "ipc" ), "testReinstallPackage()" ) + def test_reinstall_package + assert( @pkgMgr.reinstall_package( "ipc" ), "test_reinstall_package()" ) end ## - # Test method for 'AbtPackageManager.testRemovePackage()' + # Test method for 'AbtPackageManager.test_remove_package()' ## - def testRemovePackage - assert( @pkgMgr.removePackage( "ipc" ), "testRemovePackage()" ) + def test_remove_package + assert( @pkgMgr.remove_package( "ipc" ), "test_remove_package()" ) end ## - # Test method for 'AbtPackageManager.testDowngradePackage()' + # Test method for 'AbtPackageManager.test_downgrade_package()' ## - def testDowngradePackage - assert( @pkgMgr.downgradePackage( "ipc", "1.2" ), "testDowngradePackage()" ) + def test_downgrade_package + assert( @pkgMgr.downgrade_package( "ipc", "1.2" ), "test_downgrade_package()" ) end ## - # Test method for 'AbtPackageManager.testFreezePackage()' + # Test method for 'AbtPackageManager.test_freeze_package()' ## - def testFreezePackage - assert( @pkgMgr.freezePackage( "ipc" ), "testFreezePackage()" ) + def test_freeze_package + assert( @pkgMgr.freeze_package( "ipc" ), "test_freeze_package()" ) end end Modified: src/trunk/testabtqueuemanager.rb =================================================================== --- src/trunk/testabtqueuemanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtqueuemanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,11 +44,10 @@ end ## - # Test method for 'AbtQueueManager.actionPackageQueue()' + # Test method for 'AbtQueueManager.action_package_queue()' ## - def testActionPackageQueue - assert( @queue.actionPackageQueue( "ipc", "install", "add" ), - "testQueueManager()" ) + def test_action_package_queue + assert( @queue.action_package_queue( "ipc", "install", "add" ), "test_action_package_queue()" ) end end Modified: src/trunk/testabtreportmanager.rb =================================================================== --- src/trunk/testabtreportmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtreportmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,97 +44,93 @@ end ## - # Test method for 'AbtReportManager.testShowPackageDetails()' + # Test method for 'AbtReportManager.test_show_package_details()' ## - def testShowPackageDetails - assert( @report.showPackageDetails( "ipc" ), "testShowPackageDetails()" ) + def test_show_package_details + assert( @report.show_package_details( "ipc" ), "test_show_package_details()" ) end ## - # Test method for 'AbtReportManager.testShowInstalledPackages()' + # Test method for 'AbtReportManager.test_show_installed_packages()' ## - def testShowInstalledPackages - assert( @report.showInstalledPackages(), "testShowInstalledPackages()" ) + def test_show_installed_packages + assert( @report.show_installed_packages(), "test_show_installed_packages()" ) end ## - # Test method for 'AbtReportManager.testShowPackageLog()' + # Test method for 'AbtReportManager.test_show_package_log()' ## - def testShowPackageLog - assert( @report.showPackageLog( "ipc", "install" ), - "testShowPackageLog()" ) - assert( @report.showPackageLog( "ipc", "build" ), "testShowPackageLog()" ) - assert( @report.showPackageLog( "ipc", "integrity" ), - "testShowPackageLog()" ) + def test_show_package_log + assert( @report.show_package_log( "ipc", "install" ), "test_show_package_log(install)" ) + assert( @report.show_package_log( "ipc", "build" ), "test_show_package_log(build)" ) + assert( @report.show_package_log( "ipc", "integrity" ), "test_show_package_log(integrity)" ) end ## - # Test method for 'AbtReportManager.testShowFrozenPackages()' + # Test method for 'AbtReportManager.test_show_frozen_packages()' ## - def testShowFrozenPackages - assert( @report.showFrozenPackages(), "testShowFrozenPackages()" ) + def test_show_frozen_packages + assert( @report.show_frozen_packages(), "test_show_frozen_packages()" ) end ## - # Test method for 'AbtReportManager.testShowPackageDependencies()' + # Test method for 'AbtReportManager.test_show_package_dependencies()' ## - def testShowPackageDependencies - assert( false, "testShowPackageDependencies()" ) + def test_show_package_dependencies + assert( false, "test_show_package_dependencies()" ) end ## - # Test method for 'AbtReportManager.testShowUntrackedFiles()' + # Test method for 'AbtReportManager.test_show_untracked_files()' ## - def testShowUntrackedFiles - assert( @report.showUntrackedFiles(), "testShowUntrackedFiles()" ) + def test_show_untracked_files + assert( @report.show_untracked_files(), "test_show_untracked_files()" ) end ## - # Test method for 'AbtReportManager.testShowJournal()' + # Test method for 'AbtReportManager.test_show_journal()' ## - def testShowJournal - assert( @report.showJournal( $JOURNAL ), "testShowJournal()" ) + def test_show_journal + assert( @report.show_journal( $JOURNAL ), "test_show_journal()" ) end ## - # Test method for 'AbtReportManager.testShowFileOwner()' + # Test method for 'AbtReportManager.test_show_file_owner()' ## - def testShowFileOwner - assert( @report.showFileOwner( "ipcFile" ), "testShowFileOwner()" ) + def test_show_file_owner + assert( @report.show_file_owner( "ipcFile" ), "test_show_file_owner()" ) end ## - # Test method for 'AbtReportManager.testSearchPackageDescriptions()' + # Test method for 'AbtReportManager.test_search_package_descriptions()' ## - def testSearchPackageDescriptions - assert( @report.searchPackageDescriptions( "Special text" ), - "testSearchPackageDescriptions()" ) + def test_search_package_descriptions + assert( @report.search_package_descriptions( "Special text" ), "test_search_package_descriptions()" ) end ## - # Test method for 'AbtReportManager.testShowQueue()' + # Test method for 'AbtReportManager.test_show_queue()' ## - def testShowQueue - if ( @report.showQueue( "install" ) ) - assert(false, "testShowQueue()") + def test_show_queue + if ( @report.show_queue( "install" ) ) + assert(false, "test_show_queue()") else - assert(true, "testShowQueue()") + assert(true, "test_show_queue()") end end ## - # Test method for 'AbtReportManager.testShowUpdates()' + # Test method for 'AbtReportManager.test_show_updates()' ## - def testShowUpdates - assert( @report.showUpdates( "ipc" ), "testShowUpdates()" ) + def test_show_updates + assert( @report.show_updates( "ipc" ), "test_show_updates()" ) end ## - # Test method for 'AbtReportManager.testGenerateHTMLPackageListing()' + # Test method for 'AbtReportManager.test_generate_HTML_package_listing()' ## - def testGenerateHTMLPackageListing - assert( @report.generateHTMLPackageListing(), - "testGenerateHTMLPackageListing()" ) + def test_generate_HTML_package_listing + assert( @report.generate_HTML_package_listing(), "test_generate_HTML_package_listing()" ) end end Modified: src/trunk/testabtsystemmanager.rb =================================================================== --- src/trunk/testabtsystemmanager.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testabtsystemmanager.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -44,75 +44,73 @@ end ## - # Test method for 'AbtSystemManager.testCleanupPackageSources()' + # Test method for 'AbtSystemManager.test_cleanup_package_sources()' ## - def testCleanupPackageSources - assert( @sys.cleanupPackageSources(), "testCleanupPackageSources()" ) + def test_cleanup_package_sources + assert( @sys.cleanup_package_sources(), "test_cleanup_package_sources()" ) end ## - # Test method for 'AbtSystemManager.testCleanupLogs()' + # Test method for 'AbtSystemManager.test_cleanup_logs()' ## - def testCleanupLogs - assert( @sys.cleanupLogs(), "testCleanupLogs()" ) + def test_cleanup_logs + assert( @sys.cleanup_logs(), "test_cleanup_logs()" ) end ## - # Test method for 'AbtSystemManager.testVerifyInstalledFiles()' + # Test method for 'AbtSystemManager.test_verify_installed_files()' ## - def testVerifyInstalledFiles - assert( @sys.verifyInstalledFiles( "dummy" ), "testVerifyInstalledFiles()" ) + def test_verify_installed_files + assert( @sys.verify_installed_files( "dummy" ), "test_verify_installed_files()" ) end ## - # Test method for 'AbtSystemManager.testVerifySymlinks()' + # Test method for 'AbtSystemManager.test_verify_symlinks()' ## - def testVerifySymlinks - assert( @sys.verifySymlinks( "dummy" ), "testVerifySymlinks()" ) + def test_verify_symlinks + assert( @sys.verify_symlinks( "dummy" ), "test_verify_symlinks()" ) end ## - # Test method for 'AbtSystemManager.testVerifyPackageDepends()' + # Test method for 'AbtSystemManager.test_verify_package_depends()' ## - def testVerifyPackageDepends - assert( @sys.verifyPackageDepends( "dummy" ), "testVerifyPackageDepends()" ) + def test_verify_package_depends + assert( @sys.verify_package_depends( "dummy" ), "test_verify_package_depends()" ) end ## - # Test method for 'AbtSystemManager.testVerifyPackageIntegrity()' + # Test method for 'AbtSystemManager.test_verify_package_integrity()' ## - def testVerifyPackageIntegrity - assert( @sys.verifyPackageIntegrity( "dummy" ), - "testVerifyPackageIntegrity()" ) + def test_verify_package_integrity + assert( @sys.verify_package_integrity( "dummy" ), "test_verify_package_integrity()" ) end ## - # Test method for 'AbtSystemManager.testFixPackage()' + # Test method for 'AbtSystemManager.test_fix_package()' ## - def testFixPackage - assert( @sys.fixPackage( "dummy" ), "testFixPackage()" ) + def test_fix_package + assert( @sys.fix_package( "dummy" ), "test_fix_package()" ) end ## - # Test method for 'AbtSystemManager.testSetCentralRepo()' + # Test method for 'AbtSystemManager.test_set_central_repo()' ## - def testSetCentralRepo - assert( @sys.setCentralRepo( "http://localhost" ), "testSetCentralRepo()" ) + def test_set_central_repo + assert( @sys.set_central_repo( "http://localhost" ), "test_set_central_repo()" ) end ## - # Test method for 'AbtSystemManager.testSetPackageTreeLocation()' + # Test method for 'AbtSystemManager.test_set_package_tree_location()' ## - def testSetPackageTreeLocation - assert( @sys.setPackageTreeLocation( "/var/lib/ericsPackages" ), - "testSetPackageTreeLocation()" ) + def test_set_package_tree_location + assert( @sys.set_package_tree_location( "/var/lib/ericsPackages" ), "test_set_package_tree_location()" ) end ## - # Test method for 'AbtSystemManager.testPackageInstalled()' + # Test method for 'AbtSystemManager.test_package_installed()' ## - def testPackageInstalled - assert( @sys.packageInstalled( "ipc" ), "testPackageInstalled()" ) + def test_package_installed + assert( @sys.package_installed( "ipc" ), "test_package_installed()" ) end end Modified: src/trunk/testsuiteabt.rb =================================================================== --- src/trunk/testsuiteabt.rb 2007-07-16 14:28:21 UTC (rev 366) +++ src/trunk/testsuiteabt.rb 2007-07-16 20:22:31 UTC (rev 367) @@ -21,8 +21,8 @@ logger = AbtLogManager.new manager = AbtPackageManager.new system = AbtSystemManager.new -if !system.packageInstalled( "ipc" ) - manager.installPackage << "ipc" +if !system.package_installed( "ipc" ) + manager.install_package << "ipc" end require 'testabtpackagemanager' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-16 14:28:18
|
Revision: 366 http://svn.sourceforge.net/abtlinux/?rev=366&view=rev Author: eschabell Date: 2007-07-16 07:28:21 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Refactored to only run installation if needed. Modified Paths: -------------- src/trunk/testsuiteabt.rb Modified: src/trunk/testsuiteabt.rb =================================================================== --- src/trunk/testsuiteabt.rb 2007-07-16 13:53:25 UTC (rev 365) +++ src/trunk/testsuiteabt.rb 2007-07-16 14:28:21 UTC (rev 366) @@ -2,7 +2,7 @@ if ( Process.uid != 0 ) puts "Enter root password:" - system( 'su -c ./testSuiteAbt.rb root' ) + system( 'su -c ./testsuiteabt.rb root' ) exit end @@ -18,9 +18,12 @@ # This speeds up the test suit by more than 10 sec # on my machine. I get avg runs of around 17,5 sec. # -logger = AbtLogManager.new +logger = AbtLogManager.new manager = AbtPackageManager.new -manager.installPackage( "ipc" ) +system = AbtSystemManager.new +if !system.packageInstalled( "ipc" ) + manager.installPackage << "ipc" +end require 'testabtpackagemanager' require 'testabtlogmanager' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-16 13:53:22
|
Revision: 365 http://svn.sourceforge.net/abtlinux/?rev=365&view=rev Author: eschabell Date: 2007-07-16 06:53:25 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Updated to reflect correct requires file names. Modified Paths: -------------- src/trunk/packages/fortune.rb src/trunk/packages/ipc.rb Modified: src/trunk/packages/fortune.rb =================================================================== --- src/trunk/packages/fortune.rb 2007-07-16 13:51:57 UTC (rev 364) +++ src/trunk/packages/fortune.rb 2007-07-16 13:53:25 UTC (rev 365) @@ -1,11 +1,11 @@ #!/usr/bin/ruby -w -require "AbtPackage" +require "abtpackage" ## # fortune.rb # -# AbtFortune package. +# Fortune package. # # Created by Eric D. Schabell <er...@ab...> # Copyright 2006, GPL. Modified: src/trunk/packages/ipc.rb =================================================================== --- src/trunk/packages/ipc.rb 2007-07-16 13:51:57 UTC (rev 364) +++ src/trunk/packages/ipc.rb 2007-07-16 13:53:25 UTC (rev 365) @@ -5,7 +5,7 @@ ## # ipc.rb # -# AbtFortune package. +# Ipc package. # # Created by Eric D. Schabell <er...@ab...> # Copyright 2006, GPL. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-16 13:51:56
|
Revision: 364 http://svn.sourceforge.net/abtlinux/?rev=364&view=rev Author: eschabell Date: 2007-07-16 06:51:57 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Generated new docs. Modified Paths: -------------- src/trunk/doc/classes/AbtDepEngine.html src/trunk/doc/classes/AbtDownloadManager.html src/trunk/doc/classes/AbtLogManager.html src/trunk/doc/classes/AbtPackage.html src/trunk/doc/classes/AbtPackageManager.html src/trunk/doc/classes/AbtQueueManager.html src/trunk/doc/classes/AbtReportManager.html src/trunk/doc/classes/AbtSystemManager.html src/trunk/doc/classes/AbtUsage.html src/trunk/doc/classes/TestAbtDepEngine.html src/trunk/doc/classes/TestAbtDownloadManager.html src/trunk/doc/classes/TestAbtLogManager.html src/trunk/doc/classes/TestAbtPackage.html src/trunk/doc/classes/TestAbtPackageManager.html src/trunk/doc/classes/TestAbtQueueManager.html src/trunk/doc/classes/TestAbtReportManager.html src/trunk/doc/classes/TestAbtSystemManager.html src/trunk/doc/created.rid src/trunk/doc/dot/f_0.dot src/trunk/doc/dot/f_0.png src/trunk/doc/dot/f_1.dot src/trunk/doc/dot/f_1.png src/trunk/doc/dot/f_10.dot src/trunk/doc/dot/f_10.png src/trunk/doc/dot/f_11.dot src/trunk/doc/dot/f_11.png src/trunk/doc/dot/f_12.dot src/trunk/doc/dot/f_12.png src/trunk/doc/dot/f_13.dot src/trunk/doc/dot/f_13.png src/trunk/doc/dot/f_14.dot src/trunk/doc/dot/f_14.png src/trunk/doc/dot/f_15.dot src/trunk/doc/dot/f_15.png src/trunk/doc/dot/f_16.dot src/trunk/doc/dot/f_16.png src/trunk/doc/dot/f_2.dot src/trunk/doc/dot/f_2.png src/trunk/doc/dot/f_3.dot src/trunk/doc/dot/f_3.png src/trunk/doc/dot/f_4.dot src/trunk/doc/dot/f_4.png src/trunk/doc/dot/f_5.dot src/trunk/doc/dot/f_5.png src/trunk/doc/dot/f_6.dot src/trunk/doc/dot/f_6.png src/trunk/doc/dot/f_7.dot src/trunk/doc/dot/f_7.png src/trunk/doc/dot/f_8.dot src/trunk/doc/dot/f_8.png src/trunk/doc/dot/f_9.dot src/trunk/doc/dot/f_9.png src/trunk/doc/fr_file_index.html src/trunk/doc/fr_method_index.html Added Paths: ----------- src/trunk/doc/files/abtdepengine_rb.html src/trunk/doc/files/abtdownloadmanager_rb.html src/trunk/doc/files/abtlogmanager_rb.html src/trunk/doc/files/abtpackage_rb.html src/trunk/doc/files/abtpackagemanager_rb.html src/trunk/doc/files/abtqueuemanager_rb.html src/trunk/doc/files/abtreportmanager_rb.html src/trunk/doc/files/abtsystemmanager_rb.html src/trunk/doc/files/abtusage_rb.html src/trunk/doc/files/testabtdepengine_rb.html src/trunk/doc/files/testabtdownloadmanager_rb.html src/trunk/doc/files/testabtlogmanager_rb.html src/trunk/doc/files/testabtpackage_rb.html src/trunk/doc/files/testabtpackagemanager_rb.html src/trunk/doc/files/testabtqueuemanager_rb.html src/trunk/doc/files/testabtreportmanager_rb.html src/trunk/doc/files/testabtsystemmanager_rb.html Removed Paths: ------------- src/trunk/doc/files/AbtDepEngine_rb.html src/trunk/doc/files/AbtDownloadManager_rb.html src/trunk/doc/files/AbtLogManager_rb.html src/trunk/doc/files/AbtPackageManager_rb.html src/trunk/doc/files/AbtPackage_rb.html src/trunk/doc/files/AbtQueueManager_rb.html src/trunk/doc/files/AbtReportManager_rb.html src/trunk/doc/files/AbtSystemManager_rb.html src/trunk/doc/files/AbtUsage_rb.html src/trunk/doc/files/TestAbtDepEngine_rb.html src/trunk/doc/files/TestAbtDownloadManager_rb.html src/trunk/doc/files/TestAbtLogManager_rb.html src/trunk/doc/files/TestAbtPackageManager_rb.html src/trunk/doc/files/TestAbtPackage_rb.html src/trunk/doc/files/TestAbtQueueManager_rb.html src/trunk/doc/files/TestAbtReportManager_rb.html src/trunk/doc/files/TestAbtSystemManager_rb.html Modified: src/trunk/doc/classes/AbtDepEngine.html =================================================================== --- src/trunk/doc/classes/AbtDepEngine.html 2007-07-16 13:34:14 UTC (rev 363) +++ src/trunk/doc/classes/AbtDepEngine.html 2007-07-16 13:51:57 UTC (rev 364) @@ -57,7 +57,7 @@ <tr valign="top"> <td>In:</td> <td> -<a href="../files/AbtDepEngine_rb.html">AbtDepEngine.rb</a> +<a href="../files/abtdepengine_rb.html">abtdepengine.rb</a> </td> </tr> <tr> @@ -78,15 +78,15 @@ <map id="map" name="map"> <area shape="rect" coords="27,50,133,98" href="AbtDepEngine.html" alt="AbtDepEngine" /> </map> -<img src="../dot/f_0.png" usemap="#map" border="0" alt="TopLevel" /> +<img src="../dot/f_0.png" usemap="#map" border="0" alt="dot/f_0.png"> </td></tr></table> <div class="description"><p> -AbtDepEngine.rb +abtdepengine.rb </p> <p> <a href="AbtDepEngine.html">AbtDepEngine</a> class handles all dependency -aspects of the AbTLinux system. It is part of a sub-project with it’s +aspects of the AbTLinux system. It is part of a sub-project with it‘s own requirements document. </p> <p> @@ -118,7 +118,7 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000091">new</a></li> + <li><a href="#M000093">new</a></li> </ul> @@ -129,7 +129,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000091"></a><b>new</b>() + <a name="M000093"></a><b>new</b>() </div> <div class="description"> <p> @@ -141,10 +141,10 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000091_source')" id="l_M000091_source">show source</a> ]</p> - <div id="M000091_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000093_source')" id="l_M000093_source">show source</a> ]</p> + <div id="M000093_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDepEngine.rb, line 41</span> + <span class="ruby-comment cmt"># File abtdepengine.rb, line 41</span> 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> 42: <span class="ruby-keyword kw">end</span> </pre> Modified: src/trunk/doc/classes/AbtDownloadManager.html =================================================================== --- src/trunk/doc/classes/AbtDownloadManager.html 2007-07-16 13:34:14 UTC (rev 363) +++ src/trunk/doc/classes/AbtDownloadManager.html 2007-07-16 13:51:57 UTC (rev 364) @@ -57,7 +57,7 @@ <tr valign="top"> <td>In:</td> <td> -<a href="../files/AbtDownloadManager_rb.html">AbtDownloadManager.rb</a> +<a href="../files/abtdownloadmanager_rb.html">abtdownloadmanager.rb</a> </td> </tr> <tr> @@ -78,11 +78,11 @@ <map id="map" name="map"> <area shape="rect" coords="27,50,176,98" href="AbtDownloadManager.html" alt="AbtDownloadManager" /> </map> -<img src="../dot/f_1.png" usemap="#map" border="0" alt="TopLevel" /> +<img src="../dot/f_1.png" usemap="#map" border="0" alt="dot/f_1.png"> </td></tr></table> <div class="description"><p> -AbtDownloadManager.rb +abtdownloadmanager.rb </p> <p> <a href="AbtDownloadManager.html">AbtDownloadManager</a> class handles all @@ -117,12 +117,12 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000011">new</a></li> - <li><a href="#M000014">retrieveNewsFeed</a></li> - <li><a href="#M000012">retrievePackageSource</a></li> - <li><a href="#M000013">retrievePackageTree</a></li> - <li><a href="#M000015">updatePackage</a></li> - <li><a href="#M000016">updatePackageTree</a></li> + <li><a href="#M000012">new</a></li> + <li><a href="#M000015">retrieveNewsFeed</a></li> + <li><a href="#M000013">retrievePackageSource</a></li> + <li><a href="#M000014">retrievePackageTree</a></li> + <li><a href="#M000016">updatePackage</a></li> + <li><a href="#M000017">updatePackageTree</a></li> </ul> @@ -133,7 +133,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000011"></a><b>new</b>() + <a name="M000012"></a><b>new</b>() </div> <div class="description"> <p> @@ -147,10 +147,10 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p> - <div id="M000011_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p> + <div id="M000012_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 42</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 42</span> 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> 43: <span class="ruby-keyword kw">end</span> </pre> @@ -160,7 +160,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000014"></a><b>retrieveNewsFeed</b>( uri, cleanLog = "false" ) + <a name="M000015"></a><b>retrieveNewsFeed</b>( uri, cleanLog=true ) </div> <div class="description"> <p> @@ -168,71 +168,70 @@ </p> <p> <b>PARAM</b> <em>String</em> - the uri of the rss news feed to be -retrieved. <b>PARAM</b> <em>String</em> - pass the value ‘true’ -to empty the log file, otherwise it will be appended. <b>RETURN</b> +retrieved. <b>PARAM</b> <em>boolean</em> - default is to emplty the log +file, passing ‘false’ will append to news file. <b>RETURN</b> <em>boolean</em> - True if the AbTLinux news feed has been retrieved, otherwise false. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show source</a> ]</p> - <div id="M000014_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show source</a> ]</p> + <div id="M000015_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 97</span> - 97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieveNewsFeed</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">cleanLog</span> = <span class="ruby-value str">"false"</span> ) - 98: <span class="ruby-identifier">require</span> <span class="ruby-value str">'net/http'</span> - 99: <span class="ruby-identifier">require</span> <span class="ruby-value str">'uri'</span> -100: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rss/1.0'</span> -101: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rss/2.0'</span> -102: <span class="ruby-identifier">newsLog</span> = <span class="ruby-value str">""</span> -103: -104: <span class="ruby-comment cmt"># ensure we have our news logfile.</span> -105: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">cleanLog</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"true"</span> ) -106: <span class="ruby-identifier">newsLog</span> = -107: <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$ABTNEWS_LOG</span>, <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">WRONLY</span><span class="ruby-operator">|</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">TRUNC</span><span class="ruby-operator">|</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">CREAT</span>, <span class="ruby-value">644</span> ) -108: <span class="ruby-keyword kw">else</span> -109: <span class="ruby-identifier">newsLog</span> = -110: <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$ABTNEWS_LOG</span>, <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">WRONLY</span><span class="ruby-operator">|</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">APPEND</span><span class="ruby-operator">|</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">CREAT</span>, <span class="ruby-value">644</span> ) -111: <span class="ruby-keyword kw">end</span> -112: -113: <span class="ruby-comment cmt"># pick up the abtlinux.org news feed.</span> -114: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">news</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">get</span>( <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">uri</span> ) ) ) -115: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to retrieve news feed #{uri}."</span> ) -116: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -117: <span class="ruby-keyword kw">end</span> -118: -119: <span class="ruby-comment cmt"># display the feeds.</span> -120: <span class="ruby-identifier">rss</span> = <span class="ruby-keyword kw">nil</span> -121: <span class="ruby-keyword kw">begin</span> -122: <span class="ruby-identifier">rss</span> = <span class="ruby-constant">RSS</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">news</span>, <span class="ruby-keyword kw">false</span>) -123: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">RSS</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> -124: <span class="ruby-keyword kw">end</span> -125: -126: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">rss</span>.<span class="ruby-identifier">nil?</span> ) -127: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to display news feed as feed #{uri} "</span> <span class="ruby-operator">+</span> -128: <span class="ruby-value str">"is not RSS 1.0/2.0."</span> ) -129: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -130: <span class="ruby-keyword kw">else</span> -131: <span class="ruby-identifier">newsLog</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"*** #{rss.channel.title} ***"</span> -132: -133: <span class="ruby-identifier">rss</span>.<span class="ruby-identifier">items</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">itemCount</span><span class="ruby-operator">|</span> -134: <span class="ruby-identifier">itemCount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> -135: <span class="ruby-identifier">newsLog</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{itemCount} #{item.link} #{item.title}"</span> -136: <span class="ruby-keyword kw">end</span> -137: <span class="ruby-keyword kw">end</span> -138: -139: <span class="ruby-identifier">newsLog</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\n"</span> -140: <span class="ruby-identifier">newsLog</span>.<span class="ruby-identifier">close</span> -141: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -142: -143: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 95</span> + 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrieveNewsFeed</span>( <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">cleanLog</span>=<span class="ruby-keyword kw">true</span> ) + 96: <span class="ruby-identifier">require</span> <span class="ruby-value str">'net/http'</span> + 97: <span class="ruby-identifier">require</span> <span class="ruby-value str">'uri'</span> + 98: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rss/1.0'</span> + 99: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rss/2.0'</span> +100: <span class="ruby-identifier">newsLog</span> = <span class="ruby-value str">""</span> +101: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> +102: +103: <span class="ruby-comment cmt"># ensure we have our news logfile.</span> +104: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">cleanLog</span> ) +105: <span class="ruby-identifier">newsLog</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$ABTNEWS_LOG</span>, <span class="ruby-value str">"w+"</span> ) +106: <span class="ruby-keyword kw">else</span> +107: <span class="ruby-identifier">newsLog</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">$ABTNEWS_LOG</span>, <span class="ruby-value str">"a+"</span> ) +108: <span class="ruby-keyword kw">end</span> +109: +110: <span class="ruby-comment cmt"># pick up the abtlinux.org news feed.</span> +111: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">news</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">get</span>( <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>( <span class="ruby-identifier">uri</span> ) ) ) +112: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to retrieve news feed #{uri}."</span> ) +113: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +114: <span class="ruby-keyword kw">end</span> +115: +116: <span class="ruby-comment cmt"># display the feeds.</span> +117: <span class="ruby-identifier">rss</span> = <span class="ruby-keyword kw">nil</span> +118: <span class="ruby-keyword kw">begin</span> +119: <span class="ruby-identifier">rss</span> = <span class="ruby-constant">RSS</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">news</span>, <span class="ruby-keyword kw">false</span>) +120: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">RSS</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> +121: <span class="ruby-keyword kw">end</span> +122: +123: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">rss</span>.<span class="ruby-identifier">nil?</span> ) +124: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Failed to display news feed as feed #{uri} "</span> <span class="ruby-operator">+</span> +125: <span class="ruby-value str">"is not RSS 1.0/2.0."</span> ) +126: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +127: <span class="ruby-keyword kw">else</span> +128: <span class="ruby-identifier">newsLog</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"*** #{rss.channel.title} ***\n"</span> +129: +130: <span class="ruby-identifier">rss</span>.<span class="ruby-identifier">items</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">itemCount</span><span class="ruby-operator">|</span> +131: <span class="ruby-identifier">itemCount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> +132: <span class="ruby-identifier">newsLog</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{itemCount} #{item.link} #{item.title}\n"</span> +133: <span class="ruby-keyword kw">end</span> +134: <span class="ruby-keyword kw">end</span> +135: +136: <span class="ruby-identifier">newsLog</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n\n"</span> +137: <span class="ruby-identifier">newsLog</span>.<span class="ruby-identifier">close</span> +138: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +139: +140: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000012"></a><b>retrievePackageSource</b>( packageName, destination ) + <a name="M000013"></a><b>retrievePackageSource</b>( packageName, destination ) </div> <div class="description"> <p> @@ -250,37 +249,35 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p> - <div id="M000012_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p> + <div id="M000013_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 56</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 56</span> 56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrievePackageSource</span>( <span class="ruby-identifier">packageName</span>, <span class="ruby-identifier">destination</span> ) -57: <span class="ruby-identifier">require</span> <span class="ruby-identifier">packageName</span> +57: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{$PACKAGE_PATH}#{packageName}"</span> 58: <span class="ruby-identifier">logger</span> = <span class="ruby-constant">AbtLogManager</span>.<span class="ruby-identifier">new</span> 59: <span class="ruby-identifier">package</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-identifier">packageName</span>.<span class="ruby-identifier">capitalize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.new'</span> ) 60: -61: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( -62: <span class="ruby-identifier">destination</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">package</span>.<span class="ruby-identifier">srcUrl</span> ) ) ) -63: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-value str">"Download not needed, existing source "</span> <span class="ruby-operator">+</span> -64: <span class="ruby-value str">"found for "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">packageName</span> ) -65: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -66: <span class="ruby-keyword kw">end</span> -67: -68: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">destination</span> ) -69: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"wget #{package.srcUrl}"</span> ) ) -70: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-value str">"Download completed for "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">packageName</span> ) -71: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -72: <span class="ruby-keyword kw">end</span> -73: -74: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># download failed.</span> -75: <span class="ruby-keyword kw">end</span> +61: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-node">"#{destination}/#{File.basename( package.srcUrl )}"</span> ) ) +62: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Download not needed, existing source found for #{packageName}"</span> ) +63: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +64: <span class="ruby-keyword kw">end</span> +65: +66: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">destination</span> ) +67: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"wget #{package.srcUrl}"</span> ) ) +68: <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Download completed for #{packageName}"</span> ) +69: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +70: <span class="ruby-keyword kw">end</span> +71: +72: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># download failed.</span> +73: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000013"></a><b>retrievePackageTree</b>( packageTreeName ) + <a name="M000014"></a><b>retrievePackageTree</b>( packageTreeName ) </div> <div class="description"> <p> @@ -296,19 +293,19 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p> - <div id="M000013_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show source</a> ]</p> + <div id="M000014_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 85</span> -85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrievePackageTree</span>( <span class="ruby-identifier">packageTreeName</span> ) -86: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 83</span> +83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retrievePackageTree</span>( <span class="ruby-identifier">packageTreeName</span> ) +84: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000015"></a><b>updatePackage</b>() + <a name="M000016"></a><b>updatePackage</b>() </div> <div class="description"> <p> @@ -323,19 +320,19 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show source</a> ]</p> - <div id="M000015_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p> + <div id="M000016_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 153</span> -153: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackage</span> -154: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 150</span> +150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackage</span> +151: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000016"></a><b>updatePackageTree</b>() + <a name="M000017"></a><b>updatePackageTree</b>() </div> <div class="description"> <p> @@ -347,12 +344,12 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p> - <div id="M000016_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000017_source')" id="l_M000017_source">show source</a> ]</p> + <div id="M000017_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtDownloadManager.rb, line 162</span> -162: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackageTree</span> -163: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtdownloadmanager.rb, line 159</span> +159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">updatePackageTree</span> +160: <span class="ruby-keyword kw">end</span> </pre> </div> </div> Modified: src/trunk/doc/classes/AbtLogManager.html =================================================================== --- src/trunk/doc/classes/AbtLogManager.html 2007-07-16 13:34:14 UTC (rev 363) +++ src/trunk/doc/classes/AbtLogManager.html 2007-07-16 13:51:57 UTC (rev 364) @@ -57,7 +57,7 @@ <tr valign="top"> <td>In:</td> <td> -<a href="../files/AbtLogManager_rb.html">AbtLogManager.rb</a> +<a href="../files/abtlogmanager_rb.html">abtlogmanager.rb</a> </td> </tr> <tr> @@ -78,11 +78,11 @@ <map id="map" name="map"> <area shape="rect" coords="27,50,141,98" href="AbtLogManager.html" alt="AbtLogManager" /> </map> -<img src="../dot/f_2.png" usemap="#map" border="0" alt="TopLevel" /> +<img src="../dot/f_2.png" usemap="#map" border="0" alt="dot/f_2.png"> </td></tr></table> <div class="description"><p> -AbtLogManager.rb +abtlogmanager.rb </p> <p> <a href="AbtLogManager.html">AbtLogManager</a> class handles all aspects of @@ -117,12 +117,12 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000066">cachePackage</a></li> - <li><a href="#M000065">logPackageBuild</a></li> - <li><a href="#M000064">logPackageInstall</a></li> - <li><a href="#M000063">logPackageIntegrity</a></li> - <li><a href="#M000067">logToJournal</a></li> - <li><a href="#M000062">new</a></li> + <li><a href="#M000067">cachePackage</a></li> + <li><a href="#M000066">logPackageBuild</a></li> + <li><a href="#M000065">logPackageInstall</a></li> + <li><a href="#M000064">logPackageIntegrity</a></li> + <li><a href="#M000068">logToJournal</a></li> + <li><a href="#M000063">new</a></li> </ul> @@ -133,7 +133,7 @@ <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000062"></a><b>new</b>() + <a name="M000063"></a><b>new</b>() </div> <div class="description"> <p> @@ -146,20 +146,20 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p> - <div id="M000062_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p> + <div id="M000063_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtLogManager.rb, line 43</span> -43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> -44: [<span class="ruby-identifier">$ABT_LOGS</span>, <span class="ruby-identifier">$ABT_CACHES</span>, <span class="ruby-identifier">$ABT_STATE</span>, <span class="ruby-identifier">$BUILD_LOCATION</span>, <span class="ruby-identifier">$PACKAGE_INSTALLED</span>, -45: <span class="ruby-identifier">$PACKAGE_CACHED</span>, <span class="ruby-identifier">$ABT_TMP</span>, <span class="ruby-identifier">$SOURCES_REPOSITORY</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> -46: -47: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">dir</span> ) ) -48: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">dir</span> ) -49: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">logToJournal</span>( <span class="ruby-node">"Created directory: #{dir}."</span> ) -50: <span class="ruby-keyword kw">end</span> -51: } -52: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 81</span> +81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> +82: [<span class="ruby-identifier">$ABT_LOGS</span>, <span class="ruby-identifier">$ABT_CACHES</span>, <span class="ruby-identifier">$ABT_STATE</span>, <span class="ruby-identifier">$BUILD_LOCATION</span>, <span class="ruby-identifier">$PACKAGE_INSTALLED</span>, +83: <span class="ruby-identifier">$PACKAGE_CACHED</span>, <span class="ruby-identifier">$ABT_TMP</span>, <span class="ruby-identifier">$SOURCES_REPOSITORY</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> +84: +85: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">dir</span> ) ) +86: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">dir</span> ) +87: <span class="ruby-identifier">logToJournal</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Created directory: #{dir}."</span> +88: <span class="ruby-keyword kw">end</span> +89: } +90: <span class="ruby-keyword kw">end</span> </pre> </div> </div> @@ -167,7 +167,7 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>cachePackage</b>( package ) + <a name="M000067"></a><b>cachePackage</b>( package ) </div> <div class="description"> <p> @@ -183,26 +183,94 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> - <div id="M000066_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> + <div id="M000067_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtLogManager.rb, line 184</span> -184: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachePackage</span>( <span class="ruby-identifier">package</span> ) -185: <span class="ruby-comment cmt"># TODO: collect package source.</span> -186: <span class="ruby-comment cmt"># TODO: collect package install log. </span> -187: <span class="ruby-comment cmt"># TODO: collect package build log. </span> -188: <span class="ruby-comment cmt"># TODO: collect package configure log. </span> -189: <span class="ruby-comment cmt"># TODO: collect package integrity log.</span> -190: <span class="ruby-comment cmt"># TODO: collect package description (class file).</span> -191: <span class="ruby-comment cmt"># TODO: tar and bzip this directory (package-cache-version.tar.bz2) </span> -192: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 210</span> +210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cachePackage</span>( <span class="ruby-identifier">package</span> ) +211: <span class="ruby-identifier">system</span> = <span class="ruby-constant">AbtSystemManager</span>.<span class="ruby-identifier">new</span> +212: +213: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>.<span class="ruby-identifier">packageInstalled</span>( <span class="ruby-identifier">package</span> ) ) +214: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) +215: <span class="ruby-identifier">cachedDir</span> = <span class="ruby-identifier">$PACKAGE_CACHED</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcDir</span> +216: <span class="ruby-identifier">sourcePath</span> = <span class="ruby-identifier">$SOURCES_REPOSITORY</span> <span class="ruby-operator">+</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +217: <span class="ruby-identifier">sourceFile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>( <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">srcUrl</span> ) +218: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +219: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +220: <span class="ruby-identifier">configureLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +221: <span class="ruby-identifier">integrityLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +222: <span class="ruby-identifier">packageFile</span> = <span class="ruby-node">"#{$PACKAGE_PATH}#{package}.rb"</span> +223: +224: +225: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>( <span class="ruby-identifier">cachedDir</span> ) +226: +227: <span class="ruby-comment cmt"># collect package source.</span> +228: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">sourcePath</span> ) ) +229: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">sourcePath</span>, <span class="ruby-node">"#{cachedDir}/#{sourceFile}"</span> ) +230: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} source."</span> +231: <span class="ruby-keyword kw">else</span> +232: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} source."</span> +233: <span class="ruby-keyword kw">end</span> +234: +235: <span class="ruby-comment cmt"># collect package install log. </span> +236: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">installLog</span> ) ) +237: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.install"</span> ) +238: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} install log."</span> +239: <span class="ruby-keyword kw">else</span> +240: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} install log."</span> +241: <span class="ruby-keyword kw">end</span> +242: +243: <span class="ruby-comment cmt"># collect package build log. </span> +244: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +245: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">buildLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.build"</span> ) +246: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} build log."</span> +247: <span class="ruby-keyword kw">else</span> +248: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} build log."</span> +249: <span class="ruby-keyword kw">end</span> +250: +251: <span class="ruby-comment cmt"># collect package configure log. </span> +252: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">configureLog</span> ) ) +253: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">configureLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.configure"</span> ) +254: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} configure log."</span> +255: <span class="ruby-keyword kw">else</span> +256: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} configure log."</span> +257: <span class="ruby-keyword kw">end</span> +258: +259: <span class="ruby-comment cmt"># collect package integrity log.</span> +260: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">integrityLog</span> ) ) +261: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">integrityLog</span>, <span class="ruby-node">"#{cachedDir}/#{sw.srcDir}.integrity"</span> ) +262: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} integrity log."</span> +263: <span class="ruby-keyword kw">else</span> +264: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} integrity log."</span> +265: <span class="ruby-keyword kw">end</span> +266: +267: <span class="ruby-comment cmt"># collect package description (class file).</span> +268: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">FileTest</span><span class="ruby-operator">::</span><span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">packageFile</span> ) ) +269: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">copy_file</span>( <span class="ruby-identifier">packageFile</span>, <span class="ruby-node">"#{cachedDir}/#{package}.rb"</span> ) +270: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nCaching copy of #{package} package description."</span> +271: <span class="ruby-keyword kw">else</span> +272: <span class="ruby-identifier">puts</span> <span class="ruby-node">"\nUnable to cache copy of #{package} package description, from location #{packageFile}"</span> +273: <span class="ruby-keyword kw">end</span> +274: +275: <span class="ruby-comment cmt"># tar and bzip this directory (package-cache-version.tar.bz2) </span> +276: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>( <span class="ruby-identifier">$PACKAGE_CACHED</span> ) +277: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">system</span>( <span class="ruby-node">"tar -cf #{sw.srcDir}.tar #{sw.srcDir}"</span> ) <span class="ruby-operator">&&</span> +278: <span class="ruby-identifier">system</span>( <span class="ruby-node">"bzip2 -f #{sw.srcDir}.tar"</span> ) ) +279: <span class="ruby-comment cmt"># last but not least, remove our tarball directory</span> +280: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>( <span class="ruby-identifier">cachedDir</span> ) +281: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +282: <span class="ruby-keyword kw">end</span> +283: <span class="ruby-keyword kw">end</span> +284: +285: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># package not installed, can't cache it.</span> +286: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>logPackageBuild</b>( package ) + <a name="M000066"></a><b>logPackageBuild</b>( package ) </div> <div class="description"> <p> @@ -218,32 +286,27 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> - <div id="M000065_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> + <div id="M000066_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtLogManager.rb, line 159</span> -159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageBuild</span>( <span class="ruby-identifier">package</span> ) -160: <span class="ruby-identifier">require</span> <span class="ruby-identifier">package</span> -161: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) -162: <span class="ruby-identifier">details</span> = <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">details</span> -163: <span class="ruby-identifier">buildLog</span> = <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> <span class="ruby-operator">+</span> -164: <span class="ruby-node">"/#{details['Source location']}.build"</span> -165: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: buildFile is - #{buildFile}" )</span> -166: -167: <span class="ruby-comment cmt"># make sure the build file exists.</span> -168: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) -169: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -170: <span class="ruby-keyword kw">end</span> -171: -172: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -173: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 190</span> +190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageBuild</span>( <span class="ruby-identifier">package</span> ) +191: <span class="ruby-identifier">buildLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'build'</span> ) +192: +193: <span class="ruby-comment cmt"># make sure the build file exists.</span> +194: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">buildLog</span> ) ) +195: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +196: <span class="ruby-keyword kw">end</span> +197: +198: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +199: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>logPackageInstall</b>( package ) + <a name="M000065"></a><b>logPackageInstall</b>( package ) </div> <div class="description"> <p> @@ -259,60 +322,55 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> - <div id="M000064_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> + <div id="M000065_source" class="dyn-source"> <pre> - <span class="ruby-comment cmt"># File AbtLogManager.rb, line 106</span> -106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageInstall</span>( <span class="ruby-identifier">package</span> ) -107: <span class="ruby-comment cmt"># some dirs we will not add to an install log.</span> -108: <span class="ruby-identifier">excluded_pattern</span> = -109: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) -110: -111: <span class="ruby-identifier">require</span> <span class="ruby-identifier">package</span> -112: <span class="ruby-identifier">sw</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-node">"#{package.capitalize}.new"</span> ) -113: <span class="ruby-identifier">details</span> = <span class="ruby-identifier">sw</span>.<span class="ruby-identifier">details</span> -114: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> -115: -116: <span class="ruby-comment cmt"># our log locations.</span> -117: <span class="ruby-identifier">installLog</span> = <span class="ruby-node">"#{$PACKAGE_INSTALLED}/#{details['Source location']}"</span> <span class="ruby-operator">+</span> -118: <span class="ruby-node">"/#{details['Source location']}.install"</span> -119: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-node">"#{$ABT_TMP}/#{details['Source location']}.watch"</span> -120: -121: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> -122: <span class="ruby-comment cmt"># into our install log.</span> -123: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) -124: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) -125: -126: <span class="ruby-comment cmt"># include only the file names from open calls</span> -127: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> -128: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> -129: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) -130: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) -131: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> -132: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> -133: <span class="ruby-keyword kw">else</span> -134: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> -135: <span class="ruby-keyword kw">end</span> -136: -137: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) -138: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: adding line to installFile!")</span> -139: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] -140: <span class="ruby-keyword kw">end</span> -141: <span class="ruby-keyword kw">end</span> -142: <span class="ruby-keyword kw">end</span> -143: -144: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> -145: <span class="ruby-keyword kw">end</span> -146: -147: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; -148: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File abtlogmanager.rb, line 142</span> +142: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logPackageInstall</span>( <span class="ruby-identifier">package</span> ) +143: <span class="ruby-comment cmt"># some dirs we will not add to an install log.</span> +144: <span class="ruby-identifier">excluded_pattern</span> = +145: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+"</span> ) +146: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># used to mark excluded lines from installwatch log.</span> +147: +148: <span class="ruby-comment cmt"># our log locations.</span> +149: <span class="ruby-identifier">installLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'install'</span> ) +150: <span class="ruby-identifier">tmpInstallLog</span> = <span class="ruby-identifier">getLog</span>( <span class="ruby-identifier">package</span>, <span class="ruby-value str">'tmpinstall'</span> ) +151: +152: <span class="ruby-comment cmt"># get the installed files from the tmp file</span> +153: <span class="ruby-comment cmt"># into our install log.</span> +154: <span class="ruby-keyword kw">if</span> ( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>( <span class="ruby-identifier">tmpInstallLog</span> ) ) +155: <span class="ruby-identifier">installFile</span> = <span class="ruby-identifier">open</span>( <span class="ruby-identifier">installLog</span>, <span class="ruby-value str">'w'</span>) +156: +157: <span class="ruby-comment cmt"># include only the file names from open calls</span> +158: <span class="ruby-comment cmt"># and not part of the excluded range of directories.</span> +159: <span class="ruby-constant">IO</span>.<span class="ruby-identifier">foreach</span>( <span class="ruby-identifier">tmpInstallLog</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> +160: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'open'</span> ) +161: <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">excluded_pattern</span> ) +162: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: Found bad logLine!" )</span> +163: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">true</span> +164: <span class="ruby-keyword kw">else</span> +165: <span class="ruby-identifier">badLine</span> = <span class="ruby-keyword kw">false</span> +166: <span class="ruby-keyword kw">end</span> +167: +168: <span class="ruby-keyword kw">if</span> ( <span class="ruby-operator">!</span><span class="ruby-identifier">badLine</span> ) +169: <span class="ruby-comment cmt">#self.logToJournal( "DEBUG: adding line to installFile!")</span> +170: <span class="ruby-identifier">installFile</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{line.split[2]}\n"</span> +171: <span class="ruby-keyword kw">end</span> +172: <span class="ruby-keyword kw">end</span> +173: <span class="ruby-keyword kw">end</span> +174: +175: <span class="ruby-identifier">installFile</span>.<span class="ruby-identifier">close</span> +176: <span class="ruby-keyword kw">end</span> +177: +178: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>; +179: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000063"></a><b>logPackageIntegrity</b>( package ) + <a name="M000064"></a><b>logPackageIntegrity</b>( package ) </div> <div class="description"> <p> @@ -329,49 +387,47 @@ </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_... [truncated message content] |
From: <esc...@us...> - 2007-07-16 13:34:11
|
Revision: 363 http://svn.sourceforge.net/abtlinux/?rev=363&view=rev Author: eschabell Date: 2007-07-16 06:34:14 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Migrated test suite file to rubified file name. Added Paths: ----------- src/trunk/testsuiteabt.rb Removed Paths: ------------- src/trunk/testSuiteAbt.rb Deleted: src/trunk/testSuiteAbt.rb =================================================================== --- src/trunk/testSuiteAbt.rb 2007-07-16 13:33:36 UTC (rev 362) +++ src/trunk/testSuiteAbt.rb 2007-07-16 13:34:14 UTC (rev 363) @@ -1,32 +0,0 @@ -#!/usr/bin/ruby -w - -if ( Process.uid != 0 ) - puts "Enter root password:" - system( 'su -c ./testSuiteAbt.rb root' ) - exit -end - -require 'test/unit' -require 'abtconfig' - -# By ensuring an install of the test package ipc -# is done prior to running unit tests, we are able -# to ensure that all needed directories, logs, etc -# are created prior to running the tests. If ipc is -# already installed, this process is not repleated. -# -# This speeds up the test suit by more than 10 sec -# on my machine. I get avg runs of around 17,5 sec. -# -logger = AbtLogManager.new -manager = AbtPackageManager.new -manager.installPackage( "ipc" ) - -require 'testabtpackagemanager' -require 'testabtlogmanager' -require 'testabtdownloadmanager' -require 'testabtpackage' -require 'testabtqueuemanager' -require 'testabtreportmanager' -require 'testabtsystemmanager' -require 'testabtdepengine' Copied: src/trunk/testsuiteabt.rb (from rev 359, src/trunk/testSuiteAbt.rb) =================================================================== --- src/trunk/testsuiteabt.rb (rev 0) +++ src/trunk/testsuiteabt.rb 2007-07-16 13:34:14 UTC (rev 363) @@ -0,0 +1,32 @@ +#!/usr/bin/ruby -w + +if ( Process.uid != 0 ) + puts "Enter root password:" + system( 'su -c ./testSuiteAbt.rb root' ) + exit +end + +require 'test/unit' +require 'abtconfig' + +# By ensuring an install of the test package ipc +# is done prior to running unit tests, we are able +# to ensure that all needed directories, logs, etc +# are created prior to running the tests. If ipc is +# already installed, this process is not repleated. +# +# This speeds up the test suit by more than 10 sec +# on my machine. I get avg runs of around 17,5 sec. +# +logger = AbtLogManager.new +manager = AbtPackageManager.new +manager.installPackage( "ipc" ) + +require 'testabtpackagemanager' +require 'testabtlogmanager' +require 'testabtdownloadmanager' +require 'testabtpackage' +require 'testabtqueuemanager' +require 'testabtreportmanager' +require 'testabtsystemmanager' +require 'testabtdepengine' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-16 13:33:34
|
Revision: 362 http://svn.sourceforge.net/abtlinux/?rev=362&view=rev Author: eschabell Date: 2007-07-16 06:33:36 -0700 (Mon, 16 Jul 2007) Log Message: ----------- Migrated dog generation template to rubified file name. Added Paths: ----------- src/trunk/abttemplate.rb Removed Paths: ------------- src/trunk/abtTemplate.rb Deleted: src/trunk/abtTemplate.rb =================================================================== --- src/trunk/abtTemplate.rb 2007-07-16 13:32:49 UTC (rev 361) +++ src/trunk/abtTemplate.rb 2007-07-16 13:33:36 UTC (rev 362) @@ -1,590 +0,0 @@ -module RDoc -module Page - -FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif" - -STYLE = <<CSS -a { - color: #00F; - text-decoration: none; -} - -a:hover { - color: #77F; - text-decoration: underline; -} - -body, td, p { - font-family: %fonts%; - background: #FFF; - color: #000; - margin: 0px; - font-size: small; -} - -#content { - margin: 2em; -} - -#description p { - margin-bottom: 0.5em; -} - -.sectiontitle { - margin-top: 1em; - margin-bottom: 1em; - padding: 0.5em; - padding-left: 2em; - background: #005; - color: #FFF; - font-weight: bold; - border: 1px dotted black; -} - -.attr-rw { - padding-left: 1em; - padding-right: 1em; - text-align: center; - color: #055; -} - -.attr-name { - font-weight: bold; -} - -.attr-desc { -} - -.attr-value { - font-family: monospace; -} - -.file-title-prefix { - font-size: large; -} - -.file-title { - font-size: large; - font-weight: bold; - background: #005; - color: #FFF; -} - -.banner { - background: #005; - color: #FFF; - border: 1px solid black; - padding: 1em; -} - -.banner td { - background: transparent; - color: #FFF; -} - -h1 a, h2 a, .sectiontitle a, .banner a { - color: #FF0; -} - -h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover { - color: #FF7; -} - -.dyn-source { - display: none; - background: #FFE; - color: #000; - border: 1px dotted black; - margin: 0.5em 2em 0.5em 2em; - padding: 0.5em; -} - -.dyn-source .cmt { - color: #00F; - font-style: italic; -} - -.dyn-source .kw { - color: #070; - font-weight: bold; -} - -.method { - margin-left: 1em; - margin-right: 1em; - margin-bottom: 1em; -} - -.description pre { - padding: 0.5em; - border: 1px dotted black; - background: #FFE; -} - -.method .title { - font-family: monospace; - font-size: large; - border-bottom: 1px dashed black; - margin-bottom: 0.3em; - padding-bottom: 0.1em; -} - -.method .description, .method .sourcecode { - margin-left: 1em; -} - -.description p, .sourcecode p { - margin-bottom: 0.5em; -} - -.method .sourcecode p.source-link { - text-indent: 0em; - margin-top: 0.5em; -} - -.method .aka { - margin-top: 0.3em; - margin-left: 1em; - font-style: italic; - text-indent: 2em; -} - -h1 { - padding: 1em; - border: 1px solid black; - font-size: x-large; - font-weight: bold; - color: #FFF; - background: #007; -} - -h2 { - padding: 0.5em 1em 0.5em 1em; - border: 1px solid black; - font-size: large; - font-weight: bold; - color: #FFF; - background: #009; -} - -h3, h4, h5, h6 { - padding: 0.2em 1em 0.2em 1em; - border: 1px dashed black; - color: #000; - background: #AAF; -} - -.sourcecode > pre { - padding: 0.5em; - border: 1px dotted black; - background: #FFE; -} - -CSS - -XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -} - -HEADER = XHTML_PREAMBLE + <<ENDHEADER -<html> - <head> - <title>%title%</title> - <meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> - <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" /> - - <script language="JavaScript" type="text/javascript"> - // <![CDATA[ - - function toggleSource( id ) - { - var elem - var link - - if( document.getElementById ) - { - elem = document.getElementById( id ) - link = document.getElementById( "l_" + id ) - } - else if ( document.all ) - { - elem = eval( "document.all." + id ) - link = eval( "document.all.l_" + id ) - } - else - return false; - - if( elem.style.display == "block" ) - { - elem.style.display = "none" - link.innerHTML = "show source" - } - else - { - elem.style.display = "block" - link.innerHTML = "hide source" - } - } - - function openCode( url ) - { - window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" ) - } - // ]]> - </script> - </head> - - <body> -ENDHEADER - -FILE_PAGE = <<HTML -<table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'> - <tr><td> - <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr> - <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td> - <td align="right"> - <table border='0' cellspacing="0" cellpadding="2"> - <tr> - <td>Path:</td> - <td>%full_path% -IF:cvsurl - (<a href="%cvsurl%">CVS</a>) -ENDIF:cvsurl - </td> - </tr> - <tr> - <td>Modified:</td> - <td>%dtm_modified%</td> - </tr> - </table> - </td></tr> - </table> - </td></tr> -</table><br> -HTML - -################################################################### - -CLASS_PAGE = <<HTML -<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr> - <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td> - <td align="right"> - <table cellspacing=0 cellpadding=2> - <tr valign="top"> - <td>In:</td> - <td> -START:infiles -HREF:full_path_url:full_path: -IF:cvsurl - (<a href="%cvsurl%">CVS</a>) -ENDIF:cvsurl -END:infiles - </td> - </tr> -IF:parent - <tr> - <td>Parent:</td> - <td> -IF:par_url - <a href="%par_url%"> -ENDIF:par_url -%parent% -IF:par_url - </a> -ENDIF:par_url - </td> - </tr> -ENDIF:parent - </table> - </td> - </tr> - </table> -HTML - -################################################################### - -METHOD_LIST = <<HTML - <div id="content"> -IF:diagram - <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> - %diagram% - </td></tr></table> -ENDIF:diagram - -IF:description - <div class="description">%description%</div> -ENDIF:description - -IF:requires - <div class="sectiontitle">Required Files</div> - <ul> -START:requires - <li>HREF:aref:name:</li> -END:requires - </ul> -ENDIF:requires - -IF:toc - <div class="sectiontitle">Contents</div> - <ul> -START:toc - <li><a href="#%href%">%secname%</a></li> -END:toc - </ul> -ENDIF:toc - -IF:methods - <div class="sectiontitle">Methods</div> - <ul> -START:methods - <li>HREF:aref:name:</li> -END:methods - </ul> -ENDIF:methods - -IF:includes -<div class="sectiontitle">Included Modules</div> -<ul> -START:includes - <li>HREF:aref:name:</li> -END:includes -</ul> -ENDIF:includes - -START:sections -IF:sectitle -<div class="sectiontitle"><a name="%secsequence%">%sectitle%</a></div> -IF:seccomment -<div class="description"> -%seccomment% -</div> -ENDIF:seccomment -ENDIF:sectitle - -IF:classlist - <div class="sectiontitle">Classes and Modules</div> - %classlist% -ENDIF:classlist - -IF:constants - <div class="sectiontitle">Constants</div> - <table border='0' cellpadding='5'> -START:constants - <tr valign='top'> - <td class="attr-name">%name%</td> - <td>=</td> - <td class="attr-value">%value%</td> - </tr> -IF:desc - <tr valign='top'> - <td> </td> - <td colspan="2" class="attr-desc">%desc%</td> - </tr> -ENDIF:desc -END:constants - </table> -ENDIF:constants - -IF:attributes - <div class="sectiontitle">Attributes</div> - <table border='0' cellpadding='5'> -START:attributes - <tr valign='top'> - <td class='attr-rw'> -IF:rw -[%rw%] -ENDIF:rw - </td> - <td class='attr-name'>%name%</td> - <td class='attr-desc'>%a_desc%</td> - </tr> -END:attributes - </table> -ENDIF:attributes - -IF:method_list -START:method_list -IF:methods -<div class="sectiontitle">%type% %category% methods</div> -START:methods -<div class="method"> - <div class="title"> -IF:callseq - <a name="%aref%"></a><b>%callseq%</b> -ENDIF:callseq -IFNOT:callseq - <a name="%aref%"></a><b>%name%</b>%params% -ENDIF:callseq -IF:codeurl -[ <a href="javascript:openCode('%codeurl%')">source</a> ] -ENDIF:codeurl - </div> -IF:m_desc - <div class="description"> - %m_desc% - </div> -ENDIF:m_desc -IF:aka -<div class="aka"> - This method is also aliased as -START:aka - <a href="%aref%">%name%</a> -END:aka -</div> -ENDIF:aka -IF:sourcecode -<div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p> - <div id="%aref%_source" class="dyn-source"> -<pre> -%sourcecode% -</pre> - </div> -</div> -ENDIF:sourcecode -</div> -END:methods -ENDIF:methods -END:method_list -ENDIF:method_list -END:sections -</div> -HTML - -FOOTER = <<ENDFOOTER - </body> -</html> -ENDFOOTER - -BODY = HEADER + <<ENDBODY - !INCLUDE! <!-- banner header --> - - <div id="bodyContent"> - #{METHOD_LIST} - </div> - - #{FOOTER} -ENDBODY - -########################## Source code ########################## - -SRC_PAGE = XHTML_PREAMBLE + <<HTML -<html> -<head><title>%title%</title> -<meta http-equiv="Content-Type" content="text/html; charset=%charset%"> -<style> -.ruby-comment { color: green; font-style: italic } -.ruby-constant { color: #4433aa; font-weight: bold; } -.ruby-identifier { color: #222222; } -.ruby-ivar { color: #2233dd; } -.ruby-keyword { color: #3333FF; font-weight: bold } -.ruby-node { color: #777777; } -.ruby-operator { color: #111111; } -.ruby-regexp { color: #662222; } -.ruby-value { color: #662222; font-style: italic } - .kw { color: #3333FF; font-weight: bold } - .cmt { color: green; font-style: italic } - .str { color: #662222; font-style: italic } - .re { color: #662222; } -</style> -</head> -<body bgcolor="white"> -<pre>%code%</pre> -</body> -</html> -HTML - -########################## Index ################################ - -FR_INDEX_BODY = <<HTML -!INCLUDE! -HTML - -FILE_INDEX = XHTML_PREAMBLE + <<HTML -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=%charset%"> -<style> -<!-- - body { - background-color: #EEE; - font-family: #{FONTS}; - color: #000; - margin: 0px; - } - .banner { - background: #005; - color: #FFF; - padding: 0.2em; - font-size: small; - font-weight: bold; - text-align: center; - } - .entries { - margin: 0.25em 1em 0 1em; - font-size: x-small; - } - a { - color: #00F; - text-decoration: none; - white-space: nowrap; - } - a:hover { - color: #77F; - text-decoration: underline; - } ---> -</style> -<base target="docwin"> -</head> -<body> -<div class="banner">%list_title%</div> -<div class="entries"> -START:entries -<a href="%href%">%name%</a><br> -END:entries -</div> -</body></html> -HTML - -CLASS_INDEX = FILE_INDEX -METHOD_INDEX = FILE_INDEX - -INDEX = XHTML_PREAMBLE + <<HTML -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>%title%</title> - <meta http-equiv="Content-Type" content="text/html; charset=%charset%"> -</head> - -<frameset cols="20%,*"> - <frameset rows="15%,35%,50%"> - <frame src="fr_file_index.html" title="Files" name="Files" /> - <frame src="fr_class_index.html" name="Classes" /> - <frame src="fr_method_index.html" name="Methods" /> - </frameset> -IF:inline_source - <frame src="%initial_page%" name="docwin"> -ENDIF:inline_source -IFNOT:inline_source - <frameset rows="80%,20%"> - <frame src="%initial_page%" name="docwin"> - <frame src="blank.html" name="source"> - </frameset> -ENDIF:inline_source - <noframes> - <body bgcolor="white"> - Click <a href="html/index.html">here</a> for a non-frames - version of this page. - </body> - </noframes> -</frameset> - -</html> -HTML - -end -end - Copied: src/trunk/abttemplate.rb (from rev 358, src/trunk/abtTemplate.rb) =================================================================== --- src/trunk/abttemplate.rb (rev 0) +++ src/trunk/abttemplate.rb 2007-07-16 13:33:36 UTC (rev 362) @@ -0,0 +1,590 @@ +module RDoc +module Page + +FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif" + +STYLE = <<CSS +a { + color: #00F; + text-decoration: none; +} + +a:hover { + color: #77F; + text-decoration: underline; +} + +body, td, p { + font-family: %fonts%; + background: #FFF; + color: #000; + margin: 0px; + font-size: small; +} + +#content { + margin: 2em; +} + +#description p { + margin-bottom: 0.5em; +} + +.sectiontitle { + margin-top: 1em; + margin-bottom: 1em; + padding: 0.5em; + padding-left: 2em; + background: #005; + color: #FFF; + font-weight: bold; + border: 1px dotted black; +} + +.attr-rw { + padding-left: 1em; + padding-right: 1em; + text-align: center; + color: #055; +} + +.attr-name { + font-weight: bold; +} + +.attr-desc { +} + +.attr-value { + font-family: monospace; +} + +.file-title-prefix { + font-size: large; +} + +.file-title { + font-size: large; + font-weight: bold; + background: #005; + color: #FFF; +} + +.banner { + background: #005; + color: #FFF; + border: 1px solid black; + padding: 1em; +} + +.banner td { + background: transparent; + color: #FFF; +} + +h1 a, h2 a, .sectiontitle a, .banner a { + color: #FF0; +} + +h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover { + color: #FF7; +} + +.dyn-source { + display: none; + background: #FFE; + color: #000; + border: 1px dotted black; + margin: 0.5em 2em 0.5em 2em; + padding: 0.5em; +} + +.dyn-source .cmt { + color: #00F; + font-style: italic; +} + +.dyn-source .kw { + color: #070; + font-weight: bold; +} + +.method { + margin-left: 1em; + margin-right: 1em; + margin-bottom: 1em; +} + +.description pre { + padding: 0.5em; + border: 1px dotted black; + background: #FFE; +} + +.method .title { + font-family: monospace; + font-size: large; + border-bottom: 1px dashed black; + margin-bottom: 0.3em; + padding-bottom: 0.1em; +} + +.method .description, .method .sourcecode { + margin-left: 1em; +} + +.description p, .sourcecode p { + margin-bottom: 0.5em; +} + +.method .sourcecode p.source-link { + text-indent: 0em; + margin-top: 0.5em; +} + +.method .aka { + margin-top: 0.3em; + margin-left: 1em; + font-style: italic; + text-indent: 2em; +} + +h1 { + padding: 1em; + border: 1px solid black; + font-size: x-large; + font-weight: bold; + color: #FFF; + background: #007; +} + +h2 { + padding: 0.5em 1em 0.5em 1em; + border: 1px solid black; + font-size: large; + font-weight: bold; + color: #FFF; + background: #009; +} + +h3, h4, h5, h6 { + padding: 0.2em 1em 0.2em 1em; + border: 1px dashed black; + color: #000; + background: #AAF; +} + +.sourcecode > pre { + padding: 0.5em; + border: 1px dotted black; + background: #FFE; +} + +CSS + +XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +} + +HEADER = XHTML_PREAMBLE + <<ENDHEADER +<html> + <head> + <title>%title%</title> + <meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> + <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" /> + + <script language="JavaScript" type="text/javascript"> + // <![CDATA[ + + function toggleSource( id ) + { + var elem + var link + + if( document.getElementById ) + { + elem = document.getElementById( id ) + link = document.getElementById( "l_" + id ) + } + else if ( document.all ) + { + elem = eval( "document.all." + id ) + link = eval( "document.all.l_" + id ) + } + else + return false; + + if( elem.style.display == "block" ) + { + elem.style.display = "none" + link.innerHTML = "show source" + } + else + { + elem.style.display = "block" + link.innerHTML = "hide source" + } + } + + function openCode( url ) + { + window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" ) + } + // ]]> + </script> + </head> + + <body> +ENDHEADER + +FILE_PAGE = <<HTML +<table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'> + <tr><td> + <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr> + <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td> + <td align="right"> + <table border='0' cellspacing="0" cellpadding="2"> + <tr> + <td>Path:</td> + <td>%full_path% +IF:cvsurl + (<a href="%cvsurl%">CVS</a>) +ENDIF:cvsurl + </td> + </tr> + <tr> + <td>Modified:</td> + <td>%dtm_modified%</td> + </tr> + </table> + </td></tr> + </table> + </td></tr> +</table><br> +HTML + +################################################################### + +CLASS_PAGE = <<HTML +<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr> + <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td> + <td align="right"> + <table cellspacing=0 cellpadding=2> + <tr valign="top"> + <td>In:</td> + <td> +START:infiles +HREF:full_path_url:full_path: +IF:cvsurl + (<a href="%cvsurl%">CVS</a>) +ENDIF:cvsurl +END:infiles + </td> + </tr> +IF:parent + <tr> + <td>Parent:</td> + <td> +IF:par_url + <a href="%par_url%"> +ENDIF:par_url +%parent% +IF:par_url + </a> +ENDIF:par_url + </td> + </tr> +ENDIF:parent + </table> + </td> + </tr> + </table> +HTML + +################################################################### + +METHOD_LIST = <<HTML + <div id="content"> +IF:diagram + <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> + %diagram% + </td></tr></table> +ENDIF:diagram + +IF:description + <div class="description">%description%</div> +ENDIF:description + +IF:requires + <div class="sectiontitle">Required Files</div> + <ul> +START:requires + <li>HREF:aref:name:</li> +END:requires + </ul> +ENDIF:requires + +IF:toc + <div class="sectiontitle">Contents</div> + <ul> +START:toc + <li><a href="#%href%">%secname%</a></li> +END:toc + </ul> +ENDIF:toc + +IF:methods + <div class="sectiontitle">Methods</div> + <ul> +START:methods + <li>HREF:aref:name:</li> +END:methods + </ul> +ENDIF:methods + +IF:includes +<div class="sectiontitle">Included Modules</div> +<ul> +START:includes + <li>HREF:aref:name:</li> +END:includes +</ul> +ENDIF:includes + +START:sections +IF:sectitle +<div class="sectiontitle"><a name="%secsequence%">%sectitle%</a></div> +IF:seccomment +<div class="description"> +%seccomment% +</div> +ENDIF:seccomment +ENDIF:sectitle + +IF:classlist + <div class="sectiontitle">Classes and Modules</div> + %classlist% +ENDIF:classlist + +IF:constants + <div class="sectiontitle">Constants</div> + <table border='0' cellpadding='5'> +START:constants + <tr valign='top'> + <td class="attr-name">%name%</td> + <td>=</td> + <td class="attr-value">%value%</td> + </tr> +IF:desc + <tr valign='top'> + <td> </td> + <td colspan="2" class="attr-desc">%desc%</td> + </tr> +ENDIF:desc +END:constants + </table> +ENDIF:constants + +IF:attributes + <div class="sectiontitle">Attributes</div> + <table border='0' cellpadding='5'> +START:attributes + <tr valign='top'> + <td class='attr-rw'> +IF:rw +[%rw%] +ENDIF:rw + </td> + <td class='attr-name'>%name%</td> + <td class='attr-desc'>%a_desc%</td> + </tr> +END:attributes + </table> +ENDIF:attributes + +IF:method_list +START:method_list +IF:methods +<div class="sectiontitle">%type% %category% methods</div> +START:methods +<div class="method"> + <div class="title"> +IF:callseq + <a name="%aref%"></a><b>%callseq%</b> +ENDIF:callseq +IFNOT:callseq + <a name="%aref%"></a><b>%name%</b>%params% +ENDIF:callseq +IF:codeurl +[ <a href="javascript:openCode('%codeurl%')">source</a> ] +ENDIF:codeurl + </div> +IF:m_desc + <div class="description"> + %m_desc% + </div> +ENDIF:m_desc +IF:aka +<div class="aka"> + This method is also aliased as +START:aka + <a href="%aref%">%name%</a> +END:aka +</div> +ENDIF:aka +IF:sourcecode +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p> + <div id="%aref%_source" class="dyn-source"> +<pre> +%sourcecode% +</pre> + </div> +</div> +ENDIF:sourcecode +</div> +END:methods +ENDIF:methods +END:method_list +ENDIF:method_list +END:sections +</div> +HTML + +FOOTER = <<ENDFOOTER + </body> +</html> +ENDFOOTER + +BODY = HEADER + <<ENDBODY + !INCLUDE! <!-- banner header --> + + <div id="bodyContent"> + #{METHOD_LIST} + </div> + + #{FOOTER} +ENDBODY + +########################## Source code ########################## + +SRC_PAGE = XHTML_PREAMBLE + <<HTML +<html> +<head><title>%title%</title> +<meta http-equiv="Content-Type" content="text/html; charset=%charset%"> +<style> +.ruby-comment { color: green; font-style: italic } +.ruby-constant { color: #4433aa; font-weight: bold; } +.ruby-identifier { color: #222222; } +.ruby-ivar { color: #2233dd; } +.ruby-keyword { color: #3333FF; font-weight: bold } +.ruby-node { color: #777777; } +.ruby-operator { color: #111111; } +.ruby-regexp { color: #662222; } +.ruby-value { color: #662222; font-style: italic } + .kw { color: #3333FF; font-weight: bold } + .cmt { color: green; font-style: italic } + .str { color: #662222; font-style: italic } + .re { color: #662222; } +</style> +</head> +<body bgcolor="white"> +<pre>%code%</pre> +</body> +</html> +HTML + +########################## Index ################################ + +FR_INDEX_BODY = <<HTML +!INCLUDE! +HTML + +FILE_INDEX = XHTML_PREAMBLE + <<HTML +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=%charset%"> +<style> +<!-- + body { + background-color: #EEE; + font-family: #{FONTS}; + color: #000; + margin: 0px; + } + .banner { + background: #005; + color: #FFF; + padding: 0.2em; + font-size: small; + font-weight: bold; + text-align: center; + } + .entries { + margin: 0.25em 1em 0 1em; + font-size: x-small; + } + a { + color: #00F; + text-decoration: none; + white-space: nowrap; + } + a:hover { + color: #77F; + text-decoration: underline; + } +--> +</style> +<base target="docwin"> +</head> +<body> +<div class="banner">%list_title%</div> +<div class="entries"> +START:entries +<a href="%href%">%name%</a><br> +END:entries +</div> +</body></html> +HTML + +CLASS_INDEX = FILE_INDEX +METHOD_INDEX = FILE_INDEX + +INDEX = XHTML_PREAMBLE + <<HTML +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>%title%</title> + <meta http-equiv="Content-Type" content="text/html; charset=%charset%"> +</head> + +<frameset cols="20%,*"> + <frameset rows="15%,35%,50%"> + <frame src="fr_file_index.html" title="Files" name="Files" /> + <frame src="fr_class_index.html" name="Classes" /> + <frame src="fr_method_index.html" name="Methods" /> + </frameset> +IF:inline_source + <frame src="%initial_page%" name="docwin"> +ENDIF:inline_source +IFNOT:inline_source + <frameset rows="80%,20%"> + <frame src="%initial_page%" name="docwin"> + <frame src="blank.html" name="source"> + </frameset> +ENDIF:inline_source + <noframes> + <body bgcolor="white"> + Click <a href="html/index.html">here</a> for a non-frames + version of this page. + </body> + </noframes> +</frameset> + +</html> +HTML + +end +end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |