projects
/
cc0
/
argeo-build.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c598d18
)
Improve osgi-uninstall
author
Mathieu Baudier <mbaudier@argeo.org>
Tue, 23 May 2023 09:44:59 +0000
(11:44 +0200)
committer
Mathieu Baudier <mbaudier@argeo.org>
Tue, 23 May 2023 09:44:59 +0000
(11:44 +0200)
src/org/argeo/build/Make.java
patch
|
blob
|
history
diff --git
a/src/org/argeo/build/Make.java
b/src/org/argeo/build/Make.java
index 70bf8b5c25f16f8bd3fbd2baaa1c95aebfbcb234..9b06aa8c2105749e9c033f4a9fda5f1503a53675 100644
(file)
--- a/
src/org/argeo/build/Make.java
+++ b/
src/org/argeo/build/Make.java
@@
-354,11
+354,11
@@
public class Make {
if (uninstall) { // uninstall
if (Files.exists(targetJarP)) {
Files.delete(targetJarP);
if (uninstall) { // uninstall
if (Files.exists(targetJarP)) {
Files.delete(targetJarP);
- Path targetParent = targetJarP.getParent();
- deleteEmptyParents(targetA2, targetParent);
logger.log(DEBUG, "Removed " + targetJarP);
count++;
}
logger.log(DEBUG, "Removed " + targetJarP);
count++;
}
+ Path targetParent = targetJarP.getParent();
+ deleteEmptyParents(targetA2, targetParent);
} else { // install
Files.createDirectories(targetJarP.getParent());
boolean update = Files.exists(targetJarP);
} else { // install
Files.createDirectories(targetJarP.getParent());
boolean update = Files.exists(targetJarP);
@@
-374,9
+374,10
@@
public class Make {
void deleteEmptyParents(Path targetA2, Path targetParent) throws IOException {
if (!Files.isDirectory(targetParent))
throw new IllegalArgumentException(targetParent + " must be a directory");
void deleteEmptyParents(Path targetA2, Path targetParent) throws IOException {
if (!Files.isDirectory(targetParent))
throw new IllegalArgumentException(targetParent + " must be a directory");
+ boolean isA2target = Files.isSameFile(targetA2, targetParent);
if (!Files.list(targetParent).iterator().hasNext()) {
Files.delete(targetParent);
if (!Files.list(targetParent).iterator().hasNext()) {
Files.delete(targetParent);
- if (
Files.isSameFile(targetA2, targetParent)
)
+ if (
isA2target
)
return;// stop after deleting A2 base
deleteEmptyParents(targetA2, targetParent.getParent());
}
return;// stop after deleting A2 base
deleteEmptyParents(targetA2, targetParent.getParent());
}