Bug#923168: initscripts: Old cruft in initscripts postinst

2019-02-27 Thread Pierre Ynard
> Thank you very much for your research and patches. Can you please
> re-submit your patches in format, generated by `git format-patch'?
>
> What you included is `git show` output, which is not possible to apply
> directly. Thank you again.

Here you go.

-- 
Pierre Ynard
From 289d898ca707be223d4220951cdc3753d21e2df6 Mon Sep 17 00:00:00 2001
From: Pierre Ynard 
Date: Sun, 24 Feb 2019 17:29:36 +0100
Subject: [PATCH 1/2] Remove write-only variable left over from legacy
 migration postinst code

The code using that workaround is long gone.
---
 debian/initscripts.postinst | 6 --
 1 file changed, 6 deletions(-)

diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index c6ac94d..4ed27ec 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -9,12 +9,6 @@ set -e
 . /lib/init/tmpfs.sh
 . /lib/init/mount-functions.sh
 
-# Set this as a variable to hide from lintian the fact that we're removing
-# it; otherwise, a wrong lintian check + ftp fatal autoreject prevents us
-# from uploading this legitimate code, even though the previous upload was
-# accepted without incident.
-devshm=/dev/shm
-
 case "$1" in
   configure)
 	PREV_VER=$2
-- 
2.1.4

From 2f1e2ebf9e6154acabb419789ee193678e221300 Mon Sep 17 00:00:00 2001
From: Pierre Ynard 
Date: Sun, 24 Feb 2019 17:39:16 +0100
Subject: [PATCH 2/2] Clean up unused leftover legacy migration code from
 postinst

The postinst code using this was long cleaned up itself.
---
 debian/initscripts.postinst | 34 --
 1 file changed, 34 deletions(-)

diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index 4ed27ec..ad0eb4d 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -20,40 +20,6 @@ esac
 
 umask 022
 
-compat_link () {
-	SRC=$1
-	DEST=$2
-
-	ssrc="$(stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
-	sdest="$(stat -L --format="%d %i" "$DEST" 2>/dev/null || :)"
-
-	if [ -n "$ssrc" ] && [ "$ssrc" != "$sdest" ]; then
-		echo "guest environment detected: Linking $DEST to $SRC"
-		(
-			if [ -e $DEST ]; then
-if [ -L $DEST ]; then
-	echo "$DEST is already a symlink; not replacing with link to $SRC"
-	exit 0
-elif [ -d $DEST ]; then
-	rmdir $DEST || exit 1
-else
-	echo "$DEST isn't a directory or a symlink"
-	exit 1
-fi
-			fi
-			ln -fs $SRC $DEST
-		) || {
-			echo "Can't symlink $DEST to $SRC; please fix manually."
-			return 1
-		}
-		if which restorecon >/dev/null 2>&1; then
-			restorecon "$DEST"
-		fi
-	fi
-
-	return 0
-}
-
 # In 2.88dsf-23 the "mountoverflowtmp" script was dropped entirely.
 if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-23" ; then
 update-rc.d -f mountoverflowtmp remove >/dev/null
-- 
2.1.4



Bug#923168: initscripts: Old cruft in initscripts postinst

2019-02-26 Thread Dmitry Bogatov


[2019-02-24 18:48] Pierre Ynard 
> Package: initscripts
> Version: 2.93-8
> Severity: minor
> Tags: patch
>
> Hello,
>
> initscripts.postinst still contains old cruft, unused now as far as I
> can see, left over from the /run/shm migration. The code making use of
> it was already removed in:
>
> https://salsa.debian.org/debian/sysvinit/commit/e58f3742cc303fd1563e6cf046661e892b97181a
>
> > debian: Clean up legacy migration logic in maintainer and init scripts 
>
> One is a stray, write-only $devshm variable introduced as a workaround
> in:
>
> https://salsa.debian.org/debian/sysvinit/commit/82a6316cbaa982d5887c2bec25a903f4a64843c6
>
> > initscripts.postinst: hide from lintian the fact that we're removing
> > /dev/shm, since otherwise a buggy lintian check prevents us from
> > uploading legitimate code to the archive.
>
> The other is a compat_link() helper function doing the kind of things
> also handled in /lib/init/mount-functions.sh
>
> I think they're safe to remove now.

Thank you very much for your research and patches. Can you please
re-submit your patches in format, generated by `git format-patch'?

What you included is `git show` output, which is not possible to apply
directly. Thank you again.
-- 
Note, that I send and fetch email in batch, once every 24 hours.
 If matter is urgent, try https://t.me/kaction
 --



Bug#923168: initscripts: Old cruft in initscripts postinst

2019-02-24 Thread Pierre Ynard
Package: initscripts
Version: 2.93-8
Severity: minor
Tags: patch

Hello,

initscripts.postinst still contains old cruft, unused now as far as I
can see, left over from the /run/shm migration. The code making use of
it was already removed in:

https://salsa.debian.org/debian/sysvinit/commit/e58f3742cc303fd1563e6cf046661e892b97181a

> debian: Clean up legacy migration logic in maintainer and init scripts 

One is a stray, write-only $devshm variable introduced as a workaround
in:

https://salsa.debian.org/debian/sysvinit/commit/82a6316cbaa982d5887c2bec25a903f4a64843c6

> initscripts.postinst: hide from lintian the fact that we're removing
> /dev/shm, since otherwise a buggy lintian check prevents us from
> uploading legitimate code to the archive.

The other is a compat_link() helper function doing the kind of things
also handled in /lib/init/mount-functions.sh

I think they're safe to remove now.


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages initscripts depends on:
ii  coreutils   8.30-1
ii  debianutils 4.8.6.1
ii  lsb-base10.2018112800
ii  mount   2.33.1-0.1
ii  sysv-rc 2.93-8
ii  sysvinit-utils  2.93-8

Versions of packages initscripts recommends:
ii  e2fsprogs  1.44.5-1
ii  psmisc 23.2-1

initscripts suggests no packages.

-- Configuration Files:
/etc/default/rcS changed [not included]
/etc/default/tmpfs changed [not included]

-- no debconf information
commit 289d898ca707be223d4220951cdc3753d21e2df6
Author: Pierre Ynard 
Date:   Sun Feb 24 17:29:36 2019 +0100

Remove write-only variable left over from legacy migration postinst code

The code using that workaround is long gone.

diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index c6ac94d..4ed27ec 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -9,12 +9,6 @@ set -e
 . /lib/init/tmpfs.sh
 . /lib/init/mount-functions.sh
 
-# Set this as a variable to hide from lintian the fact that we're removing
-# it; otherwise, a wrong lintian check + ftp fatal autoreject prevents us
-# from uploading this legitimate code, even though the previous upload was
-# accepted without incident.
-devshm=/dev/shm
-
 case "$1" in
   configure)
 	PREV_VER=$2
commit 2f1e2ebf9e6154acabb419789ee193678e221300
Author: Pierre Ynard 
Date:   Sun Feb 24 17:39:16 2019 +0100

Clean up unused leftover legacy migration code from postinst

The postinst code using this was long cleaned up itself.

diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index 4ed27ec..ad0eb4d 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -20,40 +20,6 @@ esac
 
 umask 022
 
-compat_link () {
-	SRC=$1
-	DEST=$2
-
-	ssrc="$(stat -L --format="%d %i" "$SRC" 2>/dev/null || :)"
-	sdest="$(stat -L --format="%d %i" "$DEST" 2>/dev/null || :)"
-
-	if [ -n "$ssrc" ] && [ "$ssrc" != "$sdest" ]; then
-		echo "guest environment detected: Linking $DEST to $SRC"
-		(
-			if [ -e $DEST ]; then
-if [ -L $DEST ]; then
-	echo "$DEST is already a symlink; not replacing with link to $SRC"
-	exit 0
-elif [ -d $DEST ]; then
-	rmdir $DEST || exit 1
-else
-	echo "$DEST isn't a directory or a symlink"
-	exit 1
-fi
-			fi
-			ln -fs $SRC $DEST
-		) || {
-			echo "Can't symlink $DEST to $SRC; please fix manually."
-			return 1
-		}
-		if which restorecon >/dev/null 2>&1; then
-			restorecon "$DEST"
-		fi
-	fi
-
-	return 0
-}
-
 # In 2.88dsf-23 the "mountoverflowtmp" script was dropped entirely.
 if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-23" ; then
 update-rc.d -f mountoverflowtmp remove >/dev/null