public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* pkglibexecdir
@ 2006-12-12 11:20 Stepan Kasal
  2006-12-12 14:32 ` pkglibexecdir Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Stepan Kasal @ 2006-12-12 11:20 UTC (permalink / raw)
  To: frysk

Hello,
  the string "pkglibexec" is still present in the following files:
./frysk-core/frysk/pkglibdir/funit-threads.xml
./frysk-core/frysk/pkglibdir/funit-exit.xml
./frysk-core/frysk/pkglibdir/funit.xml
./frysk-core/frysk/pkglibdir/funit-child.xml
./frysk-core/frysk/pkglibdir/funit-exec.xml
./Makefile.am
./frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in
./frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml
./frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml
./frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml
./frysk-imports/frysk/Config.javain

find -name CVS -prune -o ! -name ChangeLog -type f -print0|
  xargs -0 grep pkglibexec

I guess it is safe to s/pkglibexec/pkglib/.  Am I missing something?

Stepan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pkglibexecdir
  2006-12-12 11:20 pkglibexecdir Stepan Kasal
@ 2006-12-12 14:32 ` Andrew Cagney
  2006-12-12 21:59   ` pkglibexecdir Stepan Kasal
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2006-12-12 14:32 UTC (permalink / raw)
  To: frysk

Good catch,
Can you create a bug, if it is replacing @pkglibexecdir@ with 
@pkglibdir@ then yea, it is straight forward and feel to fix, but if it 
isn't, put it in the bug :-)
Andrew

Stepan Kasal wrote:
> Hello,
>   the string "pkglibexec" is still present in the following files:
> ./frysk-core/frysk/pkglibdir/funit-threads.xml
> ./frysk-core/frysk/pkglibdir/funit-exit.xml
> ./frysk-core/frysk/pkglibdir/funit.xml
> ./frysk-core/frysk/pkglibdir/funit-child.xml
> ./frysk-core/frysk/pkglibdir/funit-exec.xml
> ./Makefile.am
> ./frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in
> ./frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml
> ./frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml
> ./frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml
> ./frysk-imports/frysk/Config.javain
>
> find -name CVS -prune -o ! -name ChangeLog -type f -print0|
>   xargs -0 grep pkglibexec
>
> I guess it is safe to s/pkglibexec/pkglib/.  Am I missing something?
>
> Stepan
>   

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pkglibexecdir
  2006-12-12 14:32 ` pkglibexecdir Andrew Cagney
@ 2006-12-12 21:59   ` Stepan Kasal
  2006-12-13 13:56     ` pkglibexecdir Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Stepan Kasal @ 2006-12-12 21:59 UTC (permalink / raw)
  To: frysk

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

Hello,

On Tue, Dec 12, 2006 at 09:31:50AM -0500, Andrew Cagney wrote:
> Can you create a bug, if it is replacing @pkglibexecdir@ with 
> @pkglibdir@ then yea, it is straight forward and feel to fix, 

actually, I think it's all trivial.

Morover, I removed the support for libexec_PROGRAMS from
Makefile.rules, because we should not encourage using libexec.

The resulting patch is attached, I'm going to commit it tomorrow, as
soon as I verify that it does not break the build.

Andrew, it seems that you generate the commit message from the
ChangeLog files automatically; could you please give me your commit
script you use for that?

Thanks,
	Stepan Kasal

