public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: rmoseley@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Merge branch 'master' of ssh://sources.redhat.com/git/frysk
Date: Wed, 23 Jan 2008 21:10:00 -0000	[thread overview]
Message-ID: <20080123211015.12985.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  676f01bb93ede4110acaab1912da55e382d33120 (commit)
       via  e45b4a3e21041a9463184ec410fcfbe7e954ab54 (commit)
      from  117422ccf61c585a3f3abe6ac091ffa59f372d9b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 676f01bb93ede4110acaab1912da55e382d33120
Merge: e45b4a3e21041a9463184ec410fcfbe7e954ab54 117422ccf61c585a3f3abe6ac091ffa59f372d9b
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Wed Jan 23 15:09:51 2008 -0600

    Merge branch 'master' of ssh://sources.redhat.com/git/frysk

commit e45b4a3e21041a9463184ec410fcfbe7e954ab54
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Wed Jan 23 15:03:14 2008 -0600

    Fix bug where wrong parameter list was generated when running multiple times.
    
    * StartRun.java: Fix bug when multiple runs the correct
      parameter list is generated.

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

Summary of changes:
 frysk-core/frysk/hpd/ChangeLog     |    2 +
 frysk-core/frysk/hpd/StartRun.java |   48 ++++++++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 13 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index d984f64..d35a0e6 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -2,6 +2,8 @@
 
 	* TestRunCommand.java (testRunCommandParamter): New.
 	* TestStartCommand.java (testStartCommandParameter): New.
+	* StartRun.java: Fix bug when multiple runs the correct
+	parameter list is generated.
 
 2008-01-21  Andrew Cagney  <cagney@redhat.com>
 
diff --git a/frysk-core/frysk/hpd/StartRun.java b/frysk-core/frysk/hpd/StartRun.java
index c8f340c..1d803d8 100644
--- a/frysk-core/frysk/hpd/StartRun.java
+++ b/frysk-core/frysk/hpd/StartRun.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 //
-// Copyright 2007, Red Hat Inc.
+// Copyright 2007, 2008 Red Hat Inc.
 //
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -125,14 +125,11 @@ class StartRun extends ParameterizedCommand {
     }
     
     public void interpretRun(CLI cli, Input cmd, Object options) {
-	//System.out.println("StartRun.interpretRun");
 	runToBreak = true;
 	interpretCmd(cli, cmd, options);
     }
     
     public void interpretStart(CLI cli, Input cmd, Object options)  {
-	//System.out.println("StartRun.interpretStart");
-	//cli.execCommand("focus\n");
 	runToBreak = false;
 	interpretCmd(cli, cmd, options);
     }
@@ -243,23 +240,48 @@ class StartRun extends ParameterizedCommand {
 	    }
 	}
     }
+    
+    /**
+     * getParameters figures out what parameters to send back to start/run the process with;
+     * 	if no parameters are entered, use the previous ones if any were entered; if
+     *  parameters were entered, use those.
+     *  
+     * @param cmd is the Input object containing the command and any paramaters
+     * @param task is the Task object of the process that was previously run
+     * @return a String containing the parameters to be used in starting/running
+     *         the process
+     */
 
     private String getParameters(Input cmd, Task task) {
 	if (cmd.size() < 1) {
-	    // No params entered, use this proc's previous params
+	    // No params entered, use this proc's previous params(if any)
 	    Proc proc = task.getProc();
-	    return parseParameters(proc.getCmdLine());
-	    //Proc had no previous params, send back empty param list
-	} else
-	    return parseParameters(cmd.stringArrayValue());
+	    return parseParameters(proc.getCmdLine(), true);
+	} else//Proc had no previous params, send back empty param list
+	    // There were parameters entered, use those
+	    return parseParameters(cmd.stringArrayValue(), false);
     }
     
-    private String parseParameters(String[] parameters) {
+    /**
+     * parseParameters takes a String array and returns a space-delimited String
+     * @param parameters is the String array to convert
+     * @param which indicates whether or not to skip the first parameter
+     * @return a String of the parameters separated by spaces
+     */
+    private String parseParameters(String[] parameters, boolean which) {
 	if (parameters == null || parameters.length <= 0)
 		return "";
-	    String paramList = "";
-	    for (int i = 0; i < parameters.length; i++) 
-		paramList = paramList + parameters[i] + " ";
+	int i;
+	if (which)
+	    // In this case skip the first parameter which is the path to the process
+	    i = 1;
+	else
+	    // In this case, get all of the parameters which does not include the process
+	    i = 0;
+	String paramList = "";
+	for (int j = i; j < parameters.length; j++) 
+	    paramList = paramList + parameters[j] + " ";
+	    System.out.println("StartRun.parseParameters");
 	    return paramList;
     }
     


hooks/post-receive
--
frysk system monitor/debugger


             reply	other threads:[~2008-01-23 21:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 21:10 rmoseley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-06-05 15:33 rmoseley
2008-05-12 16:30 rmoseley
2008-05-12 16:07 pmuldoon
2008-05-09 17:29 rmoseley
2008-04-02 22:41 pmuldoon
2008-04-01 12:28 pmuldoon
2008-03-20 20:20 rmoseley
2008-03-18 16:22 pmuldoon
2008-02-26 15:32 pmuldoon
2008-01-24 19:23 rmoseley
2008-01-03 16:55 pmuldoon
2007-12-13 20:18 rmoseley
2007-12-04 17:45 jflavio
2007-11-30  4:24 jflavio
2007-11-28 21:40 jflavio
2007-11-28 16:20 jflavio
2007-11-28 13:08 pmuldoon
2007-11-28 12:04 mark
2007-11-20 22:47 scox
2007-11-19 17:58 scox
2007-11-17  8:35 rmoseley
2007-11-16 15:59 scox
2007-11-16 14:59 pmuldoon
2007-11-14  2:38 scox
2007-11-14  2:09 jflavio
2007-11-13  0:41 scox
2007-11-10 14:47 jflavio
2007-11-10  0:34 scox
2007-11-09 14:59 jflavio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080123211015.12985.qmail@sourceware.org \
    --to=rmoseley@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).