Merge ~paelzer/ubuntu/+source/open-vm-tools:lp-1944946-old-lib-path-HIRSUTE into ubuntu/+source/open-vm-tools:ubuntu/hirsute-devel

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: d94d387663f2983cbd441f0e51442be07b085f52
Proposed branch: ~paelzer/ubuntu/+source/open-vm-tools:lp-1944946-old-lib-path-HIRSUTE
Merge into: ubuntu/+source/open-vm-tools:ubuntu/hirsute-devel
Diff against target: 66 lines (+36/-0)
3 files modified
debian/changelog (+9/-0)
debian/open-vm-tools.postinst (+24/-0)
debian/rules (+3/-0)
Reviewer Review Type Date Requested Status
Miriam España Acebal (community) Approve
Canonical Server packageset reviewers Pending
git-ubuntu developers Pending
Review via email: mp+410022@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
7398339... by Christian Ehrhardt 

d/open-vm-tools.postinst: handle upgrades from <11.3.0-2 in regard to the symlink

Signed-off-by: Christian Ehrhardt <email address hidden>

d94d387... by Christian Ehrhardt 

changelog: handle upgrades from <11.3.0-2

Signed-off-by: Christian Ehrhardt <email address hidden>

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Great finding by mirespace - conflicts when upgrading from pre 11.3 (e.g. -release) when dir is replaced by a symlink.
I added a new commit that handles those in postinst.
New builds started in the PPA.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Now also fixed
 SC2039: In POSIX sh, == in place of = is undefined.
which caused:
 /var/lib/dpkg/info/open-vm-tools.postinst: 21: [: /usr/lib/open-vm-tools: unexpected operator

Revision history for this message
Miriam España Acebal (mirespace) wrote :

Hi Christian... thanks for the fun while testing the MP :). All works ok.
LGTM, +1

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you, uploading

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading open-vm-tools_11.3.0-2ubuntu0~ubuntu21.04.2.dsc: done.
  Uploading open-vm-tools_11.3.0-2ubuntu0~ubuntu21.04.2.debian.tar.xz: done.
  Uploading open-vm-tools_11.3.0-2ubuntu0~ubuntu21.04.2_source.buildinfo: done.
  Uploading open-vm-tools_11.3.0-2ubuntu0~ubuntu21.04.2_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index e7c287e..d018a58 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+open-vm-tools (2:11.3.0-2ubuntu0~ubuntu21.04.2) hirsute; urgency=medium
7+
8+ * d/rules: provide a compat link for the old open-vm-tools
9+ library/plugin paths (LP: #1944946)
10+ - d/open-vm-tools.postinst: handle upgrades from <11.3.0-2 in regard
11+ to the symlink
12+
13+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 12 Oct 2021 07:50:08 +0200
14+
15 open-vm-tools (2:11.3.0-2ubuntu0~ubuntu21.04.1) hirsute; urgency=medium
16
17 * Update to latest release v11.3.0 (LP: #1933143)
18diff --git a/debian/open-vm-tools.postinst b/debian/open-vm-tools.postinst
19index f181ab2..9402a5e 100644
20--- a/debian/open-vm-tools.postinst
21+++ b/debian/open-vm-tools.postinst
22@@ -7,6 +7,30 @@ case "${1}" in
23 if which udevadm 1>/dev/null; then
24 udevadm trigger || true
25 fi
26+
27+ # Transitions from directory (<11.3.0-2) to symlink can cause issues
28+ # See this bug and links from there for prior examples
29+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626203
30+ # Upgrades "through" 11.3.0-2 are ok as it removed the dir and then
31+ # deploys the symlink on the next upgrade. But directly from e.g.
32+ # 2:11.0.5-4 in focal-release the upgrade would leave a dir behind.
33+ if [ -n "$2" ] && dpkg --compare-versions -- "$2" lt "2:11.3.0-2~"; then
34+ # upgrade from a version that had the directory
35+ d_to_s_dir="/usr/lib/open-vm-tools"
36+ if [ -d "$d_to_s_dir" ]; then
37+ if [ "$(find "$d_to_s_dir" -maxdepth 0 -empty)" = "$d_to_s_dir" ]; then
38+ # remove empty dir
39+ rmdir "$d_to_s_dir"
40+ else
41+ # Backup non-empty dir
42+ echo "Warning $d_to_s_dir not empty, create backup in $d_to_s_dir.bckp"
43+ mv "$d_to_s_dir" "$d_to_s_dir.bckp"
44+ fi
45+ target_dir=$(dpkg -L open-vm-tools | grep '^/usr/lib/.*-linux-gnu/open-vm-tools$')
46+ # Create symlink in place of the former directory
47+ ln -s "$target_dir" "$d_to_s_dir"
48+ fi
49+ fi
50 ;;
51
52 abort-upgrade|abort-remove|abort-deconfigure)
53diff --git a/debian/rules b/debian/rules
54index f19b2ba..481ec14 100755
55--- a/debian/rules
56+++ b/debian/rules
57@@ -85,6 +85,9 @@ override_dh_auto_install:
58 mv debian/open-vm-tools/usr/lib/$(DEB_HOST_MULTIARCH)/open-vm-tools/serviceDiscovery/scripts/* debian/open-vm-tools-sdmp/usr/lib/$(DEB_HOST_MULTIARCH)/open-vm-tools/serviceDiscovery/scripts/
59 rm -rf debian/open-vm-tools/usr/lib/$(DEB_HOST_MULTIARCH)/open-vm-tools/serviceDiscovery/
60
61+ # Compat link for LP: #1944946 due to software checking the old non multiarch .so paths
62+ ln --relative --symbolic debian/open-vm-tools/usr/lib/$(DEB_HOST_MULTIARCH)/open-vm-tools debian/open-vm-tools/usr/lib/open-vm-tools
63+
64 override_dh_gencontrol:
65 if [ "${VENDOR}" = "UBUNTU" ]; \
66 then \

Subscribers

People subscribed via source and target branches