[-- Attachment #2: frysk-libexec-lib.patch --]
[-- Type: text/plain, Size: 16420 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-top/ChangeLog,v
retrieving revision 1.69
diff -u -r1.69 ChangeLog
--- ChangeLog	9 Dec 2006 22:58:25 -0000	1.69
+++ ChangeLog	12 Dec 2006 21:49:42 -0000
@@ -1,3 +1,9 @@
+2006-12-12  Stepan Kasal  <skasal@redhat.com>
+
+	* Makefile.am: Replace pkglibexecdir with pkglibdir here, too.
+
+	* htdocs/build/index.html: Reflect the change and fix typos.
+
 2006-12-09  Andrew Cagney  <cagney@redhat.com>
 
 	* Makefile.am (javadoc): Copy over .jpg and package.html files.
Index: Makefile.am
===================================================================
RCS file: /cvs/frysk/frysk-top/Makefile.am,v
retrieving revision 1.32
diff -u -r1.32 Makefile.am
--- Makefile.am	9 Dec 2006 22:58:25 -0000	1.32
+++ Makefile.am	12 Dec 2006 21:49:42 -0000
@@ -59,7 +59,7 @@
 	$(srcdir)/frysk-imports/getopt/src/getopt/gnu \
 	$(srcdir)/frysk-imports/jline/src/jline \
 	$(srcdir)/frysk-imports/junit/src/junit \
-	$(srcdir)/frysk-core/frysk/pkglibexecdir/. \
+	$(srcdir)/frysk-core/frysk/pkglibdir/. \
 	$(srcdir)/frysk-core/frysk/bindir/. \
 	$(srcdir)/frysk-gui/frysk/bindir/. \
 	$(empty)
Index: common/ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-common/ChangeLog,v
retrieving revision 1.273
diff -u -r1.273 ChangeLog
--- common/ChangeLog	11 Dec 2006 21:08:07 -0000	1.273
+++ common/ChangeLog	12 Dec 2006 21:49:42 -0000
@@ -1,3 +1,10 @@
+2006-12-12  Stepan Kasal  <skasal@redhat.com>
+
+	* common/Makefile.rules: Remove the support for libexecdir
+	programs; it's not compatible with multilib.
+	* common/Makefile.gen.sh: Do not mention libexecdir in the
+	help; mention pkglibdir instead.
+
 2006-12-11  Andrew Cagney  <cagney@redhat.com>
 
 	* Makefile.rules (checked-for-eclipse-residue): Exit when fail.
Index: common/Makefile.gen.sh
===================================================================
RCS file: /cvs/frysk/frysk-common/Makefile.gen.sh,v
retrieving revision 1.119
diff -u -r1.119 Makefile.gen.sh
--- common/Makefile.gen.sh	11 Dec 2006 16:44:34 -0000	1.119
+++ common/Makefile.gen.sh	12 Dec 2006 21:49:42 -0000
@@ -52,9 +52,9 @@
 .javain, .c and .cxx files.  For each, generate a corresponding
 automake entry.  If the file contains a main program, also generate
 automake to build the corresponding program.  Any program located
-under a bindir/, sbindir/, or libexecdir/ sub-directory, will be
-installed in the corresponding bin/, sbin/, or libexec/ destination
-directory.
+under a bindir/, sbindir/, or pkglibdir/ sub-directory, will be
+installed in the corresponding bin/, sbin/, or lib{,64}/frysk/
+destination directory.
 
 <.jar-file> or <_JAR-macro>:
 
Index: common/Makefile.rules
===================================================================
RCS file: /cvs/frysk/frysk-common/Makefile.rules,v
retrieving revision 1.155
diff -u -r1.155 Makefile.rules
--- common/Makefile.rules	11 Dec 2006 21:08:07 -0000	1.155
+++ common/Makefile.rules	12 Dec 2006 21:49:42 -0000
@@ -48,7 +48,6 @@
 noinst_DATA =
 bin_PROGRAMS =
 sbin_PROGRAMS =
-libexec_PROGRAMS =
 pkgdata_DATA =
 pkglib_PROGRAMS =
 pkglibdir = $(libdir)/@PACKAGE@
@@ -221,7 +220,6 @@
 		-e 's,[@]prefix[@],@prefix@,g' \
 		-e 's,[@]bindir[@],@bindir@,g' \
 		-e 's,[@]libdir[@],@libdir@,g' \
-		-e 's,[@]libexecdir[@],@libexecdir@,g' \
 		-e 's,[@]datadir[@],@datadir@,g' \
 		-e 's,[@]builddir[@],@top_builddir@,g' \
 		-e 's,[@]srcdir[@],@top_srcdir@,g' \
Index: frysk-core/frysk/pkglibdir/ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/ChangeLog,v
retrieving revision 1.1
diff -u -r1.1 ChangeLog
--- frysk-core/frysk/pkglibdir/ChangeLog	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/ChangeLog	12 Dec 2006 21:49:42 -0000
@@ -1,3 +1,12 @@
+2006-12-12  Stepan Kasal  <skasal@redhat.com>
+
+	* funit-child.xml: s/pkglibexecdir/pkglibdir/
+	* funit-exec.xml: Ditto.
+	* funit-exit.xml: Ditto.
+	* funit-threads.xml: Ditto.
+	* funit.xml: Ditto.
+	* funit.java: Replace Config.PKGLIBEXEC*DIR with Config.PKGLIB*DIR.
+
 2006-12-10  Andrew Cagney  <cagney@redhat.com>
 
 	* Moved from ../pkglibexecdir/.
Index: frysk-core/frysk/pkglibdir/funit-child.xml
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit-child.xml,v
retrieving revision 1.1
diff -u -r1.1 funit-child.xml
--- frysk-core/frysk/pkglibdir/funit-child.xml	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit-child.xml	12 Dec 2006 21:49:42 -0000
@@ -67,7 +67,7 @@
   
   <refsynopsisdiv>
     <cmdsynopsis>
-      <command>@pkglibexecdir@/funit-child</command>
+      <command>@pkglibdir@/funit-child</command>
     </cmdsynopsis>
   </refsynopsisdiv>
   
@@ -99,7 +99,7 @@
   
   <refsect1>
     <title>EXAMPLE</title>
-    <screen>@pkglibexecdir@/funit-child</screen>
+    <screen>@pkglibdir@/funit-child</screen>
   </refsect1>
    
   <!-- refsect1>
Index: frysk-core/frysk/pkglibdir/funit-exec.xml
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit-exec.xml,v
retrieving revision 1.1
diff -u -r1.1 funit-exec.xml
--- frysk-core/frysk/pkglibdir/funit-exec.xml	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit-exec.xml	12 Dec 2006 21:49:42 -0000
@@ -67,7 +67,7 @@
   
   <refsynopsisdiv>
     <cmdsynopsis>
-      <command>@pkglibexecdir@/funit-exec</command>
+      <command>@pkglibdir@/funit-exec</command>
       <arg choice="opt">
         <option>-<replaceable>N</replaceable></option>
       </arg>
@@ -162,7 +162,7 @@
     <title>EXAMPLE</title>
     <para>Create a process that, on receipt of SIGUSR1, will exec
     <function>/bin/echo</function>.</para>
-    <screen>@pkglibexecdir@/funit-child $$ 0 100 /bin/echo hello</screen>
+    <screen>@pkglibdir@/funit-child $$ 0 100 /bin/echo hello</screen>
   </refsect1>
    
   <!-- refsect1>
Index: frysk-core/frysk/pkglibdir/funit-exit.xml
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit-exit.xml,v
retrieving revision 1.1
diff -u -r1.1 funit-exit.xml
--- frysk-core/frysk/pkglibdir/funit-exit.xml	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit-exit.xml	12 Dec 2006 21:49:42 -0000
@@ -127,7 +127,7 @@
   
   <refsect1>
     <title>EXAMPLE</title>
-    <screen>@pkglibexecdir@/funit</screen>
+    <screen>@pkglibdir@/funit</screen>
   </refsect1>
    
   <!-- refsect1>
Index: frysk-core/frysk/pkglibdir/funit-threads.xml
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit-threads.xml,v
retrieving revision 1.1
diff -u -r1.1 funit-threads.xml
--- frysk-core/frysk/pkglibdir/funit-threads.xml	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit-threads.xml	12 Dec 2006 21:49:42 -0000
@@ -67,7 +67,7 @@
   
   <refsynopsisdiv>
     <cmdsynopsis>
-      <command>@pkglibexecdir@/funit-threads</command>
+      <command>@pkglibdir@/funit-threads</command>
       <arg choice="opt">
         <option>--clone</option>
       </arg>
@@ -171,7 +171,7 @@
   
   <refsect1>
     <title>EXAMPLE</title>
-    <screen>@pkglibexecdir@/funit-child</screen>
+    <screen>@pkglibdir@/funit-child</screen>
   </refsect1>
    
   <!-- refsect1>
Index: frysk-core/frysk/pkglibdir/funit.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit.java,v
retrieving revision 1.1
diff -u -r1.1 funit.java
--- frysk-core/frysk/pkglibdir/funit.java	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit.java	12 Dec 2006 21:49:42 -0000
@@ -64,13 +64,13 @@
 	LinkedList arch32List = new LinkedList();
 	arch32List.addAll (frysk.core.JUnitTests.get ());
 
-	Paths.setPrefixes (Config.PKGLIBEXEC_ARCH32DIR + File.separator,
+	Paths.setPrefixes (Config.PKGLIB_ARCH32DIR + File.separator,
 			   Config.PKGDATADIR + "/");
 
 	int status = testRunner.runTestCases
 	    (Config.PKGDATADIR + "/",
-	     list, Config.PKGLIBEXECDIR + "/",
-	     arch32List, Config.PKGLIBEXEC_ARCH32DIR + "/");
+	     list, Config.PKGLIBDIR + "/",
+	     arch32List, Config.PKGLIB_ARCH32DIR + "/");
 	System.exit (status);
     }
 }
Index: frysk-core/frysk/pkglibdir/funit.xml
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/pkglibdir/funit.xml,v
retrieving revision 1.1
diff -u -r1.1 funit.xml
--- frysk-core/frysk/pkglibdir/funit.xml	11 Dec 2006 04:18:05 -0000	1.1
+++ frysk-core/frysk/pkglibdir/funit.xml	12 Dec 2006 21:49:42 -0000
@@ -202,7 +202,7 @@
   
   <refsect1>
     <title>EXAMPLE</title>
