* DejaGnu: support nfsdir and nfsroot_server
@ 2003-03-05 5:34 Alexandre Oliva
2003-03-05 18:04 ` Rob Savoye
0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Oliva @ 2003-03-05 5:34 UTC (permalink / raw)
To: gdb-patches, dejagnu
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
When a remote board supports rsh but not rcp, and it mounts its root
filesystem from the test host, or from another host that supports rcp,
we can take advantage of file sharing to upload and download files
to/from the board. This patch implements this feature. Ok to
install in the sources.redhat.com repository?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dejagnu-nfsdir.patch --]
[-- Type: text/x-patch, Size: 2926 bytes --]
Index: dejagnu/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* lib/remote.exp (standard_download, standard_upload): Support
nfsdir and nfsroot_server.
Index: dejagnu/lib/remote.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/remote.exp,v
retrieving revision 1.5
diff -u -p -r1.5 remote.exp
--- dejagnu/lib/remote.exp 21 Apr 2002 08:47:07 -0000 1.5
+++ dejagnu/lib/remote.exp 5 Mar 2003 05:27:45 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1992 - 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1992 - 2001, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -411,7 +411,42 @@ proc remote_download { dest file args }
#
proc standard_download {dest file destfile} {
- return [rsh_download $dest $file $destfile];
+ set orig_destfile $destfile
+
+ if [board_info $dest exists nfsdir] {
+ set destdir [board_info $dest nfsdir]
+ if [board_info $dest exists nfsroot_server] {
+ set dest [board_info $dest nfsroot_server];
+ } else {
+ set dest "";
+ }
+ set destfile "$destdir/$destfile";
+ }
+
+ if { "$dest" != "" } {
+ set result [rsh_download $dest $file $destfile];
+ if { $result == $destfile } {
+ return $orig_destfile;
+ } else {
+ return $result;
+ }
+ }
+
+ set result [catch "exec cp -p $file $destfile" output];
+ if [regexp "same file|are identical" $output] {
+ set result 0
+ set output ""
+ } else {
+ # try to make sure we can read it
+ # and write it (in case we copy onto it again)
+ catch {exec chmod u+rw $destfile}
+ }
+ if { $result != 0 || $output != "" } {
+ perror "remote_download to $dest of $file to $destfile: $output"
+ return "";
+ } else {
+ return $orig_destfile;
+ }
}
proc remote_upload {dest srcfile args} {
@@ -433,6 +468,38 @@ proc remote_upload {dest srcfile args} {
}
proc standard_upload { dest srcfile destfile } {
+ set orig_srcfile $srcfile
+
+ if [board_info $dest exists nfsdir] {
+ set destdir [board_info $dest nfsdir]
+ if [board_info $dest exists nfsroot_server] {
+ set dest [board_info $dest nfsroot_server];
+ } else {
+ set dest "";
+ }
+ set srcfile "$destdir/$srcfile";
+ }
+
+ if { "$dest" != "" } {
+ return [rsh_upload $dest $srcfile $destfile];
+ }
+
+ set result [catch "exec cp -p $srcfile $destfile" output];
+ if [regexp "same file|are identical" $output] {
+ set result 0
+ set output ""
+ } else {
+ # try to make sure we can read it
+ # and write it (in case we copy onto it again)
+ catch {exec chmod u+rw $destfile}
+ }
+ if { $result != 0 || $output != "" } {
+ perror "remote_upload to $dest of $file to $destfile: $output"
+ return "";
+ } else {
+ return $destfile;
+ }
+
return [rsh_upload $dest $srcfile $destfile];
}
[-- Attachment #3: Type: text/plain, Size: 289 bytes --]
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-05 5:34 DejaGnu: support nfsdir and nfsroot_server Alexandre Oliva
@ 2003-03-05 18:04 ` Rob Savoye
2003-03-05 18:36 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Rob Savoye @ 2003-03-05 18:04 UTC (permalink / raw)
To: Alexandre Oliva; +Cc: gdb-patches, dejagnu
On Wed, Mar 05, 2003 at 02:34:52AM -0300, Alexandre Oliva wrote:
> we can take advantage of file sharing to upload and download files
> to/from the board. This patch implements this feature. Ok to
> install in the sources.redhat.com repository?
Looks ok to me. I can't test it, but it looks fine. I'll check this into
savannah. Oh, there is a patch on savannah dealing with header file include
paths you might want to grab for redhat's CVS. I also noticed Phoebe (8.1
beta) only has dejagnu 1.4.2 still... :-)
- rob -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-05 18:04 ` Rob Savoye
@ 2003-03-05 18:36 ` Andrew Cagney
2003-03-05 19:39 ` Rob Savoye
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-03-05 18:36 UTC (permalink / raw)
To: Rob Savoye, Alexandre Oliva; +Cc: gdb-patches
> On Wed, Mar 05, 2003 at 02:34:52AM -0300, Alexandre Oliva wrote:
>
>
>> we can take advantage of file sharing to upload and download files
>> to/from the board. This patch implements this feature. Ok to
>> install in the sources.redhat.com repository?
>
>
> Looks ok to me. I can't test it, but it looks fine. I'll check this into
> savannah. Oh, there is a patch on savannah dealing with header file include
> paths you might want to grab for redhat's CVS. I also noticed Phoebe (8.1
> beta) only has dejagnu 1.4.2 still... :-)
Alex, that's your up stream aproval. So yes.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-05 18:36 ` Andrew Cagney
@ 2003-03-05 19:39 ` Rob Savoye
2003-03-07 16:37 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Rob Savoye @ 2003-03-05 19:39 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Alexandre Oliva, gdb-patches
On Wed, Mar 05, 2003 at 01:36:16PM -0500, Andrew Cagney wrote:
> > beta) only has dejagnu 1.4.2 still... :-)
>
> Alex, that's your up stream aproval. So yes.
If you know of any problems in 1.4.3 that would prevent upgrading, let
me know, as I'm slowly working towards the 1.4.4 release. I could crank
that out much faster if there was a major issue to fix. One main difference,
1.4.3 has XML output, KFAIL/KPASS support, and a new tutorial, plus GCC 3.x
support for the one C++ testcase.
There is also a revised rpm spec file, so it should be easy to build
the package. (I also added Solaris, Debian, and HPUX packaging formats as
well)
- rob -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-05 19:39 ` Rob Savoye
@ 2003-03-07 16:37 ` Andrew Cagney
2003-03-07 17:10 ` Rob Savoye
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2003-03-07 16:37 UTC (permalink / raw)
To: Rob Savoye; +Cc: Alexandre Oliva, gdb-patches
> If you know of any problems in 1.4.3 that would prevent upgrading, let
> me know, as I'm slowly working towards the 1.4.4 release. I could crank
> that out much faster if there was a major issue to fix. One main difference,
> 1.4.3 has XML output, KFAIL/KPASS support, and a new tutorial, plus GCC 3.x
> support for the one C++ testcase.
FYI, I do know that this `hack' keeps rearing its ugly head.
2001-11-12 Andrew Cagney <ac131313@redhat.com>
* lib/remote.exp (local_exec, standard_close): Use SHELL
background instead of tcl background to background the kill
processes. Work around problem found by Nick Duffek in older
CYGWINs.
(turns out that newer cygwin's have the same problem).
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-07 16:37 ` Andrew Cagney
@ 2003-03-07 17:10 ` Rob Savoye
2003-03-07 19:15 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Rob Savoye @ 2003-03-07 17:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Alexandre Oliva, gdb-patches
On Fri, Mar 07, 2003 at 11:37:09AM -0500, Andrew Cagney wrote:
> FYI, I do know that this `hack' keeps rearing its ugly head.
Man, a hack is right! :-) I guess I should migrate this into my
sources, but don't have anyway to test it, I'm a Unix/embedded systems
bigot, with no Win32 machines at all.
- rob -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: DejaGnu: support nfsdir and nfsroot_server
2003-03-07 17:10 ` Rob Savoye
@ 2003-03-07 19:15 ` Andrew Cagney
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2003-03-07 19:15 UTC (permalink / raw)
To: Rob Savoye; +Cc: Alexandre Oliva, gdb-patches
> On Fri, Mar 07, 2003 at 11:37:09AM -0500, Andrew Cagney wrote:
>
>
>> FYI, I do know that this `hack' keeps rearing its ugly head.
>
>
> Man, a hack is right! :-) I guess I should migrate this into my
> sources, but don't have anyway to test it, I'm a Unix/embedded systems
> bigot, with no Win32 machines at all.
If it works on unix, I'm sure we can find someone to test it on cygwin.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-03-07 19:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-05 5:34 DejaGnu: support nfsdir and nfsroot_server Alexandre Oliva
2003-03-05 18:04 ` Rob Savoye
2003-03-05 18:36 ` Andrew Cagney
2003-03-05 19:39 ` Rob Savoye
2003-03-07 16:37 ` Andrew Cagney
2003-03-07 17:10 ` Rob Savoye
2003-03-07 19:15 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox