From 379cca5aa37fff030ec9e23cc13ffafa2a25850a Mon Sep 17 00:00:00 2001 From: jim Date: Thu, 18 Sep 2008 01:17:04 +0000 Subject: Updated Rake files to version 0.8.2 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rake/loaders/makefile.rb | 23 +++++++++-------------- lib/rake/packagetask.rb | 1 + lib/rake/rdoctask.rb | 14 +++++++------- lib/rake/tasklib.rb | 11 ++++++++--- lib/rake/testtask.rb | 7 ++++++- 5 files changed, 31 insertions(+), 25 deletions(-) (limited to 'lib/rake') diff --git a/lib/rake/loaders/makefile.rb b/lib/rake/loaders/makefile.rb index f66eb3b35..9ade098a1 100644 --- a/lib/rake/loaders/makefile.rb +++ b/lib/rake/loaders/makefile.rb @@ -7,31 +7,26 @@ module Rake # Load the makefile dependencies in +fn+. def load(fn) - buffer = '' open(fn) do |mf| - mf.each do |line| - next if line =~ /^\s*#/ - buffer << line - if buffer =~ /\\$/ - buffer.sub!(/\\\n/, ' ') - state = :append - else - process_line(buffer) - buffer = '' - end + lines = mf.read + lines.gsub!(/#[^\n]*\n/m, "") + lines.gsub!(/\\\n/, ' ') + lines.split("\n").each do |line| + process_line(line) end end - process_line(buffer) if buffer != '' end private # Process one logical line of makefile data. def process_line(line) - file_task, args = line.split(':') + file_tasks, args = line.split(':') return if args.nil? dependents = args.split - file file_task => dependents + file_tasks.strip.split.each do |file_task| + file file_task => dependents + end end end diff --git a/lib/rake/packagetask.rb b/lib/rake/packagetask.rb index 71b66a648..4b0775d09 100644 --- a/lib/rake/packagetask.rb +++ b/lib/rake/packagetask.rb @@ -122,6 +122,7 @@ module Rake task :package => ["#{package_dir}/#{file}"] file "#{package_dir}/#{file}" => [package_dir_path] + package_files do chdir(package_dir) do + sh %{env} sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}} end end diff --git a/lib/rake/rdoctask.rb b/lib/rake/rdoctask.rb index 54adc6feb..6cfbda1d6 100644 --- a/lib/rake/rdoctask.rb +++ b/lib/rake/rdoctask.rb @@ -55,7 +55,7 @@ module Rake # RDoc. (default is none) attr_accessor :main - # Name of template to be used by rdoc. (default is 'html') + # Name of template to be used by rdoc. (defaults to rdoc's default) attr_accessor :template # List of files to be included in the rdoc generation. (default is []) @@ -74,7 +74,7 @@ module Rake @rdoc_dir = 'html' @main = nil @title = nil - @template = 'html' + @template = nil @external = false @options = [] yield self if block_given? @@ -91,18 +91,18 @@ module Rake task name desc "Force a rebuild of the RDOC files" - task paste("re", name) => [paste("clobber_", name), name] + task "re#{name}" => ["clobber_#{name}", name] desc "Remove rdoc products" - task paste("clobber_", name) do + task "clobber_#{name}" do rm_r rdoc_dir rescue nil end - - task :clobber => [paste("clobber_", name)] + + task :clobber => ["clobber_#{name}"] directory @rdoc_dir task name => [rdoc_target] - file rdoc_target => @rdoc_files + [$rakefile] do + file rdoc_target => @rdoc_files + [Rake.application.rakefile] do rm_r @rdoc_dir rescue nil args = option_list + @rdoc_files if @external diff --git a/lib/rake/tasklib.rb b/lib/rake/tasklib.rb index 465a58a0c..c7fd98133 100644 --- a/lib/rake/tasklib.rb +++ b/lib/rake/tasklib.rb @@ -6,11 +6,16 @@ module Rake # Base class for Task Libraries. class TaskLib - include Cloneable - # Make a symbol by pasting two strings together. - def paste(a,b) + # Make a symbol by pasting two strings together. + # + # NOTE: DEPRECATED! This method is kinda stupid. I don't know why + # I didn't just use string interpolation. But now other task + # libraries depend on this so I can't remove it without breaking + # other people's code. So for now it stays for backwards + # compatibility. BUT DON'T USE IT. + def paste(a,b) # :nodoc: (a.to_s + b.to_s).intern end end diff --git a/lib/rake/testtask.rb b/lib/rake/testtask.rb index f5b77e595..79154e422 100644 --- a/lib/rake/testtask.rb +++ b/lib/rake/testtask.rb @@ -136,7 +136,12 @@ module Rake end def fix # :nodoc: - '' + case RUBY_VERSION + when '1.8.2' + find_file 'rake/ruby182_test_unit_fix' + else + nil + end || '' end def rake_loader # :nodoc: -- cgit '>46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
/*
Ported to U-Boot by Christian Pellegrin <chri@ascensit.com>

Based on sources from the Linux kernel (pcnet_cs.c, 8390.h) and
eCOS(if_dp83902a.c, if_dp83902a.h). Both of these 2 wonderful world
are GPL, so this is, of course, GPL.


==========================================================================

	dev/dp83902a.h

	National Semiconductor DP83902a ethernet chip

==========================================================================
####ECOSGPLCOPYRIGHTBEGIN####
 -------------------------------------------
 This file is part of eCos, the Embedded Configurable Operating System.
 Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.

 eCos is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
 Software Foundation; either version 2 or (at your option) any later version.

 eCos is distributed in the hope that it will be useful, but WITHOUT ANY
 WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.

 You should have received a copy of the GNU General Public License along
 with eCos; if not, write to the Free Software Foundation, Inc.,
 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

 As a special exception, if other files instantiate templates or use macros
 or inline functions from this file, or you compile this file and link it
 with other works to produce a work based on this file, this file does not
 by itself cause the resulting work to be covered by the GNU General Public
 License. However the source code for this file must still be made available
 in accordance with section (3) of the GNU General Public License.

 This exception does not invalidate any other reasons why a work based on
 this file might be covered by the GNU General Public License.

 Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
 at http://sources.redhat.com/ecos/ecos-license/
 -------------------------------------------
####ECOSGPLCOPYRIGHTEND####
####BSDCOPYRIGHTBEGIN####

 -------------------------------------------

 Portions of this software may have been derived from OpenBSD or other sources,
 and are covered by the appropriate copyright disclaimers included herein.

 -------------------------------------------

####BSDCOPYRIGHTEND####
==========================================================================
#####DESCRIPTIONBEGIN####

 Author(s):	gthomas
 Contributors:	gthomas, jskov
 Date:		2001-06-13
 Purpose:
 Description:

####DESCRIPTIONEND####

==========================================================================

*/