-    <screen>@pkglibexecdir@/funit</screen>
+    <screen>@pkglibdir@/funit</screen>
   </refsect1>
    
   <!-- refsect1>
Index: frysk-gui/frysk/gui/ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/ChangeLog,v
retrieving revision 1.420
diff -u -r1.420 ChangeLog
--- frysk-gui/frysk/gui/ChangeLog	11 Dec 2006 15:20:43 -0000	1.420
+++ frysk-gui/frysk/gui/ChangeLog	12 Dec 2006 21:49:43 -0000
@@ -1,3 +1,10 @@
+2006-12-12  Stepan Kasal  <skasal@redhat.com>
+
+	* test/dogtail_scripts/Test2921.xml: s/pkglibexecdir/pkglibdir/
+	* test/dogtail_scripts/funit_new_session.xml: Ditto.
+	* test/dogtail_scripts/another_new_session.xml: Ditto.
+	* test/dogtail_scripts/frysk_suite.in: Ditto.
+
 2006-12-11  Andrew Cagney  <cagney@redhat.com>
 
 	* test/dogtail_scripts/.cvsignore: Cite bug 3227.
Index: frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml,v
retrieving revision 1.4
diff -u -r1.4 Test2921.xml
--- frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml	18 Aug 2006 20:48:56 -0000	1.4
+++ frysk-gui/frysk/gui/test/dogtail_scripts/Test2921.xml	12 Dec 2006 21:49:43 -0000
@@ -1,7 +1,7 @@
 <Session type="frysk.gui.sessions.Session" name="NewFryskSession" tooltip="NoTooltip">
   <procs>
     <elements>
-      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/home/ldimaggi/sandbox/build/frysk-core/frysk/pkglibexecdir/funit-child">
+      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/home/ldimaggi/sandbox/build/frysk-core/frysk/pkglibdir/funit-child">
         <observers>
           <element name="Terminating Observer" />
           <element name="Exec Observer" />
Index: frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml,v
retrieving revision 1.10
diff -u -r1.10 another_new_session.xml
--- frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml	18 Aug 2006 20:48:56 -0000	1.10
+++ frysk-gui/frysk/gui/test/dogtail_scripts/another_new_session.xml	12 Dec 2006 21:49:43 -0000
@@ -1,7 +1,7 @@
 <Session type="frysk.gui.sessions.Session" name="NewFryskSession" tooltip="NoTooltip">
   <procs>
     <elements>
-      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/home/ldimaggi/sandbox/build/frysk-core/frysk/pkglibexecdir/funit-child">
+      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/home/ldimaggi/sandbox/build/frysk-core/frysk/pkglibdir/funit-child">
         <observers>
           <element name="Terminating Observer" />
           <element name="Exec Observer" />
Index: frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in,v
retrieving revision 1.22
diff -u -r1.22 frysk_suite.in
--- frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in	19 Oct 2006 18:43:55 -0000	1.22
+++ frysk-gui/frysk/gui/test/dogtail_scripts/frysk_suite.in	12 Dec 2006 21:49:43 -0000
@@ -49,7 +49,7 @@
 
 frysk="@abs_builddir@/frysk/gui/FryskGui"
 src="@abs_srcdir@/frysk/gui/test/dogtail_scripts/"
-funitChild="@abs_builddir@/../frysk-core/frysk/pkglibexecdir/funit-child"
+funitChild="@abs_builddir@/../frysk-core/frysk/pkglibdir/funit-child"
 
 # Import needed to access test file input files via envron var's
 import os
Index: frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml
===================================================================
RCS file: /cvs/frysk/frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml,v
retrieving revision 1.1
diff -u -r1.1 funit_new_session.xml
--- frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml	2 Aug 2006 17:28:23 -0000	1.1
+++ frysk-gui/frysk/gui/test/dogtail_scripts/funit_new_session.xml	12 Dec 2006 21:49:43 -0000
@@ -1,7 +1,7 @@
 <Session type="frysk.gui.sessions.Session" name="NewFryskSession" tooltip="NoTooltip">
   <procs>
     <elements>
-      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/notnfs/frysk-build/frysk-core/frysk/pkglibexecdir/funit-child">
+      <element type="frysk.gui.sessions.DebugProcess" name="funit-child" tooltip="funit-child" executablePath="/notnfs/frysk-build/frysk-core/frysk/pkglibdir/funit-child">
         <observers>
           <element name="Terminating Observer" />
           <element name="Exec Observer" />
Index: frysk-imports/frysk/ChangeLog
===================================================================
RCS file: /cvs/frysk/frysk-imports/frysk/ChangeLog,v
retrieving revision 1.18
diff -u -r1.18 ChangeLog
--- frysk-imports/frysk/ChangeLog	25 Sep 2006 06:57:43 -0000	1.18
+++ frysk-imports/frysk/ChangeLog	12 Dec 2006 21:49:49 -0000
@@ -1,3 +1,9 @@
+2006-12-12  Stepan Kasal  <skasal@redhat.com>
+
+	* Config.javain (PKGLIBEXECDIR): Remove.
+	(PKGLIBEXEC_ARCH32DIR): Rename to ...
+	(PKGLIB_ARCH32DIR): ... this.
+
 2006-09-25  Yong Zheng  <zhengyo@cn.ibm.com>
 
 	* Config.javain (PKGLIBEXEC_ARCH32DIR): Add.
Index: frysk-imports/frysk/Config.javain
===================================================================
RCS file: /cvs/frysk/frysk-imports/frysk/Config.javain,v
retrieving revision 1.10
diff -u -r1.10 Config.javain
--- frysk-imports/frysk/Config.javain	25 Sep 2006 06:57:43 -0000	1.10
+++ frysk-imports/frysk/Config.javain	12 Dec 2006 21:49:49 -0000
@@ -57,10 +57,9 @@
     public static final String IMAGEDIR = "@imagedir@";
     public static final String PKGDATADIR = "@pkgdatadir@";
     public static final String PKGLIBDIR = "@pkglibdir@";
-    public static final String PKGLIBEXECDIR = "@pkglibexecdir@";
     public static final String PKGINCLUDEDIR = "@pkgincludedir@";
 
-    public static final String PKGLIBEXEC_ARCH32DIR = "@pkglibexec_arch32dir@";
+    public static final String PKGLIB_ARCH32DIR = "@pkglib_arch32dir@";
     public static final String VERSION = "@VERSION@";
 
     // User's config directory.
Index: htdocs/build/index.html
===================================================================
RCS file: /cvs/frysk/htdocs/build/index.html,v
retrieving revision 1.128
diff -u -r1.128 index.html
--- htdocs/build/index.html	7 Dec 2006 18:58:25 -0000	1.128
+++ htdocs/build/index.html	12 Dec 2006 21:49:51 -0000
@@ -90,7 +90,7 @@
 </pre>
 
 In addition, on the PowerPC, check that the following packages were
-installed::
+installed:
 
 <pre>
 sudo yum install -y \
@@ -367,11 +367,11 @@
 <dt>How do I refer to an external executable or data file in a
 test?<dt> <dd>Use:<dl>
 <dt><tt>frysk.junit.Paths.getExecPrefix()</tt></dt> <dd>Which will
-refer to either the installed <tt>libexec/frysk/</tt> or build tree
-<tt>frysk/pkglibexecdir</tt></dd>
+refer to either the installed <tt>lib{,64}/frysk/</tt> or build tree
+<tt>frysk/pkglibdir</tt></dd>
 <dt><tt>frysk.junit.Paths.getDataPrefix()</tt></dt> <dd>Which will
 refer to either the installed <tt>share/frysk/</tt> or build tree
-<tt>frysk/pkgdatadirdir</tt></dd> </dl> </dd>
+<tt>frysk/pkgdatadir</tt></dd> </dl> </dd>
 
 <dt>The tesets in the <tt>frysk-imports/tests/</tt> and
 <tt>frysk-gtk/tests/</tt> directories exercise bugs in components such

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: pkglibexecdir
  2006-12-12 21:59   ` pkglibexecdir Stepan Kasal
@ 2006-12-13 13:56     ` Andrew Cagney
  2006-12-13 17:12       ` A commit script (was: Re: pkglibexecdir) Stepan Kasal
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2006-12-13 13:56 UTC (permalink / raw)
  To: frysk

Stepan Kasal wrote:
> Andrew, it seems that you generate the commit message from the
> ChangeLog files automatically; could you please give me your commit
> script you use for that?
>   
It isn't automatic, but I've done it so often it is something of a 
reflex, I just prune down the diff to just contain the ChangeLog entries 
and suck that into the CVS commit message.  Your point does make for 
interesting ideas though.

Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* A commit script (was: Re: pkglibexecdir)
  2006-12-13 13:56     ` pkglibexecdir Andrew Cagney
@ 2006-12-13 17:12       ` Stepan Kasal
  0 siblings, 0 replies; 5+ messages in thread
From: Stepan Kasal @ 2006-12-13 17:12 UTC (permalink / raw)
  To: frysk

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Hello,

On Wed, Dec 13, 2006 at 08:55:52AM -0500, Andrew Cagney wrote:
> Stepan Kasal wrote:
> >Andrew, it seems that you generate the commit message from the
> >ChangeLog files automatically; could you please give me your commit
> >script you use for that?

> It isn't automatic, but I've done it so often it is something of a 
> reflex, [...]

Ralf Wildenhues has given me script called `commit', originated
in libtool CVS.  That's what I was using until now, calling it
without any options, or as `commit -1'.

I have edited it to allow multiple change logs, when specified on cmd
line, e.g.
	commit -C common/ChangeLog -C frysk-core/frysk/pkglibdir/ChangeLog \
	       -C ChangeLog

Attached please find the patched version of the script and my patch,
just in case someone is interested.

Stepan

[-- Attachment #2: commit --]
[-- Type: text/plain, Size: 29429 bytes --]

#!/bin/sh
# Generated from clcommit.m4sh; do not edit by hand

# clcommit (GNU libtool) version 0.16
# Written by Gary V. Vaughan <gary@gnu.org>
# and Alexandre Oliva <aoliva@redhat.com>

# Copyright (C) 1999, 2000, 2004, 2006 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, a copy can be downloaded from
# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.

# Usage: $progname [OPTION]... [--] [file|dir ...]

# -C FILE   --changelog=file   extract commit message from specified ChangeLog
#                              (can be used multiple times)
# -zN       --compress=N       set compression level (0-9, 0=none, 9=max)
#           --debug            enable verbose shell tracing
# -n        --dry-run          don't commit anything
#           --fast             same as --force --first
# -F file   --file=file        read commit message from file
# -1        --first            extract first entry from ChangeLog, no cvs diff
# -f        --force            don't check (unless *followed* by -n), and just
#                              display commit message instead of running $PAGER
#           --from=addr        override default from address in commit email
# -l        --local            don't descend into subdirectories
# -m msg    --message=msg      set commit message
#           --msg=msg          same as -m
# -r [FILE] --rcfile[=FILE]    read default option from FILE [./.clcommitrc]
# -q        --quiet            run cvs in quiet mode
# -s addr   --sendmail=addr    send a commit email of the differences to ADDR
#           --signature[=FILE] add FILE to the end of the email [~/.signature]
# -S TEXT   --summary=TEXT     specify a TEXT subject line for the commit email
# -t        --tla              use tla as the scm (and cvs in a dual tree)
# -v        --verbose          run in verbose mode
#           --version          print version information
# -h,-?     --help             print short or long help message

# This script eases checking in changes to CVS-maintained projects
# with ChangeLog files.  It will check that there have been no
# conflicting commits in the CVS repository and print which files it
# is going to commit to stderr.  A list of files to compare and to
# check in can be given in the command line.  If it is not given, all
# files in the current directory (and below, unless `-l' is given) are
# considered for check in.

# The commit message will be extracted from the differences between a
# file named ChangeLog* in the commit list, or named after -C, and the
# one in the repository (unless a message was specified with `-m' or
# `-F').  An empty message is not accepted (but a blank line is).  If
# the message is acceptable, it will be presented for verification
# (and possible edition) using the $PAGER environment variable (or
# `more', if it is not set, or `cat', if the `-f' switch is given).
# If $PAGER exits successfully, the modified files (at that moment)
# are checked in, unless `-n' was specified, in which case nothing is
# checked in.

# Report bugs to <gary@gnu.org>

: ${CVS="cvs"}
: ${TLA="tla"}
: ${MAILNOTIFY="mailnotify"}
: ${MKSTAMP="mkstamp"}

test -f "config/$MAILNOTIFY" && MAILNOTIFY="config/$MAILNOTIFY"
test -f "config/$MKSTAMP" && MKSTAMP="config/$MKSTAMP"

PROGRAM=clcommit

## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
elif test -n "${BASH_VERSION+set}${KSH_VERSION+set}${RANDOM+set}" &&
     (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh


# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi

# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi


# Find who we are.  Look in the path if we contain no path at all
# relative or not.
case $0 in
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  # FIXME: next line outputs $as_me, which is still unset.
  { echo "$as_me: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }; }
fi

# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
for as_var in \
  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  LC_TELEPHONE LC_TIME
do
  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
    eval $as_var=C; export $as_var
  else
    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi


# Name of the executable.
as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`


$as_unset CDPATH



: ${CP="cp -f"}
: ${ECHO="echo"}
: ${EGREP="egrep"}
: ${FGREP="fgrep"}
: ${GREP="grep"}
: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}

# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.

exit_status=$EXIT_SUCCESS

# Make sure IFS has a sensible default
lt_nl='
'
IFS=" 	$lt_nl"

dirname="s,/[^/]*$,,"
basename="s,^.*/,,"

# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath="$0"

# The name of this program:
# In the unlikely event $progname began with a '-', it would play havoc with
# func_echo (imagine progname=-n), so we prepend ./ in that case:
progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'`

# Make sure we have an absolute path for reexecution:
case $progpath in
  [\\/]*|[A-Za-z]:\\*) ;;
  *[\\/]*)
     progdir=`$ECHO "X$progpath" | $Xsed -e "$dirname"`
     progdir=`cd "$progdir" && pwd`
     progpath="$progdir/$progname"
     ;;
  *)
     save_IFS="$IFS"
     IFS=:
     for progdir in $PATH; do
       IFS="$save_IFS"
       test -x "$progdir/$progname" && break
     done
     IFS="$save_IFS"
     test -n "$progdir" || progdir=`pwd`
     progpath="$progdir/$progname"
     ;;
esac

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'

# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'

# Re-`\' parameter expansions in output of double_quote_subst that were
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
# in input to double_quote_subst, that '$' was protected from expansion.
# Since each input `\' is now two `\'s, look for any number of runs of
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.  Note
# that the embedded single quotes serve only to enhance readability.
sed_double_backslash='s/^\(\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/;
                s/\([^\\]\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/g'

# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
 A) # ASCII based system
    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  SP2NL='tr \040 \012'
  NL2SP='tr \015\012 \040\040'
  ;;
 *) # EBCDIC based system
  SP2NL='tr \100 \n'
  NL2SP='tr \r\n \100\100'
  ;;
esac

# Standard options:
opt_dry_run=false
opt_help=false
opt_quiet=false
opt_verbose=false

# func_echo arg...
# Echo program name prefixed message, along with the current mode
# name if it has been set yet.
func_echo ()
{
    $ECHO "$progname${mode+: }$mode: "${1+"$@"}
}

# func_verbose arg...
# Echo program name prefixed message in verbose mode only.
func_verbose ()
{
    $opt_verbose && func_echo ${1+"$@"}

    # A bug in bash halts the script if the last line of a function
    # fails when set -e is in force, so we need another command to
    # work around that:
    :
}

# func_error arg...
# Echo program name prefixed message to standard error.
func_error ()
{
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
}

# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
    $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
}

# func_fatal_error arg...
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
    func_error ${1+"$@"}
    exit $EXIT_FAILURE
}

# func_fatal_help arg...
# Echo program name prefixed message to standard error, followed by
# a help hint, and exit.
func_fatal_help ()
{
    func_error ${1+"$@"}
    func_fatal_error "$help"
}
help="Try \`$progname --help' for more information."  ## default


# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
    $GREP "$1" "$2" >/dev/null 2>&1
}


# func_mkdir_p directory-path
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
    my_directory_path="$1"
    my_dir_list=

    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then

      # Protect directory names starting with `-'
      case $my_directory_path in
        -*) my_directory_path="./$my_directory_path" ;;
      esac

      # While some portion of DIR does not yet exist...
      while test ! -d "$my_directory_path"; do
        # ...make a list in topmost first order.  Use a colon delimited
	# list incase some portion of path contains whitespace.
        my_dir_list="$my_directory_path:$my_dir_list"

        # If the last portion added has no slash in it, the list is done
        case $my_directory_path in */*) ;; *) break ;; esac

        # ...otherwise throw away the child directory and loop
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
      done
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`

      save_mkdir_p_IFS="$IFS"; IFS=':'
      for my_dir in $my_dir_list; do
	IFS="$save_mkdir_p_IFS"
        # mkdir can fail with a `File exist' error if two processes
        # try to create one of the directories concurrently.  Don't
        # stop in that case!
        $MKDIR "$my_dir" 2>/dev/null || :
      done
      IFS="$save_mkdir_p_IFS"

      # Bail out if we (or some other process) failed to create a directory.
      test -d "$my_directory_path" || \
        func_fatal_error "Failed to create \`$1'"
    fi
}


# func_mktempdir [string]
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible.  If
# given, STRING is the basename for that directory.
func_mktempdir ()
{
    my_template="${TMPDIR-/tmp}/${1-$progname}"

    if test "$opt_dry_run" = ":"; then
      # Return a directory name, but don't create it in dry-run mode
      my_tmpdir="${my_template}-$$"
    else

      # If mktemp works, use that first and foremost
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`

      if test ! -d "$my_tmpdir"; then
        # Failing that, at least try and use $RANDOM to avoid a race
        my_tmpdir="${my_template}-${RANDOM-0}$$"

        save_mktempdir_umask=`umask`
        umask 0077
        $MKDIR "$my_tmpdir"
        umask $save_mktempdir_umask
      fi

      # If we're not in dry-run mode, bomb out on failure
      test -d "$my_tmpdir" || \
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
    fi

    $ECHO "X$my_tmpdir" | $Xsed
}


# func_quote_for_eval arg
# Aesthetically quote ARG to be evaled later.
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
# is double-quoted, suitable for a subsequent eval, whereas
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
# which are still active within double quotes backslashified.
func_quote_for_eval ()
{
    case $1 in
      *[\\\`\"\$]*)
	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
      *)
        func_quote_for_eval_unquoted_result="$1" ;;
    esac

    case $func_quote_for_eval_unquoted_result in
      # Double-quote args containing shell metacharacters to delay
      # word splitting, command substitution and and variable
      # expansion for a subsequent eval.
      # Many Bourne shells cannot handle close brackets correctly
      # in scan sets, so we specify it separately.
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
        ;;
      *)
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
    esac
}


# func_quote_for_expand arg
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
    case $1 in
      *[\\\`\"]*)
	my_arg=`$ECHO "X$1" | $Xsed \
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
      *)
        my_arg="$1" ;;
    esac

    case $my_arg in
      # Double-quote args containing shell metacharacters to delay
      # word splitting and command substitution for a subsequent eval.
      # Many Bourne shells cannot handle close brackets correctly
      # in scan sets, so we specify it separately.
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
        my_arg="\"$my_arg\""
        ;;
    esac

    func_quote_for_expand_result="$my_arg"
}


# func_show_eval cmd [fail_exp]
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
    my_cmd="$1"
    my_fail_exp="${2-:}"

    ${opt_silent-false} || {
      func_quote_for_expand "$my_cmd"
      eval "func_echo $func_quote_for_expand_result"
    }

    if ${opt_dry_run-false}; then :; else
      eval "$my_cmd"
      my_status=$?
      if test "$my_status" -eq 0; then :; else
	eval "(exit $my_status); $my_fail_exp"
      fi
    fi
}


# func_version
# Echo version message to standard output and exit.
func_version ()
{
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
        s/^# //
	s/^# *$//
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
        p
     }' < "$progpath"
     exit $?
}

# func_usage
# Echo short help message to standard output and exit.
func_usage ()
{
    $SED -n '/^# Usage:/,/# -h/ {
        s/^# //
	s/^# *$//
	s/\$progname/'$progname'/
	p
    }' < "$progpath"
    $ECHO
    $ECHO "run \`$progname --help | more' for full usage"
    exit $?
}

# func_help
# Echo long help message to standard output and exit.
func_help ()
{
    $SED -n '/^# Usage:/,/# Report bugs to/ {
        s/^# //
	s/^# *$//
	s*\$progname*'$progname'*
	s*\$SHELL*'"$SHELL"'*
	s*\$LTCC*'"$LTCC"'*
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
	s*\$LD*'"$LD"'*
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
	p
     }' < "$progpath"
    exit $?
}

# func_missing_arg argname
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
    func_error "missing argument for $1"
    exit_cmd=exit
}

exit_cmd=:


# Global variables:
cvs_flags=-f
update_flags=
commit_flags=
opt_commit=:
opt_update=:
opt_verbose=false
opt_first=false
opt_tla=false
multiple_chlogs=false

mailnotify_flags=
sendmail_to=
exit_cmd=:

# try to find out whether read supports -r
if echo bt | tr b '\\' | { read -r line; test "X$line" = 'X\t'; } 2>/dev/null
then
  read_r='read -r'
else
  read_r=read
fi

# Locations for important files:
signature_file=
log_dir="`func_mktempdir`"
log_file="$log_dir/log"

trap '$RM -r "$log_dir"; exit $EXIT_FAILURE' 1 2 15

set -e

# Parse options once, thoroughly.  This comes as soon as possible in
# the script to make things like `clcommit --version' happen quickly.
{
  # sed scripts:
  my_sed_single_opt='1s/^\(..\).*$/\1/;q'
  my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
  my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
  my_sed_long_arg='1s/^--[^=]*=//'

  # this just eases exit handling
  while test $# -gt 0; do
    opt="$1"
    shift
    case $opt in

      --debug)		func_echo "enabling shell trace mode"
	    		mailnotify_flags="$mailnotify_flags --debug"
			set -x
			;;

      --fast)		set dummy --force --first ${1+"$@"}; shift	;;

      -f|--force)	opt_update=false; PAGER=cat		;;

      --from)		test $# = 0 && func_missing_arg $opt && break
      			func_quote_for_eval "$1"
			mailnotify_flags="$mailnotify_flags --from=$func_quote_for_eval_result"
			shift
			;;

      -l|--local)	update_flags="$update_flags -l"
			commit_flags="$commit_flags -l"
			;;

      -m|--message|--msg)
			test $# = 0 && func_missing_arg $opt && break
			if $opt_first || test -f "$log_file"; then
			  func_error "you can have at most one of -m, -F and -1"
			  break
			fi
			echo "$1" > "$log_file"
			shift
			;;

      -F|--file)	test $# = 0 && func_missing_arg $opt && break
			if $opt_first || test -f "$log_file"; then
			  func_error "you can have at most one of -m, -F and -1"
			  break
			fi
			if cat < "$1" > "$log_file"; then :; else
			  break
			fi
			shift
			;;

      -1|--first)       if test -f "$log_File"; then
	    		  func_error "you can have at most one of -m, -F and -1"
			  break
			fi
			opt_first=:
			;;

      -C|--[cC]hange[lL]og)
			test $# = 0 && func_missing_arg $opt && break
			if test -f "$1"; then :; else
			  func_error "ChangeLog file \`$1' does not exist"
			  break
			fi
			if test -z "$ChangeLogs"; then
			  ChangeLogs="$1"
			else
			  multiple_chlogs=:
			  ChangeLogs="$ChangeLogs $1"
			fi
			shift
			;;

      -n|--dry-run)	opt_commit=false; opt_update=:		;;

      -q|--quiet)	cvs_flags="$cvs_flags -q"		;;

      -r|--rcfile)	rc_file="./.clcommitrc"
			if test $# -gt 0; then
			  case $1 in
			    -*)				;;
			    *)  rc_file="$1"; shift	;;
			  esac
			fi
			if test -f "$rc_file"; then :; else
			  func_error "rcfile \`$rc_file' does not exist"
			  exit_cmd=exit
			  break
			fi
			# The funny quoting allows keeping one option per
			# line in $rc_file:
			eval set dummy `echo \`cat $rc_file\` \\\${1+\"\\\$@\"}`
			shift
			;;

      -s|--sendmail)	test $# = 0 && func_missing_arg $opt && break
      			func_quote_for_eval "$1"
      			sendmail_to="$func_quote_for_eval_result"
			shift
			;;

      --signature)	test $# = 0 && func_missing_arg $opt && break
    			signature_file="$HOME/.signature"
			case $1 in
			  -*) ;;
			  *)  signature_file="$1"; shift ;;
			esac
			if test -f "$signature_file"; then :; else
			  func_error "\`$signature_file': file not found"
			  break
			fi
			;;

      -S|--summary)	test $# = 0 && func_missing_arg $opt && break
			summary="$1"
			shift
			;;

      -t|--tla)		opt_tla=:				;;

      -v|--verbose)	opt_verbose=:				;;

      -z|--compress)
			test $# = 0 && func_missing_arg $opt && break
			case "$1" in
			  [0-9]) :;;
			  *)  func_error "invalid argument for $opt"
			      break
			      ;;
			esac
			cvs_flags="$cvs_flags -z$1"
			shift
			;;

      # Separate optargs to long options:
      --*=*)
			arg=`echo "$opt" | $SED "$my_sed_long_arg"`
			opt=`echo "$opt" | $SED "$my_sed_long_opt"`
			set dummy "$opt" "$arg" ${1+"$@"}
			shift
			;;

      # Separate optargs to short options:
      -m*|-F*|-C*|-S*|-s*|-z*)
			arg=`echo "$opt" |$SED "$my_sed_single_rest"`
			opt=`echo "$opt" |$SED "$my_sed_single_opt"`
			set dummy "$opt" "$arg" ${1+"$@"}
			shift
			;;

      # Separate non-argument short options:
      -f*|-1*|-n*|-q*)
			rest=`echo "$opt" |$SED "$my_sed_single_rest"`
			opt=`echo "$opt" |$SED "$my_sed_single_opt"`
			set dummy "$opt" "-$rest" ${1+"$@"}
			shift
			;;

      -\?|-h)		func_usage					;;
      --help)		func_help					;;
      --version)	func_version					;;
      --)		break						;;
      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
      *)		set dummy "$opt" ${1+"$@"};	shift; break		;;
    esac
  done

  if test -z "$sendmail_to"; then

    # can't have a from address without a destination address
    test -n "$sendmail_from" &&
      func_error "can't use --from without --sendmail." && exit_cmd=exit

    # can't use a signature file without a destination address
    test -n "$signature_file" &&
      func_error "can't use --signature without --sendmail." && exit_cmd=exit
  fi

  # Bail if the options were screwed
  $exit_cmd $EXIT_FAILURE
}

# func_check_conflicts
func_check_conflicts ()
{
    func_verbose "$progname: checking for conflicts..."
    if $opt_tla; then
      if ( $TLA changes |
	    while $read_r line; do
	      echo "$line"
	      echo "$line" >&3
	    done | grep '^C'
	  ) 3>&1 >/dev/null; then
        func_fatal_error "some conflicts were found with arch archive, aborting..."
      fi
    fi

    if test -f CVS/Entries; then
      if ( $CVS $cvs_flags -q -n update $update_flags ${1+"$@"} |
            while $read_r line; do
	      echo "$line"
	      echo "$line" >&3
            done | grep '^C'
          ) 3>&1 >/dev/null; then
        func_fatal_error "some conflicts were found with CVS repository, aborting..."
      fi
    fi
}


# func_sed_chlog_entry
func_sed_chlog_entry ()
{
    if $opt_first; then
      skipping=:
      $SED 's,^,+,' < $1 |
	while $read_r line; do
	  case "$line" in
	    "+") if $skipping; then skipping=false; else break; fi;;
	    "+ "*)
	      func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
	      echo "$line" | $SED 's/^.//' >&2;;
	    "+	"*)
	      $skipping || echo "$line" ;;
	  esac
	done |
	  $SED 's,^\+	,,' >> "$log_file" || exit $EXIT_FAILURE
    else
      if $opt_tla; then
	cmd="$TLA file-diffs"
      else
	cmd="$CVS $cvs_flags diff -u"
      fi
      $cmd $1 |
	while $read_r line; do
	  case $line in
	    "--- "*) :;;
	    "-"*)
	      func_error "*** Warning: the following line in ChangeLog diff is suspicious:"
	      echo "$line" | $SED 's/^.//' >&2;;
	    "+ "*)
	      func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
	      echo "$line" | $SED 's/^.//' >&2;;
	    "+") echo ;;
	    "+	"*) echo "$line";;
	  esac
	done |
	  $SED -e 's,\+	,,' -e '/./p' -e '/./d' -e '1d' -e '$d' >> "$log_file" \
      || exit $EXIT_FAILURE
    fi
    # The sed script above removes "+TAB" from the beginning of a line, then
    # deletes the first and/or the last line, when they happen to be empty
}


# func_check_commit_msg
func_check_commit_msg ()
{
    if test -z "$ChangeLogs"; then
      for f in ${1+"$@"}; do
        case "$f" in
          ChangeLog* | */ChangeLog*)
            if test -z "$ChangeLogs"; then
	      ChangeLogs=$f
	    else
	      func_fatal_error "multiple ChangeLog files found: $ChangeLogs and $f"
	    fi
	  ;;
        esac
      done
    fi

    func_verbose "$progname: checking commit message..."
    : ${ChangeLogs=ChangeLog}
    : > "$log_file"
    chlog_sep_line=
    for f in $ChangeLogs; do
      if $multiple_chlogs; then
	echo "$chlog_sep_line$f:" >>"$log_file"
	chlog_sep_line=$lt_nl
      fi
      func_sed_chlog_entry "$f"
    done
}


