[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Patch



Jens Seidel schrieb:
Chris Leick wrote:

-----------cut here -----start--------

--- corStruct.R 2008-02-11 15:05:14.000000000 +0100
+++ corStruct.R.orig    2009-05-08 09:32:56.000000000 +0200

Oops, ist corStruct.R.orig wirklich die ursprüngliche Datei und corStruct.R
deine Korrektur? Dann hast du die Parameter von diff verwechselt, es sollte
diff -u orig neu > meinPatch heißen.

Ich habe die Änderungen in den .orig-Dateien vorgenommen. War das richtig?

-----------cut here -----end--------

Arbeite nicht mit "cut here", sondern kombiniere die Änderungen für die drei
Zeichenketten in einem Patch. Dazu kannst du die einzelnen Patches einfach
aneinanderhängen oder besser noch diff rekursiv mit Option -r aufrufen.

Auch wenn es drei verschiedene Dateien betrifft? Wie bekomme ich hier den Pfad in die Datei? Es könnte immerhin sein, dass mehrere Dateien mit gleichem Namen in unterschiedlichen Pfaden liegen.

Diese Patches solltest du dann testen, indem du sie auf ein unverändertes
Quellcodepaket mit patch -p1 -i patchFile anwendest. Wenn du Lust hast,
danach am besten das Paket aus dem Quellcode bauen (ist einfach!):

$ cd nlme-3.1.90-1
# apt-get build-dep nlme
# apt-get install build-essential dpkg-dev fakeroot
$ dpkg-buildpackage -rfakeroot -us -uc
# dpkg -i ../*.deb

Werde ich testen. Aber vorher noch eine Frage:

Dies sollte ein anderer Patch werden, da er einen richtigen Fehler
korrigiert und nicht wie oben nur etwas konsistent macht.

Concatenation of multiple parts of a string to simplify translations:
+          warning("Cannot use smaller level of grouping for\n",
+                        "\"correlation\" than for \"random\". Replacing\n",
+                        "the former with the latter.")

Gehört mit in den letzten Patch.
Wenn ich zu der gleichen Datei zwei Patches erstelle, stimmen ggf. die Zeilennummern des zweiten nur, wenn man den ersten in der vorher einspielt. Wäre es nicht besser alle Patches pro Datei zusammenzufassen?



Nächster Versuch (Vorbehaltlich des write()-Tests):

-------------
Package: nlme
Version: 3.1.90-1
Severity: minor
Tags: Patch

Hi,

The following patch should fix some errors and oddities.

corStruct.R.diff:

These strings need to be translated independently and it is possible to
reduce these to a single string to reduce translators work.


nlme.R.diff:
lme.R.diff:

Patch fixes a grammatical error (missing "of")


gnls.diff:
Translation of multiple parts of a single string may be difficult.

Greetings,
Chris
--- corStruct.R.orig	2009-05-08 09:32:56.000000000 +0200
+++ corStruct.R	2008-02-11 15:05:14.000000000 +0100
@@ -2144,7 +2144,7 @@
 	}
       }
       if ((val[2] <= 0) || (val[2] >= 1)) {
-	stop("Initial value of nugget ratio must be between 0 and 1")
+	stop("Initial value of nugget ratio must be in (0,1)")
       }
     } else {				# only range parameter
       if (length(val) != 1) {
--- gnls.R.orig	2009-05-08 09:49:09.000000000 +0200
+++ gnls.R	2009-05-08 09:46:00.000000000 +0200
@@ -271,7 +271,7 @@
   }
   pLen <- length(pn)
   if (length(start) != pLen)
-    stop ("starting values for parameters are not of the correct length")
+    stop ("starting values for parameters are not the correct length")
   spar <- start
   names(spar) <- pn
   NReal <- sum(naPat)
--- lme.R.orig	2009-05-08 09:59:44.000000000 +0200
+++ lme.R	2009-05-08 09:56:51.000000000 +0200
@@ -197,9 +197,9 @@
                      "and \"correlation\""))
         }
         if (corQ < lmeQ) {
-          warning("Cannot use smaller level of grouping for\n",
-                        "\"correlation\" than for \"random\". Replacing\n",
-                        "the former with the latter.")
+          warning(paste("Cannot use smaller level of grouping for",
+                        "\"correlation\" than for \"random\". Replacing",
+                        "the former with the latter."))
           attr(correlation, "formula") <-
             eval(parse(text = paste("~",
                     c_deparse(getCovariateFormula(formula(correlation))[[2]]),
--- nlme.R.orig	2009-05-08 10:01:38.000000000 +0200
+++ nlme.R	2009-05-08 09:46:13.000000000 +0200
@@ -331,9 +331,9 @@
                      "and \"correlation\""))
         }
         if (corQ < lmeQ) {
-          warning("Cannot use smaller level of grouping for\n",
-                        "\"correlation\" than for \"random\". Replacing\n",
-                        "the former with the latter.")
+          warning(paste("Cannot use smaller level of grouping for",
+                        "\"correlation\" than for \"random\". Replacing",
+                        "the former with the latter."))
           attr(correlation, "formula") <-
             eval(parse(text = paste("~",
                     c_deparse(getCovariateFormula(formula(correlation))[[2]]),
@@ -523,7 +523,7 @@
   }
   fLen <- length(fn)
   if (length(sfix) != fLen)
-    stop ("starting values for the fixed component are not of the correct length")
+    stop ("starting values for the fixed component are not the correct length")
   names(sfix) <- fn
   ##
   ## Random effects names

Reply to: