[Fwd: [PATCH] Fix PR39177]

View: New views
1 Messages — Rating Filter:   Alert me  

[Fwd: [PATCH] Fix PR39177]

by Andrew Haley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Apparently this bounced when it was sent because Richard isn't a
subscriber.

Andrew.


This fixes the GCC bootstrap failures in libjava when using gjar
from GCC 4.4 or later.

Ok for the trunk and the 4.4 branch?  Please somebody deal with
the classpath repo.

Thanks,
Richard.

2009-10-21  Richard Guenther  <rguenther@...>

        PR cp-tools/39177
        * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries):
        Do not use uninitialized manifest.
        * tools/classes/gnu/classpath/tools/jar/Creator.class: Re-generated.

Index: libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
===================================================================
*** libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java (revision 152176)
--- libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java (working copy)
*************** public class Creator
*** 216,226 ****
      manifest = createManifest(parameters);
      /* If no version is specified, provide the same manifest version default
       * as Sun's jar tool */
!     Attributes attr = manifest.getMainAttributes();
!     if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
!       attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
!     attr.putValue("Created-By", System.getProperty("java.version") +
   " (" + System.getProperty("java.vendor") + ")");
      outputStream = new JarOutputStream(os, manifest);
      // FIXME: this sets the method too late for the manifest file.
      outputStream.setMethod(parameters.storageMode);
--- 216,229 ----
      manifest = createManifest(parameters);
      /* If no version is specified, provide the same manifest version default
       * as Sun's jar tool */
!     if (parameters.wantManifest)
!       {
!  Attributes attr = manifest.getMainAttributes();
!  if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null)
!      attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
!  attr.putValue("Created-By", System.getProperty("java.version") +
   " (" + System.getProperty("java.vendor") + ")");
+       }
      outputStream = new JarOutputStream(os, manifest);
      // FIXME: this sets the method too late for the manifest file.
      outputStream.setMethod(parameters.storageMode);