# func_commit
func_commit ()
{
    if $opt_tla; then
      tla_log=`$TLA make-log`
      test -n "$summary" || summary=`$SED -e '
          1{
	      s/^Summary: *//
	      q
	  }'`
      echo "Summary: $summary" > "$tla_log$$T" &&
        $SED 1d "$tla_log" >> "$tla_log$$T" &&
        cat < "$log_file" >> "$tla_log$$T" &&
        mv "$tla_log$$T" "$tla_log"
      ${PAGER-more} "$tla_log" || exit $EXIT_FAILURE

      sleep 1 # give the user some time for a ^C

      # Propagate any user edits back to the cvs log message
      $SED -e '/^[A-Z][-a-zA-Z]*:/d' -e '1d' < $tla_log > $log_file

    else
      ${PAGER-more} "$log_file" || exit $EXIT_FAILURE

      sleep 1 # give the user some time for a ^C

      subject=`cvs -nq up 2>/dev/null | $SED -n 's/^[MAD] //p'`
      test $# -gt 0 && subject="$@"
    fi

    if test -f CVS/Entries; then
      func_verbose "$CVS $cvs_flags commit $commit_flags -F $log_file ${1+$@}"
      $CVS $cvs_flags commit $commit_flags -F $log_file ${1+"$@"} || exit $EXIT_FAILURE
    fi

    # Need to do the tla commit *after* cvs commit to make sure the
    # ChangeLog timestamps stay in synch.
    $opt_tla && $TLA commit

    :
}


# func_mailnotify
func_mailnotify ()
{
    notify_file="${log_dir}/notify"
    func_verbose "Mailing commit notification to $sendmail_to"

    {
      echo Subject: $subject
      test -f '{arch}/=tagging-method' &&
          echo "Tree version:	`$TLA tree-version`"
      test -f CVS/Root &&
          echo "CVSROOT:	`$SED -e 's,.*:,,g' CVS/Root`"
      test -f $MKSTAMP &&
          echo "TIMESTAMP:	`$SHELL $MKSTAMP < ./ChangeLog`"
      test -f CVS/Repository &&
          echo "Module name:	`cat CVS/Repository`"
      test -f CVS/Tag &&
          echo "Branch:		`$SED -e 's,^T,,;1q' CVS/Tag`"
      test -f CVS/Root &&
          echo "Changes by:	`$SED -e 's,^:[a-z]*:,,;s,:.*$,,g' CVS/Root`"
      echo ""
      echo "Log Message:"
      $SED -e 's,^,	,' "$log_file"
      test -f "$signature_file" && {
        echo '-- '
	cat "$signature_file"
      }
    } > "$notify_file"

    ${PAGER-more} "$notify_file" || break

    # Break out the subject line again
    my_mail_subject=`$SED -e '
        1{
	    s/^Subject: *//
	    q
	}' "$notify_file"`
    my_mail_body=`$SED -e '2,$p;d' "$notify_file"`
    echo "$my_mail_body" > "$notify_file"

    func_verbose "mailing commit notification to \"$sendmail_to\""
    func_quote_for_eval "$my_mail_subject"
    func_show_eval "$MAILNOTIFY $mailnotify_flags \
        -s $func_quote_for_eval_result -m 'text/plain' -f '$notify_file' \
	-- $sendmail_to"
}



## ----- ##
## main. ##
## ----- ##

{
  $opt_update && func_check_conflicts

  test -f "$log_file" || func_check_commit_msg

  grep '[^ 	]' < "$log_file" > /dev/null ||
    func_fatal_error "empty commit message, aborting"

  if test $multiple_chlogs != : && grep '^$' < "$log_file" > /dev/null; then
    func_error "*** Warning: blank lines should not appear within commit messages."
    func_error "*** They should be used to separate distinct commits."
  fi

  # Do not check for empty $log_file again, even though the user might have
  # zeroed it out.  If s/he did, it was probably intentional.
  if $opt_commit; then
    func_commit ${1+"$@"}
  else
    ${PAGER-more} "$log_file" || exit $EXIT_FAILURE
  fi

  # Need to set the subject line *after* tla commit, or the
  # patch revision changes underneath us!
  subject="$summary"
  $opt_tla && \
    subject="$subject ["`$TLA tree-version|$SED $basename`--`$TLA revisions|$SED -e '$p;d'`"]"

  # Send a copy of the log_file if sendmail_to was set:
  if test -n "$sendmail_to"; then
    func_mailnotify
  fi

  $RM -r "$log_dir"
}

exit $EXIT_SUCCESS

# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:

[-- Attachment #3: commit-multiple-chlogs.patch --]
[-- Type: text/plain, Size: 4810 bytes --]

--- bin/commit.ori	2006-04-06 13:39:39.000000000 +0200
+++ bin/commit	2006-12-13 17:14:26.000000000 +0100
@@ -28,6 +28,7 @@
 # Usage: $progname [OPTION]... [--] [file|dir ...]
 
 # -C FILE   --changelog=file   extract commit message from specified ChangeLog
+#                              (can be used multiple times)
 # -zN       --compress=N       set compression level (0-9, 0=none, 9=max)
 #           --debug            enable verbose shell tracing
 # -n        --dry-run          don't commit anything
@@ -606,6 +607,7 @@
 opt_verbose=false
 opt_first=false
 opt_tla=false
+multiple_chlogs=false
 
 mailnotify_flags=
 sendmail_to=
@@ -696,7 +698,12 @@
 			  func_error "ChangeLog file \`$1' does not exist"
 			  break
 			fi
-			ChangeLog="$1"
+			if test -z "$ChangeLogs"; then
+			  ChangeLogs="$1"
+			else
+			  multiple_chlogs=:
+			  ChangeLogs="$ChangeLogs $1"
+			fi
 			shift
 			;;
 
@@ -837,59 +844,44 @@
 }
 
 
-# func_check_commit_msg
-func_check_commit_msg ()
+# func_sed_chlog_entry
+func_sed_chlog_entry ()
 {
-    if test -z "$ChangeLog"; then
-      for f in ${1+"$@"}; do
-        case "$f" in
-          ChangeLog* | */ChangeLog*)
-            if test -z "$ChangeLog"; then
-	      ChangeLog="$f"
-	    else
-	      func_fatal_error "multiple ChangeLog files: $ChangeLog and $f"
-	    fi
-	  ;;
-        esac
-      done
-    fi
-
-    func_verbose "$progname: checking commit message..."
     if $opt_first; then
       skipping=:
-      $SED 's,^,+,' < ${ChangeLog-ChangeLog} |
-        while $read_r line; do
-          case "$line" in
-            "+") if $skipping; then skipping=false; else break; fi;;
-            "+ "*)
+      $SED 's,^,+,' < $1 |
+	while $read_r line; do
+	  case "$line" in
+	    "+") if $skipping; then skipping=false; else break; fi;;
+	    "+ "*)
 	      func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
 	      echo "$line" | $SED 's/^.//' >&2;;
-            "+	"*)
-              $skipping || echo "$line" ;;
-          esac
-        done |
-          $SED 's,^\+	,,' > "$log_file" || exit $EXIT_FAILURE
+	    "+	"*)
+	      $skipping || echo "$line" ;;
+	  esac
+	done |
+	  $SED 's,^\+	,,' >> "$log_file" || exit $EXIT_FAILURE
     else
       if $opt_tla; then
-        cmd="$TLA file-diffs"
+	cmd="$TLA file-diffs"
       else
-        cmd="$CVS $cvs_flags diff -u"
+	cmd="$CVS $cvs_flags diff -u"
       fi
-      $cmd ${ChangeLog-ChangeLog} |
-        while $read_r line; do
-          case $line in
-            "--- "*) :;;
-            "-"*)
+      $cmd $1 |
+	while $read_r line; do
+	  case $line in
+	    "--- "*) :;;
+	    "-"*)
 	      func_error "*** Warning: the following line in ChangeLog diff is suspicious:"
 	      echo "$line" | $SED 's/^.//' >&2;;
-            "+ "*)
+	    "+ "*)
 	      func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:"
 	      echo "$line" | $SED 's/^.//' >&2;;
-            "+") echo ;;
-            "+	"*) echo "$line";;
-          esac
-        done |
-          $SED -e 's,\+	,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
+	    "+") echo ;;
+	    "+	"*) echo "$line";;
+	  esac
+	done |
+	  $SED -e 's,\+	,,' -e '/./p' -e '/./d' -e '1d' -e '$d' >> "$log_file" \
       || exit $EXIT_FAILURE
     fi
     # The sed script above removes "+TAB" from the beginning of a line, then
@@ -897,6 +889,37 @@
 }
 
 
+# func_check_commit_msg
+func_check_commit_msg ()
+{
+    if test -z "$ChangeLogs"; then
+      for f in ${1+"$@"}; do
+        case "$f" in
+          ChangeLog* | */ChangeLog*)
+            if test -z "$ChangeLogs"; then
+	      ChangeLogs=$f
+	    else
+	      func_fatal_error "multiple ChangeLog files found: $ChangeLogs and $f"
+	    fi
+	  ;;
+        esac
+      done
+    fi
+
+    func_verbose "$progname: checking commit message..."
+    : ${ChangeLogs=ChangeLog}
+    : > "$log_file"
+    chlog_sep_line=
+    for f in $ChangeLogs; do
+      if $multiple_chlogs; then
+	echo "$chlog_sep_line$f:" >>"$log_file"
+	chlog_sep_line=$lt_nl
+      fi
+      func_sed_chlog_entry "$f"
+    done
+}
+
+
 # func_commit
 func_commit ()
 {
@@ -1001,7 +1024,7 @@
   grep '[^ 	]' < "$log_file" > /dev/null ||
     func_fatal_error "empty commit message, aborting"
 
-  if grep '^$' < "$log_file" > /dev/null; then
+  if test $multiple_chlogs != : && grep '^$' < "$log_file" > /dev/null; then
     func_error "*** Warning: blank lines should not appear within commit messages."
     func_error "*** They should be used to separate distinct commits."
   fi
@@ -1010,6 +1033,8 @@
   # zeroed it out.  If s/he did, it was probably intentional.
   if $opt_commit; then
     func_commit ${1+"$@"}
+  else
+    ${PAGER-more} "$log_file" || exit $EXIT_FAILURE
   fi
 
   # Need to set the subject line *after* tla commit, or the

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-13 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-12 11:20 pkglibexecdir Stepan Kasal
2006-12-12 14:32 ` pkglibexecdir Andrew Cagney
2006-12-12 21:59   ` pkglibexecdir Stepan Kasal
2006-12-13 13:56     ` pkglibexecdir Andrew Cagney
2006-12-13 17:12       ` A commit script (was: Re: pkglibexecdir) Stepan Kasal

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).