我有一个补丁可以应用于遗留代码库。那里有很多名为的文件pom.xml
,要跳过对其进行的更改。如何从补丁中删除它们?
sed '/^diff --git .*pom.xml$/,/^diff --git/d'
在末尾删除一个额外的行(需要进一步处理)。
我可能需要一个解决方案来删除两个模式之间的行,包括第一个模式和不包括第二个模式。我仅限于 MSYS,因此只能访问 Windows 命令、sed 和 mawk。
这是一个输入示例。那里有三个条目,第二个要删除。
diff --git a/core/contexts/org.eclipse.rcptt.ctx.debug/META-INF/MANIFEST.MF b/core/contexts/org.eclipse.rcptt.ctx.debug/META-INF/MANIFEST.MF
index a02c3f0..b74197f 100644
--- a/core/contexts/org.eclipse.rcptt.ctx.debug/META-INF/MANIFEST.MF
+++ b/core/contexts/org.eclipse.rcptt.ctx.debug/META-INF/MANIFEST.MF
@@ -2,13 +2,13 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Q7 Debug
Bundle-SymbolicName: org.eclipse.rcptt.ctx.debug;singleton:=true
-Bundle-Version: 1.5.0.qualifier
+Bundle-Version: 1.5.3.qualifier
Bundle-ClassPath: .
Bundle-Vendor: Eclipse RCP Testing Tool Project
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.rcptt.core;bundle-version="[1.5.0,1.6.0)";visibility:=reexport
+ org.eclipse.rcptt.core;bundle-version="[1.5.3,1.6.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.rcptt.debug,
org.eclipse.rcptt.debug.impl,
diff --git a/core/contexts/org.eclipse.rcptt.ctx.debug/pom.xml b/core/contexts/org.eclipse.rcptt.ctx.debug/pom.xml
index e12f814..e18b46a 100644
--- a/core/contexts/org.eclipse.rcptt.ctx.debug/pom.xml
+++ b/core/contexts/org.eclipse.rcptt.ctx.debug/pom.xml
@@ -4,10 +4,10 @@
<parent>
<artifactId>rcptt.core.contexts</artifactId>
<groupId>org.eclipse.rcptt</groupId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.3-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.rcptt</groupId>
<artifactId>org.eclipse.rcptt.ctx.debug</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.5.3-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/core/contexts/org.eclipse.rcptt.ctx.extensions/META-INF/MANIFEST.MF b/core/contexts/org.eclipse.rcptt.ctx.extensions/META-INF/MANIFEST.MF
index 88ccb8b..b8c1308 100644
--- a/core/contexts/org.eclipse.rcptt.ctx.extensions/META-INF/MANIFEST.MF
+++ b/core/contexts/org.eclipse.rcptt.ctx.extensions/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Q7 Context Extensions
Bundle-SymbolicName: org.eclipse.rcptt.ctx.extensions;singleton:=true
-Bundle-Version: 1.5.0.qualifier
+Bundle-Version: 1.5.3.qualifier
Bundle-Activator: org.eclipse.rcptt.ctx.extensions.ContextExtensionsPlugin
Bundle-Vendor: Eclipse RCP Testing Tool Project
Require-Bundle: org.eclipse.core.runtime,
到目前为止,我发现的所有解决方案要么删除带有模式的起始行和尾随行,要么一个都不删除。