|
11 | 11 | package org.eclipse.linuxtools.rpm.core.utils;
|
12 | 12 |
|
13 | 13 | import java.io.IOException;
|
14 |
| -import java.io.InputStream; |
15 | 14 | import java.io.OutputStream;
|
16 | 15 | import java.util.ArrayList;
|
17 | 16 | import java.util.Arrays;
|
@@ -69,18 +68,24 @@ public RPMBuild(RPMConfiguration config) {
|
69 | 68 | *
|
70 | 69 | * @param specFile
|
71 | 70 | * the spec file
|
72 |
| - * @return The output of the `rpmbuild -bp` command. |
73 | 71 | * @throws CoreException
|
74 | 72 | * if the operation fails
|
75 | 73 | */
|
76 |
| - public InputStream buildPrep(IFile specFile) throws CoreException { |
| 74 | + /** |
| 75 | + * Prepares the sources for a given spec file. |
| 76 | + * |
| 77 | + * @param specFile the spec file |
| 78 | + * @param outStream The stream to write the output to. |
| 79 | + * @throws CoreException If the operation fails. |
| 80 | + */ |
| 81 | + public void buildPrep(IFile specFile, OutputStream outStream) throws CoreException { |
77 | 82 | List<String> command = new ArrayList<String>();
|
78 | 83 | command.addAll(Arrays.asList(macroDefines));
|
79 | 84 | command.add("-bp"); //$NON-NLS-1$
|
80 | 85 | command.add(specFile.getLocation().toString());
|
81 | 86 | try {
|
82 |
| - return Utils.runCommandToInputStream(command |
83 |
| - .toArray(new String[command.size()])); |
| 87 | + Utils.runCommand(outStream, |
| 88 | + command.toArray(new String[command.size()])); |
84 | 89 | } catch (IOException e) {
|
85 | 90 | throw new CoreException(new Status(IStatus.ERROR, RPMCorePlugin.ID,
|
86 | 91 | e.getMessage(), e));
|
|
0 commit comments