Skip to contentSkip to conversation

java.bbclass: fixed oe_jarinstall for broken symlinks

PATCH In review Marcin Juszkiewicz 4 participants 4 messages Nov 5, 2009 – Nov 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 java.bbclass: fixed oe_jarinstall for broken symlinks

From: Marcin Juszkiewicz <[email protected]>

Code checked for existance of JAR file and if it was present then it had to be removed before symlinking to it. But it was not working sometimes so we forced symlinking.

Proper fix is to check "does file exists or is a symlink" which we do now.

---
 classes/java.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
classes/java.bbclass +2 -2
index cacd2ce..b68035c 100644
@@ -68,11 +68,11 @@ oe_jarinstall() {
 
   # Creates symlinks out of the remaining arguments.
   while [ "$#" -gt 0 ]; do
-    if [ -e $dir/$1 ]; then
+    if [ -e $dir/$1 -o -h $dir/$1 ]; then
       oewarn "file was in the way. removing:" $dir/$1
       rm $dir/$1
     fi
-    ln -sf $destname $dir/$1
+    ln -s $destname $dir/$1
     shift
   done
 }
Signature · 1 line
1.6.5.2
#1 lore raw
Quoted 23 lines · Marcin Juszkiewicz

From: Marcin Juszkiewicz <[email protected]>

Code checked for existance of JAR file and if it was present then it had to be removed before symlinking to it. But it was not working sometimes so we forced symlinking.

Proper fix is to check "does file exists or is a symlink" which we do now.

---
 classes/java.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
classes/java.bbclass +0 -0
index cacd2ce..b68035c 100644
@@ -68,11 +68,11 @@ oe_jarinstall() {
 
   # Creates symlinks out of the remaining arguments.
   while [ "$#" -gt 0 ]; do

classes/java.bbclass oe_jarinstall() { · line 78

Quoted 10 lines
classes/java.bbclass +2 -2
-    if [ -e $dir/$1 ]; then
+    if [ -e $dir/$1 -o -h $dir/$1 ]; then
       oewarn "file was in the way. removing:" $dir/$1
       rm $dir/$1
     fi
-    ln -sf $destname $dir/$1
+    ln -s $destname $dir/$1
     shift
   done
 }

*ACK*

Bye Henning

#2 lore raw
Quoted 1 line · Henning Heinold

*ACK*

Could people please start giving proper acked-by lines?

Acked-by on v1 1/1
#3 lore raw
In reply to Marcin Juszkiewicz
Quoted 32 lines · Marcin Juszkiewicz

From: Marcin Juszkiewicz<[email protected]>

Code checked for existance of JAR file and if it was present then it had to be removed before symlinking to it. But it was not working sometimes so we forced symlinking.

Proper fix is to check "does file exists or is a symlink" which we do now.

---
  classes/java.bbclass |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
classes/java.bbclass +2 -2
index cacd2ce..b68035c 100644
@@ -68,11 +68,11 @@ oe_jarinstall() {
 
    # Creates symlinks out of the remaining arguments.
    while [ "$#" -gt 0 ]; do
-    if [ -e $dir/$1 ]; then
+    if [ -e $dir/$1 -o -h $dir/$1 ]; then
        oewarn "file was in the way. removing:" $dir/$1
        rm $dir/$1
      fi
-    ln -sf $destname $dir/$1
+    ln -s $destname $dir/$1
      shift
    done
  }