/*
 ------------------------------------------------------------------------
 Macros for accessing DP registers
 These can be overridden by the platform header
*/

#ifndef __NE2000_BASE_H__
#define __NE2000_BASE_H__

/*
 * Debugging details
 *
 * Set to perms of:
 * 0 disables all debug output
 * 1 for process debug output
 * 2 for added data IO output: get_reg, put_reg
 * 4 for packet allocation/free output
 * 8 for only startup status, so we can tell we're installed OK
 */
#if 0
#define DEBUG 0xf
#else
#define DEBUG 0
#endif

#if DEBUG & 1
#define DEBUG_FUNCTION() do { printf("%s\n", __FUNCTION__); } while (0)
#define DEBUG_LINE() do { printf("%d\n", __LINE__); } while (0)
#define PRINTK(args...) printf(args)
#else
#define DEBUG_FUNCTION() do {} while(0)
#define DEBUG_LINE() do {} while(0)
#define PRINTK(args...)
#endif

/* timeout for tx/rx in s */
#define TOUT 5
/* Ether MAC address size */
#define ETHER_ADDR_LEN 6


#define CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA 1
#define CYGACC_CALL_IF_DELAY_US(X) udelay(X)

/* H/W infomation struct */
typedef struct hw_info_t {
	u32 offset;
	u8 a0, a1, a2;
	u32 flags;
} hw_info_t;

typedef struct dp83902a_priv_data {
	u8* base;
	u8* data;
	u8* reset;
	int tx_next;		/* First free Tx page */
	int tx_int;		/* Expecting interrupt from this buffer */
	int rx_next;		/* First free Rx page */
	int tx1, tx2;		/* Page numbers for Tx buffers */
	u32 tx1_key, tx2_key;	/* Used to ack when packet sent */
	int tx1_len, tx2_len;
	bool tx_started, running, hardwired_esa;
	u8 esa[6];
	void* plf_priv;

	/* Buffer allocation */
	int tx_buf1, tx_buf2;
	int rx_buf_start, rx_buf_end;
} dp83902a_priv_data_t;

/* ------------------------------------------------------------------------ */
/* Register offsets */

#define DP_CR		0x00
#define DP_CLDA0	0x01
#define DP_PSTART	0x01	/* write */
#define DP_CLDA1	0x02
#define DP_PSTOP	0x02	/* write */
#define DP_BNDRY	0x03
#define DP_TSR		0x04
#define DP_TPSR		0x04	/* write */
#define DP_NCR		0x05
#define DP_TBCL		0x05	/* write */
#define DP_FIFO		0x06