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

Subscribers

People subscribed via source and target branches