!18 openEuler-22.03-LTS-Next Packages upgrade
Merge pull request !18 from xu_ping/openEuler-22.03-LTS-Next
This commit is contained in:
commit
2c49e65706
@ -1,122 +0,0 @@
|
|||||||
From 6594a2d66f7f060dafcbbf094dd60676db19a842 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stefan Bodewig <bodewig@apache.org>
|
|
||||||
Date: Sat, 10 Jul 2021 11:10:12 +0200
|
|
||||||
Subject: [PATCH] port some fixes from Commons Compress
|
|
||||||
|
|
||||||
---
|
|
||||||
.../org/apache/tools/tar/TarInputStream.java | 7 +++++--
|
|
||||||
.../org/apache/tools/zip/AsiExtraField.java | 12 +++++++----
|
|
||||||
src/main/org/apache/tools/zip/ZipFile.java | 20 ++++++++++++++++++-
|
|
||||||
3 files changed, 32 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/org/apache/tools/tar/TarInputStream.java b/src/main/org/apache/tools/tar/TarInputStream.java
|
|
||||||
index 0477d5c..71e4cc0 100644
|
|
||||||
--- a/src/main/org/apache/tools/tar/TarInputStream.java
|
|
||||||
+++ b/src/main/org/apache/tools/tar/TarInputStream.java
|
|
||||||
@@ -436,11 +436,13 @@ public class TarInputStream extends FilterInputStream {
|
|
||||||
String keyword = coll.toString("UTF-8");
|
|
||||||
// Get rest of entry
|
|
||||||
final int restLen = len - read;
|
|
||||||
- byte[] rest = new byte[restLen];
|
|
||||||
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
||||||
int got = 0;
|
|
||||||
while (got < restLen && (ch = i.read()) != -1) {
|
|
||||||
- rest[got++] = (byte) ch;
|
|
||||||
+ bos.write((byte) ch);
|
|
||||||
+ got++;
|
|
||||||
}
|
|
||||||
+ bos.close();
|
|
||||||
if (got != restLen) {
|
|
||||||
throw new IOException("Failed to read "
|
|
||||||
+ "Paxheader. Expected "
|
|
||||||
@@ -448,6 +450,7 @@ public class TarInputStream extends FilterInputStream {
|
|
||||||
+ " bytes, read "
|
|
||||||
+ got);
|
|
||||||
}
|
|
||||||
+ byte[] rest = bos.toByteArray();
|
|
||||||
// Drop trailing NL
|
|
||||||
String value = new String(rest, 0,
|
|
||||||
restLen - 1, StandardCharsets.UTF_8);
|
|
||||||
diff --git a/src/main/org/apache/tools/zip/AsiExtraField.java b/src/main/org/apache/tools/zip/AsiExtraField.java
|
|
||||||
index 8afddb5..fdd81c6 100644
|
|
||||||
--- a/src/main/org/apache/tools/zip/AsiExtraField.java
|
|
||||||
+++ b/src/main/org/apache/tools/zip/AsiExtraField.java
|
|
||||||
@@ -307,14 +307,18 @@ public class AsiExtraField implements ZipExtraField, UnixStat, Cloneable {
|
|
||||||
|
|
||||||
int newMode = ZipShort.getValue(tmp, 0);
|
|
||||||
// CheckStyle:MagicNumber OFF
|
|
||||||
- byte[] linkArray = new byte[(int) ZipLong.getValue(tmp, 2)];
|
|
||||||
+ final int linkArrayLength = (int) ZipLong.getValue(tmp, 2);
|
|
||||||
+ if (linkArrayLength < 0 || linkArrayLength > tmp.length - 10) {
|
|
||||||
+ throw new ZipException("Bad symbolic link name length " + linkArrayLength
|
|
||||||
+ + " in ASI extra field");
|
|
||||||
+ }
|
|
||||||
uid = ZipShort.getValue(tmp, 6);
|
|
||||||
gid = ZipShort.getValue(tmp, 8);
|
|
||||||
-
|
|
||||||
- if (linkArray.length == 0) {
|
|
||||||
+ if (linkArrayLength == 0) {
|
|
||||||
link = "";
|
|
||||||
} else {
|
|
||||||
- System.arraycopy(tmp, 10, linkArray, 0, linkArray.length);
|
|
||||||
+ final byte[] linkArray = new byte[linkArrayLength];
|
|
||||||
+ System.arraycopy(tmp, 10, linkArray, 0, linkArrayLength);
|
|
||||||
link = new String(linkArray); // Uses default charset - see class Javadoc
|
|
||||||
}
|
|
||||||
// CheckStyle:MagicNumber ON
|
|
||||||
diff --git a/src/main/org/apache/tools/zip/ZipFile.java b/src/main/org/apache/tools/zip/ZipFile.java
|
|
||||||
index dfb6bcf..8806ae7 100644
|
|
||||||
--- a/src/main/org/apache/tools/zip/ZipFile.java
|
|
||||||
+++ b/src/main/org/apache/tools/zip/ZipFile.java
|
|
||||||
@@ -541,6 +541,9 @@ public class ZipFile implements Closeable {
|
|
||||||
ze.setExternalAttributes(ZipLong.getValue(CFH_BUF, off));
|
|
||||||
off += WORD;
|
|
||||||
|
|
||||||
+ if (archive.length() - archive.getFilePointer() < fileNameLen) {
|
|
||||||
+ throw new EOFException();
|
|
||||||
+ }
|
|
||||||
final byte[] fileName = new byte[fileNameLen];
|
|
||||||
archive.readFully(fileName);
|
|
||||||
ze.setName(entryEncoding.decode(fileName), fileName);
|
|
||||||
@@ -550,12 +553,18 @@ public class ZipFile implements Closeable {
|
|
||||||
// data offset will be filled later
|
|
||||||
entries.add(ze);
|
|
||||||
|
|
||||||
+ if (archive.length() - archive.getFilePointer() < extraLen) {
|
|
||||||
+ throw new EOFException();
|
|
||||||
+ }
|
|
||||||
final byte[] cdExtraData = new byte[extraLen];
|
|
||||||
archive.readFully(cdExtraData);
|
|
||||||
ze.setCentralDirectoryExtra(cdExtraData);
|
|
||||||
|
|
||||||
setSizesAndOffsetFromZip64Extra(ze, offset, diskStart);
|
|
||||||
|
|
||||||
+ if (archive.length() - archive.getFilePointer() < commentLen) {
|
|
||||||
+ throw new EOFException();
|
|
||||||
+ }
|
|
||||||
final byte[] comment = new byte[commentLen];
|
|
||||||
archive.readFully(comment);
|
|
||||||
ze.setComment(entryEncoding.decode(comment));
|
|
||||||
@@ -881,9 +890,18 @@ public class ZipFile implements Closeable {
|
|
||||||
}
|
|
||||||
lenToSkip -= skipped;
|
|
||||||
}
|
|
||||||
+ if (archive.length() - archive.getFilePointer() < extraFieldLen) {
|
|
||||||
+ throw new EOFException();
|
|
||||||
+ }
|
|
||||||
final byte[] localExtraData = new byte[extraFieldLen];
|
|
||||||
archive.readFully(localExtraData);
|
|
||||||
- ze.setExtra(localExtraData);
|
|
||||||
+ try {
|
|
||||||
+ ze.setExtra(localExtraData);
|
|
||||||
+ } catch (RuntimeException ex) {
|
|
||||||
+ final ZipException z = new ZipException("Invalid extra data in entry " + ze.getName());
|
|
||||||
+ z.initCause(ex);
|
|
||||||
+ throw z;
|
|
||||||
+ }
|
|
||||||
offsetEntry.dataOffset = offset + LFH_OFFSET_FOR_FILENAME_LENGTH
|
|
||||||
+ SHORT + SHORT + fileNameLen + extraFieldLen;
|
|
||||||
|
|
||||||
--
|
|
||||||
2.27.0
|
|
||||||
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
From f7159e8a084a3fcb76b933d393df1fc855d74d78 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stefan Bodewig <bodewig@apache.org>
|
|
||||||
Date: Tue, 28 Jul 2020 21:51:01 +0200
|
|
||||||
Subject: [PATCH] document why we are actually removing the file before writing
|
|
||||||
|
|
||||||
---
|
|
||||||
.../org/apache/tools/ant/types/resources/FileResource.java | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/org/apache/tools/ant/types/resources/FileResource.java b/src/main/org/apache/tools/ant/types/resources/FileResource.java
|
|
||||||
index d8d604c0f8..17ed7cc463 100644
|
|
||||||
--- a/src/main/org/apache/tools/ant/types/resources/FileResource.java
|
|
||||||
+++ b/src/main/org/apache/tools/ant/types/resources/FileResource.java
|
|
||||||
@@ -255,7 +255,8 @@ public OutputStream getAppendOutputStream() throws IOException {
|
|
||||||
private OutputStream getOutputStream(boolean append) throws IOException {
|
|
||||||
File f = getNotNullFile();
|
|
||||||
if (f.exists()) {
|
|
||||||
- if (f.isFile() && !append) {
|
|
||||||
+ if (Files.isSymbolicLink(f.toPath()) && f.isFile() && !append) {
|
|
||||||
+ // https://bz.apache.org/bugzilla/show_bug.cgi?id=624
|
|
||||||
f.delete();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
@ -1,170 +0,0 @@
|
|||||||
From 87ac51d3c22bcf7cfd0dc07cb0bd04a496e0d428 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stefan Bodewig <bodewig@apache.org>
|
|
||||||
Date: Sat, 4 Jul 2020 18:03:13 +0200
|
|
||||||
Subject: [PATCH] fallback to a separate owner-only tempdir if possible
|
|
||||||
|
|
||||||
---
|
|
||||||
src/main/org/apache/tools/ant/MagicNames.java | 10 +++
|
|
||||||
.../org/apache/tools/ant/util/FileUtils.java | 36 +++++++++--
|
|
||||||
.../apache/tools/ant/util/FileUtilsTest.java | 64 +++++++++++++++++++
|
|
||||||
3 files changed, 105 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main/org/apache/tools/ant/MagicNames.java b/src/main/org/apache/tools/ant/MagicNames.java
|
|
||||||
index 5cf2fa8fa3..8ced505789 100644
|
|
||||||
--- a/src/main/org/apache/tools/ant/MagicNames.java
|
|
||||||
+++ b/src/main/org/apache/tools/ant/MagicNames.java
|
|
||||||
@@ -337,5 +337,15 @@ private MagicNames() {
|
|
||||||
* @since Ant 1.10.8
|
|
||||||
*/
|
|
||||||
public static final String TMPDIR = "ant.tmpdir";
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Magic property that will be set to override java.io.tmpdir
|
|
||||||
+ * system property as the location for Ant's default temporary
|
|
||||||
+ * directory if a temp file is created and {@link #TMPDIR} is not
|
|
||||||
+ * set.
|
|
||||||
+ * Value: {@value}
|
|
||||||
+ * @since Ant 1.10.9
|
|
||||||
+ */
|
|
||||||
+ public static final String AUTO_TMPDIR = "ant.auto.tmpdir";
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java
|
|
||||||
index 46671848c9..d835438fe7 100644
|
|
||||||
--- a/src/main/org/apache/tools/ant/util/FileUtils.java
|
|
||||||
+++ b/src/main/org/apache/tools/ant/util/FileUtils.java
|
|
||||||
@@ -110,6 +110,11 @@
|
|
||||||
PosixFilePermissions.asFileAttribute(EnumSet.of(PosixFilePermission.OWNER_READ,
|
|
||||||
PosixFilePermission.OWNER_WRITE))
|
|
||||||
};
|
|
||||||
+ private static final FileAttribute[] TMPDIR_ATTRIBUTES =
|
|
||||||
+ new FileAttribute[] {
|
|
||||||
+ PosixFilePermissions.asFileAttribute(EnumSet.of(PosixFilePermission.OWNER_READ,
|
|
||||||
+ PosixFilePermission.OWNER_WRITE, PosixFilePermission.OWNER_EXECUTE))
|
|
||||||
+ };
|
|
||||||
private static final FileAttribute[] NO_TMPFILE_ATTRIBUTES = new FileAttribute[0];
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -991,14 +996,35 @@ public File createTempFile(String prefix, String suffix, File parentDir,
|
|
||||||
public File createTempFile(final Project project, String prefix, String suffix,
|
|
||||||
final File parentDir, final boolean deleteOnExit, final boolean createFile) {
|
|
||||||
File result;
|
|
||||||
- final String parent;
|
|
||||||
+ String p = null;
|
|
||||||
if (parentDir != null) {
|
|
||||||
- parent = parentDir.getPath();
|
|
||||||
+ p = parentDir.getPath();
|
|
||||||
} else if (project != null && project.getProperty(MagicNames.TMPDIR) != null) {
|
|
||||||
- parent = project.getProperty(MagicNames.TMPDIR);
|
|
||||||
- } else {
|
|
||||||
- parent = System.getProperty("java.io.tmpdir");
|
|
||||||
+ p = project.getProperty(MagicNames.TMPDIR);
|
|
||||||
+ } else if (project != null && deleteOnExit) {
|
|
||||||
+ if (project.getProperty(MagicNames.AUTO_TMPDIR) != null) {
|
|
||||||
+ p = project.getProperty(MagicNames.AUTO_TMPDIR);
|
|
||||||
+ } else {
|
|
||||||
+ final Path systemTempDirPath =
|
|
||||||
+ new File(System.getProperty("java.io.tmpdir")).toPath();
|
|
||||||
+ final PosixFileAttributeView systemTempDirPosixAttributes =
|
|
||||||
+ Files.getFileAttributeView(systemTempDirPath, PosixFileAttributeView.class);
|
|
||||||
+ if (systemTempDirPosixAttributes != null) {
|
|
||||||
+ // no reason to create an extra temp dir if we cannot set permissions
|
|
||||||
+ try {
|
|
||||||
+ final File projectTempDir = Files.createTempDirectory(systemTempDirPath,
|
|
||||||
+ "ant", TMPDIR_ATTRIBUTES)
|
|
||||||
+ .toFile();
|
|
||||||
+ projectTempDir.deleteOnExit();
|
|
||||||
+ p = projectTempDir.getAbsolutePath();
|
|
||||||
+ project.setProperty(MagicNames.AUTO_TMPDIR, p);
|
|
||||||
+ } catch (IOException ex) {
|
|
||||||
+ // silently fall back to system temp directory
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
+ final String parent = p != null ? p : System.getProperty("java.io.tmpdir");
|
|
||||||
if (prefix == null) {
|
|
||||||
prefix = NULL_PLACEHOLDER;
|
|
||||||
}
|
|
||||||
diff --git a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
|
|
||||||
index da46520038..d5448a6ac6 100644
|
|
||||||
--- a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
|
|
||||||
+++ b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
|
|
||||||
@@ -50,6 +50,8 @@
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
+import static org.junit.Assert.assertNotNull;
|
|
||||||
+import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assume.assumeFalse;
|
|
||||||
@@ -450,6 +452,68 @@ public void testCreateTempFile() throws IOException {
|
|
||||||
tmp2.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileUsesAntTmpDirIfSetAndDeleteOnExitIsTrue() throws IOException {
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File projectTmpDir = folder.newFolder("subdir");
|
|
||||||
+ project.setProperty("ant.tmpdir", projectTmpDir.getAbsolutePath());
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, true, true);
|
|
||||||
+ assertTrue(tmpFile + " must be child of " + projectTmpDir,
|
|
||||||
+ tmpFile.getAbsolutePath().startsWith(projectTmpDir.getAbsolutePath()));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileUsesAntTmpDirIfSetAndDeleteOnExitIsFalse() throws IOException {
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File projectTmpDir = folder.newFolder("subdir");
|
|
||||||
+ project.setProperty("ant.tmpdir", projectTmpDir.getAbsolutePath());
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, false, true);
|
|
||||||
+ assertTrue(tmpFile + " must be child of " + projectTmpDir,
|
|
||||||
+ tmpFile.getAbsolutePath().startsWith(projectTmpDir.getAbsolutePath()));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileCreatesAutoTmpDirIfDeleteOnExitIsTrueOnUnix() throws IOException {
|
|
||||||
+ assumeFalse("Test doesn't run on DOS", Os.isFamily("dos"));
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, true, true);
|
|
||||||
+ final String autoTempDir = project.getProperty("ant.auto.tmpdir");
|
|
||||||
+ assertNotNull(autoTempDir);
|
|
||||||
+ assertTrue(tmpFile + " must be child of " + autoTempDir,
|
|
||||||
+ tmpFile.getAbsolutePath().startsWith(autoTempDir));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileDoesntCreateAutoTmpDirIfDeleteOnExitIsFalse() throws IOException {
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, false, true);
|
|
||||||
+ assertNull(project.getProperty("ant.auto.tmpdir"));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileReusesAutoTmpDirIfDeleteOnExitIsTrueOnUnix() throws IOException {
|
|
||||||
+ assumeFalse("Test doesn't run on DOS", Os.isFamily("dos"));
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, true, true);
|
|
||||||
+ final String autoTempDir = project.getProperty("ant.auto.tmpdir");
|
|
||||||
+ assertNotNull(autoTempDir);
|
|
||||||
+ final File tmpFile2 = getFileUtils().createTempFile(project, null, null, null, true, true);
|
|
||||||
+ assertTrue(tmpFile2 + " must be child of " + autoTempDir,
|
|
||||||
+ tmpFile2.getAbsolutePath().startsWith(autoTempDir));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Test
|
|
||||||
+ public void createTempFileDoesntReusesAutoTmpDirIfDeleteOnExitIsFalse() throws IOException {
|
|
||||||
+ assumeFalse("Test doesn't run on DOS", Os.isFamily("dos"));
|
|
||||||
+ final Project project = new Project();
|
|
||||||
+ final File tmpFile = getFileUtils().createTempFile(project, null, null, null, true, true);
|
|
||||||
+ final String autoTempDir = project.getProperty("ant.auto.tmpdir");
|
|
||||||
+ assertNotNull(autoTempDir);
|
|
||||||
+ final File tmpFile2 = getFileUtils().createTempFile(project, null, null, null, false, true);
|
|
||||||
+ assertFalse(tmpFile2 + " must not be child of " + autoTempDir,
|
|
||||||
+ tmpFile2.getAbsolutePath().startsWith(autoTempDir));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* Test contentEquals
|
|
||||||
*/
|
|
||||||
170
ant.asciidoc
Normal file
170
ant.asciidoc
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
ant(1)
|
||||||
|
======
|
||||||
|
:doctype: manpage
|
||||||
|
:man source: ANT
|
||||||
|
:man manual: Apache Ant
|
||||||
|
|
||||||
|
NAME
|
||||||
|
----
|
||||||
|
ant - Java build tool
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
--------
|
||||||
|
*ant* [OPTIONS] [TARGET [TARGET2 [TARGET3] ...]]
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
-----------
|
||||||
|
Apache Ant is a Java library and command-line tool whose mission is to drive
|
||||||
|
processes described in build files as targets and extension points dependent
|
||||||
|
upon each other. The main known usage of Ant is the build of Java applications.
|
||||||
|
Ant supplies a number of built-in tasks allowing to compile, assemble, test and
|
||||||
|
run Java applications. Ant can also be used effectively to build non Java
|
||||||
|
applications, for instance C or C++ applications. More generally, Ant can be
|
||||||
|
used to pilot any type of process which can be described in terms of targets
|
||||||
|
and tasks.
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
-----
|
||||||
|
When no arguments are specified, Ant looks for a build.xml file in the current
|
||||||
|
directory and, if found, uses that file as the build file and runs the target
|
||||||
|
specified in the default attribute of the <project> tag. To make Ant use
|
||||||
|
a build file other than build.xml, use the command-line option *-buildfile*
|
||||||
|
file, where file is the name of the build file you want to use (or a directory
|
||||||
|
containing a build.xml file).
|
||||||
|
|
||||||
|
If you use the *-find* [file] option, Ant will search for a build file first in
|
||||||
|
the current directory, then in the parent directory, and so on, until either
|
||||||
|
a build file is found or the root of the filesystem has been reached. By
|
||||||
|
default, it will look for a build file called build.xml. To have it search for
|
||||||
|
a build file other than build.xml, specify a file argument. Note: If you
|
||||||
|
include any other flags or arguments on the command line after the *-find*
|
||||||
|
flag, you must include the file argument for the *-find* flag, even if the name
|
||||||
|
of the build file you want to find is build.xml.
|
||||||
|
|
||||||
|
You can also set properties on the command line. This can be done with the
|
||||||
|
*-Dproperty*=value option, where property is the name of the property, and
|
||||||
|
value is the value for that property. If you specify a property that is also
|
||||||
|
set in the build file (see the property task), the value specified on the
|
||||||
|
command line will override the value specified in the build file. Defining
|
||||||
|
properties on the command line can also be used to pass in the value of
|
||||||
|
environment variables; just pass *-DMYVAR*=$MYVAR to Ant. You can then access
|
||||||
|
these variables inside your build file as ${MYVAR}. You can also access
|
||||||
|
environment variables using the property task's environment attribute.
|
||||||
|
|
||||||
|
Options that affect the amount of logging output by Ant are: *-quiet*, which
|
||||||
|
instructs Ant to print less information to the console; *-verbose*, which
|
||||||
|
causes Ant to print additional information to the console; *-debug*, which
|
||||||
|
causes Ant to print considerably more additional information; and *-silent*
|
||||||
|
which makes Ant print nothing but task output and build failures (useful to
|
||||||
|
capture Ant output by scripts).
|
||||||
|
|
||||||
|
It is also possible to specify one or more targets that should be executed.
|
||||||
|
When omitted, the target that is specified in the default attribute of the
|
||||||
|
project tag is used.
|
||||||
|
|
||||||
|
The *-projecthelp* option prints out a list of the build file's targets.
|
||||||
|
Targets that include a description attribute are listed as "Main targets",
|
||||||
|
those without a description are listed as "Other targets", then the "Default"
|
||||||
|
target is listed ("Other targets" are only displayed if there are no main
|
||||||
|
targets, or if Ant is invoked in *-verbose* or *-debug* mode).
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-------
|
||||||
|
|
||||||
|
*-help, -h*::
|
||||||
|
print this message and exit
|
||||||
|
*-projecthelp, -p*::
|
||||||
|
print project help information and exit
|
||||||
|
*-version*::
|
||||||
|
print the version information and exit
|
||||||
|
*-diagnostics*::
|
||||||
|
print information that might be helpful to diagnose or report problems and exit
|
||||||
|
*-quiet, -q*::
|
||||||
|
be extra quiet
|
||||||
|
*-silent, -S*::
|
||||||
|
print nothing but task outputs and build failures
|
||||||
|
*-verbose, -v*::
|
||||||
|
be extra verbose
|
||||||
|
*-debug, -d*::
|
||||||
|
print debugging information
|
||||||
|
*-emacs, -e*::
|
||||||
|
produce logging information without adornments
|
||||||
|
*-lib <path>*::
|
||||||
|
specifies a path to search for jars and classes
|
||||||
|
*-logfile <file>, -l <file>*::
|
||||||
|
use given file for log
|
||||||
|
*-logger <classname>*::
|
||||||
|
the class which is to perform logging
|
||||||
|
*-listener <classname>*::
|
||||||
|
add an instance of class as a project listener
|
||||||
|
*-noinput*::
|
||||||
|
do not allow interactive input
|
||||||
|
*-buildfile <file>, -file <file>, -f <file>*::
|
||||||
|
use given buildfile
|
||||||
|
*-D<property>=<value>*::
|
||||||
|
use value for given property
|
||||||
|
*-keep-going, -k*::
|
||||||
|
execute all targets that do not depend on failed target(s)
|
||||||
|
*-propertyfile <name>*::
|
||||||
|
load all properties from file with *-D* properties taking precedence
|
||||||
|
*-inputhandler <class>*::
|
||||||
|
the class which will handle input requests
|
||||||
|
*-find <file>, -f <file>*::
|
||||||
|
search for buildfile towards the root of the filesystem and use it
|
||||||
|
*-nice number*::
|
||||||
|
A niceness value for the main thread:
|
||||||
|
1 (lowest) to 10 (highest); 5 is the default
|
||||||
|
*-nouserlib*::
|
||||||
|
Run ant without using the jar files from `${user.home}/.ant/lib`
|
||||||
|
*-noclasspath*::
|
||||||
|
Run ant without using `CLASSPATH`
|
||||||
|
*-autoproxy*::
|
||||||
|
Java1.5+: use the OS proxy settings
|
||||||
|
*-main <class>*::
|
||||||
|
override Ant's normal entry point
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
--------
|
||||||
|
*ant*::
|
||||||
|
|
||||||
|
runs Ant using the build.xml file in the current directory, on the default target.
|
||||||
|
|
||||||
|
*ant -buildfile test.xml*::
|
||||||
|
|
||||||
|
runs Ant using the test.xml file in the current directory, on the default target.
|
||||||
|
|
||||||
|
*ant -buildfile test.xml dist*::
|
||||||
|
|
||||||
|
runs Ant using the test.xml file in the current directory, on the target called dist.
|
||||||
|
|
||||||
|
*ant -buildfile test.xml -Dbuild=build/classes dist*::
|
||||||
|
|
||||||
|
runs Ant using the test.xml file in the current directory, on the target called dist, setting the build property to the value "build/classes".
|
||||||
|
|
||||||
|
*ant -lib /home/ant/extras*::
|
||||||
|
|
||||||
|
runs Ant picking up additional task and support jars from the /home/ant/extras location
|
||||||
|
|
||||||
|
*ant -lib one.jar;another.jar*::
|
||||||
|
|
||||||
|
adds two jars to Ants classpath.
|
||||||
|
|
||||||
|
FILES
|
||||||
|
-----
|
||||||
|
The Ant wrapper script for Unix will source (read and evaluate) the file *~/.antrc* before it does anything. You can use the file, for example, to set/unset environment variables that should only be visible during the execution of Ant.
|
||||||
|
|
||||||
|
ENVIRONMENT VARIABLES
|
||||||
|
---------------------
|
||||||
|
The wrapper scripts use the following environment variables (if set):
|
||||||
|
|
||||||
|
JAVACMD::
|
||||||
|
full path of the Java executable. Use this to invoke a different JVM than JAVA_HOME/bin/java.
|
||||||
|
ANT_OPTS::
|
||||||
|
command-line arguments that should be passed to the JVM. For example, you can define system properties or set the maximum Java heap size here.
|
||||||
|
ANT_ARGS::
|
||||||
|
Ant command-line arguments. For example, set ANT_ARGS to point to a different logger, include a listener, and to include the *-find* flag.
|
||||||
|
Note: If you include *-find* in ANT_ARGS, you should include the name of the build file to find, even if the file is called build.xml.
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
--------
|
||||||
|
java(1), make(1), mvn(1)
|
||||||
22
ant.spec
22
ant.spec
@ -3,17 +3,14 @@
|
|||||||
|
|
||||||
Name: ant
|
Name: ant
|
||||||
Summary: A Java-based build tool
|
Summary: A Java-based build tool
|
||||||
Version: 1.10.8
|
Version: 1.10.12
|
||||||
Release: 4
|
Release: 1
|
||||||
Epoch: 0
|
Epoch: 0
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://ant.apache.org/
|
URL: https://ant.apache.org/
|
||||||
Source0: https://archive.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.bz2
|
Source0: https://archive.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.bz2
|
||||||
|
Source1: ant.asciidoc
|
||||||
Source2: apache-ant-1.8.ant.conf
|
Source2: apache-ant-1.8.ant.conf
|
||||||
# Patch 0-1 are used for repair CVE-2020-11979
|
|
||||||
Patch0: Fallback-to-a-separate-owner-only-tempdir-if-possible.patch
|
|
||||||
Patch1: Document-why-we-are-actually-removing-the-file-before-writing.patch
|
|
||||||
Patch2: CVE-2021-36373-CVE-2021-36374.patch
|
|
||||||
|
|
||||||
BuildRequires: javapackages-local java-1.8.0-devel ant >= 1.10.2
|
BuildRequires: javapackages-local java-1.8.0-devel ant >= 1.10.2
|
||||||
BuildRequires: ant-junit xmlto mvn(antlr:antlr) mvn(bcel:bcel)
|
BuildRequires: ant-junit xmlto mvn(antlr:antlr) mvn(bcel:bcel)
|
||||||
@ -22,7 +19,7 @@ BuildRequires: mvn(commons-net:commons-net) mvn(javax.mail:mail) mvn(jdepend:jd
|
|||||||
BuildRequires: mvn(junit:junit) mvn(log4j:log4j:1.2.13) mvn(org.tukaani:xz)
|
BuildRequires: mvn(junit:junit) mvn(log4j:log4j:1.2.13) mvn(org.tukaani:xz)
|
||||||
BuildRequires: mvn(oro:oro) mvn(regexp:regexp) mvn(xalan:xalan)
|
BuildRequires: mvn(oro:oro) mvn(regexp:regexp) mvn(xalan:xalan)
|
||||||
BuildRequires: mvn(xml-resolver:xml-resolver) mvn(org.hamcrest:hamcrest-core)
|
BuildRequires: mvn(xml-resolver:xml-resolver) mvn(org.hamcrest:hamcrest-core)
|
||||||
BuildRequires: mvn(org.hamcrest:hamcrest-library) junit5
|
BuildRequires: mvn(org.hamcrest:hamcrest-library) junit5 asciidoc
|
||||||
|
|
||||||
Recommends: java-1.8.0-devel
|
Recommends: java-1.8.0-devel
|
||||||
Requires: %{name}-lib = %{epoch}:%{version}-%{release} javapackages-tools
|
Requires: %{name}-lib = %{epoch}:%{version}-%{release} javapackages-tools
|
||||||
@ -242,6 +239,9 @@ ln -sf LICENSE.utf8 LICENSE
|
|||||||
%{ant} javadocs
|
%{ant} javadocs
|
||||||
rm -fr build/lib/%{name}-jai.jar build/lib/%{name}-netrexx.jar
|
rm -fr build/lib/%{name}-jai.jar build/lib/%{name}-netrexx.jar
|
||||||
|
|
||||||
|
mkdir man
|
||||||
|
asciidoc -b docbook -d manpage -o man/%{name}.xml %{SOURCE1}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -d %{buildroot}%{_datadir}/%{name}/{lib,etc,bin}
|
install -d %{buildroot}%{_datadir}/%{name}/{lib,etc,bin}
|
||||||
%mvn_alias :%{name} org.apache.%{name}:%{name}-nodeps apache:%{name} %{name}:%{name}
|
%mvn_alias :%{name} org.apache.%{name}:%{name}-nodeps apache:%{name} %{name}:%{name}
|
||||||
@ -299,6 +299,10 @@ install -d %{buildroot}%{_javadocdir}/%{name}
|
|||||||
cp -pr build/javadocs/* %{buildroot}%{_javadocdir}/%{name}
|
cp -pr build/javadocs/* %{buildroot}%{_javadocdir}/%{name}
|
||||||
(cd manual; ln -sf %{_javadocdir}/%{name} api)
|
(cd manual; ln -sf %{_javadocdir}/%{name} api)
|
||||||
|
|
||||||
|
#manpage
|
||||||
|
install -d -m 755 %{buildroot}%{_mandir}/man1/
|
||||||
|
install -p -m 644 man/%{name}.xml %{buildroot}%{_mandir}/man1/%{name}.xml
|
||||||
|
|
||||||
%if %with tests
|
%if %with tests
|
||||||
%check
|
%check
|
||||||
LC_ALL=en_US.utf8 %{ant} test
|
LC_ALL=en_US.utf8 %{ant} test
|
||||||
@ -311,6 +315,7 @@ LC_ALL=en_US.utf8 %{ant} test
|
|||||||
%dir %{ant_home}/bin
|
%dir %{ant_home}/bin
|
||||||
%{ant_home}/bin/ant
|
%{ant_home}/bin/ant
|
||||||
%attr(0755,root,root) %{ant_home}/bin/antRun
|
%attr(0755,root,root) %{ant_home}/bin/antRun
|
||||||
|
%{_mandir}/man1/%{name}.*
|
||||||
%dir %{ant_home}/etc
|
%dir %{ant_home}/etc
|
||||||
%{ant_home}/etc/ant-update.xsl
|
%{ant_home}/etc/ant-update.xsl
|
||||||
%{ant_home}/etc/changelog.xsl
|
%{ant_home}/etc/changelog.xsl
|
||||||
@ -426,6 +431,9 @@ LC_ALL=en_US.utf8 %{ant} test
|
|||||||
%{_javadocdir}/%{name}
|
%{_javadocdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 21 2022 SimpleUpdate Robot <tc@openeuler.org> - 1.10.12-1
|
||||||
|
- Upgrade to version 1.10.12
|
||||||
|
|
||||||
* Mon Jul 19 2021 yaoxin <yaoxin30@huawei.com> - 0:1.10.8-4
|
* Mon Jul 19 2021 yaoxin <yaoxin30@huawei.com> - 0:1.10.8-4
|
||||||
- Fix CVE-2021-36373 CVE-2021-36374
|
- Fix CVE-2021-36373 CVE-2021-36374
|
||||||
|
|
||||||
|
|||||||
BIN
apache-ant-1.10.12-src.tar.bz2
Normal file
BIN
apache-ant-1.10.12-src.tar.bz2
Normal file
Binary file not shown.
Binary file not shown.
@ -1,9 +1,20 @@
|
|||||||
|
# ant.conf (Ant 1.8.x)
|
||||||
|
# JPackage Project <http://www.jpackage.org/>
|
||||||
|
|
||||||
|
# Validate --noconfig setting in case being invoked
|
||||||
|
# from pre Ant 1.6.x environment
|
||||||
if [ -z "$no_config" ] ; then
|
if [ -z "$no_config" ] ; then
|
||||||
no_config=true
|
no_config=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Setup ant configuration
|
||||||
if $no_config ; then
|
if $no_config ; then
|
||||||
|
# Disable RPM layout
|
||||||
rpm_mode=false
|
rpm_mode=false
|
||||||
else
|
else
|
||||||
|
# Use RPM layout
|
||||||
rpm_mode=true
|
rpm_mode=true
|
||||||
|
|
||||||
|
# ANT_HOME for rpm layout
|
||||||
ANT_HOME=/usr/share/ant
|
ANT_HOME=/usr/share/ant
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user