Skip to contentSkip to conversation

update-rc.d: allow links target to be symlinks itself

PATCH Superseded Steffen Sledz 1 participant 3 messages May 11, 2010 – May 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update-rc.d: allow links target to be symlinks itself

Needed to be able to combine update-rc.d with update-alternatives.

---
 recipes/update-rc.d/files/symlink.patch |   18 ++++++++++++++++++
 recipes/update-rc.d/update-rc.d_0.7.bb  |    5 +++--
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 recipes/update-rc.d/files/symlink.patch
recipes/update-rc.d/files/symlink.patch new file +18 -0
new file mode 100644
index 0000000..63f1239
@@ -0,0 +1,18 @@
+diff -Nurd update-rc.d.orig//update-rc.d update-rc.d/update-rc.d
+--- update-rc.d.orig//update-rc.d	2010-05-11 15:22:22.000000000 +0200
++++ update-rc.d/update-rc.d	2010-05-11 15:24:14.000000000 +0200
+@@ -148,12 +148,12 @@
+ shift
+ 
+ if [ $1 != "remove" ]; then
+-	if [ ! -f "$initd/$bn" ]; then
++	if [ ! ( -f "$initd/$bn" -o -L "$initd/$bn" ) ]; then
+ 		echo "update-rc.d: $initd/$bn: file does not exist" >&2
+ 		exit 1
+ 	fi
+ else
+-	if [ -f "$initd/$bn" ]; then
++	if [ -f "$initd/$bn" -o -L "$initd/$bn" ]; then
+ 		if [ $force -eq 1 ]; then
+ 			echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2
+ 		else
recipes/update-rc.d/update-rc.d_0.7.bb +3 -2
index 3217dc1..794f6db 100644
@@ -4,12 +4,13 @@ DESCRIPTION = "Manage symlinks in /etc/rcN.d"
 LICENSE = "GPL"
 S = "${WORKDIR}/update-rc.d"
 INHIBIT_DEFAULT_DEPS = "1"
-PR = "r1"
+PR = "r2"
 
 BBCLASSEXTEND = "native"
 
 SRC_URI = "${HANDHELDS_CVS};module=apps/update-rc.d;tag=r0_7 \
-           file://add-verbose.patch;patch=1"
+           file://add-verbose.patch;patch=1 \
+           file://symlink.patch;patch=1"
 
 PACKAGE_ARCH = "all"
 
Signature · 1 line
1.6.4.2
#1 lore raw

PATCH v2 1/1 update-rc.d: allow link targets to be symlinks itself

Needed to be able to combine update-rc.d with update-alternatives.

---
 recipes/update-rc.d/files/symlink.patch |   18 ++++++++++++++++++
 recipes/update-rc.d/update-rc.d_0.7.bb  |    5 +++--
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 recipes/update-rc.d/files/symlink.patch
recipes/update-rc.d/files/symlink.patch new file +18 -0
new file mode 100644
index 0000000..06d62e6
@@ -0,0 +1,18 @@
+diff -Nurd update-rc.d.orig//update-rc.d update-rc.d/update-rc.d
+--- update-rc.d.orig//update-rc.d	2010-05-11 15:22:22.000000000 +0200
++++ update-rc.d/update-rc.d	2010-05-11 15:24:14.000000000 +0200
+@@ -148,12 +148,12 @@
+ shift
+ 
+ if [ $1 != "remove" ]; then
+-	if [ ! -f "$initd/$bn" ]; then
++	if [ ! \( -f "$initd/$bn" -o -L "$initd/$bn" \) ]; then
+ 		echo "update-rc.d: $initd/$bn: file does not exist" >&2
+ 		exit 1
+ 	fi
+ else
+-	if [ -f "$initd/$bn" ]; then
++	if [ -f "$initd/$bn" -o -L "$initd/$bn" ]; then
+ 		if [ $force -eq 1 ]; then
+ 			echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2
+ 		else
recipes/update-rc.d/update-rc.d_0.7.bb +3 -2
index 3217dc1..794f6db 100644
@@ -4,12 +4,13 @@ DESCRIPTION = "Manage symlinks in /etc/rcN.d"
 LICENSE = "GPL"
 S = "${WORKDIR}/update-rc.d"
 INHIBIT_DEFAULT_DEPS = "1"
-PR = "r1"
+PR = "r2"
 
 BBCLASSEXTEND = "native"
 
 SRC_URI = "${HANDHELDS_CVS};module=apps/update-rc.d;tag=r0_7 \
-           file://add-verbose.patch;patch=1"
+           file://add-verbose.patch;patch=1 \
+           file://symlink.patch;patch=1"
 
 PACKAGE_ARCH = "all"
 
Signature · 1 line
1.6.4.2
#2 lore raw

Re: [PATCH v2] update-rc.d: allow link targets to be symlinks itself

Forget this patch (at least for a while). May be it is not really needed.

Sorry for the annoyance.

Regards,
Steffen