Skip to contentSkip to conversation

sed: Cope with ${bindir} and ${base_bindir} being the same

PATCH Superseded Mike Crowe 2 participants 6 messages Feb 5, 2015 – Mar 3, 2015

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/1 sed: Cope with ${bindir} and ${base_bindir} being the same

${bindir} and ${base_bindir} may be the same. If they are don't try and move files onto themselves.

---
 meta/recipes-extended/sed/sed_4.2.2.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-extended/sed/sed_4.2.2.bb +4 -2
index 72976de..bbfa238 100644
@@ -22,8 +22,10 @@ EXTRA_OECONF = "--disable-acl \
 do_install () {
 	autotools_do_install
 	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	rmdir ${D}${bindir}/
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
 }
 
 ALTERNATIVE_${PN} = "sed"
Signature · 1 line
2.1.4
#1 lore raw
Quoted 3 lines · Mike Crowe

${bindir} and ${base_bindir} may be the same. If they are don't try and move files onto themselves.

Funnily enough I did the same fix last week but didn't send it to the list yet as I needed to rewrite the message.

Can you update this to change both versions of sed?

Ross

author
#2 lore raw
Quoted 10 lines · Ross
Quoted 3 lines · Mike Crowe

${bindir} and ${base_bindir} may be the same. If they are don't try and move files onto themselves.

Funnily enough I did the same fix last week but didn't send it to the list yet as I needed to rewrite the message.

Can you update this to change both versions of sed?

Oh, I spotted there were two versions of sed but managed to forget that by the time I'd tested the patch. :(

I'll send an updated patch.

Thanks.

Mike.

author
#3 lore raw

PATCH v2 1/1 sed: Cope with ${bindir} and ${base_bindir} being the same

${bindir} and ${base_bindir} may be the same. If they are don't try and move files onto themselves.

---
 meta/recipes-extended/sed/sed_4.1.2.bb | 6 ++++--
 meta/recipes-extended/sed/sed_4.2.2.bb | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
meta/recipes-extended/sed/sed_4.1.2.bb +4 -2
index 4c0f345..40e3a53 100644
@@ -23,8 +23,10 @@ do_configure_prepend () {
 do_install () {
 	autotools_do_install
 	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	rmdir ${D}${bindir}/
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
 }
 
 ALTERNATIVE_${PN} = "sed"
meta/recipes-extended/sed/sed_4.2.2.bb +4 -2
index 72976de..bbfa238 100644
@@ -22,8 +22,10 @@ EXTRA_OECONF = "--disable-acl \
 do_install () {
 	autotools_do_install
 	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	rmdir ${D}${bindir}/
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
 }
 
 ALTERNATIVE_${PN} = "sed"
Signature · 1 line
2.1.4
author
#4 lore raw
Quoted 45 lines · Mike Crowe

${bindir} and ${base_bindir} may be the same. If they are don't try and move files onto themselves.

---
 meta/recipes-extended/sed/sed_4.1.2.bb | 6 ++++--
 meta/recipes-extended/sed/sed_4.2.2.bb | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
meta/recipes-extended/sed/sed_4.1.2.bb +4 -2
index 4c0f345..40e3a53 100644
@@ -23,8 +23,10 @@ do_configure_prepend () {
 do_install () {
 	autotools_do_install
 	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	rmdir ${D}${bindir}/
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
 }
 
 ALTERNATIVE_${PN} = "sed"
meta/recipes-extended/sed/sed_4.2.2.bb +4 -2
index 72976de..bbfa238 100644
@@ -22,8 +22,10 @@ EXTRA_OECONF = "--disable-acl \
 do_install () {
 	autotools_do_install
 	install -d ${D}${base_bindir}
-	mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-	rmdir ${D}${bindir}/
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
 }
 
 ALTERNATIVE_${PN} = "sed"
Signature · 1 line
2.1.4

It doesn't look like this patch has been merged. Is there something wrong with it than I need to attend to?

Thanks.

Mike.

#5 lore raw
Quoted 3 lines · Mike Crowe

It doesn't look like this patch has been merged. Is there something wrong with it than I need to attend to?

My fault - I didn't pull it into MUT as I had a local branch with an identical commit in, but then I failed to merge that branch. I'll sort that now.

Ross