Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package google-android-installers

At the time of writing this, I'm waiting for my sponsor to upload the latest 
version to unstable. It is also tagged in the VCS if you want to upload it 
yourself. See:

https://salsa.debian.org/google-android-tools-team/google-android-installers

https://salsa.debian.org/google-android-tools-team/google-android-installers/-/tags/debian%2F1675172738

[ Reason ]
(Explain what the reason for the unblock request is.)
A RC bug was filed towards the package: #1035713

[ Impact ]
(What is the impact for the user if the unblock isn't granted?)

[ Tests ]
(What automated or manual tests cover the affected code?)

- I tested that the binary package doesn't have any broken symbolic links, and 
that the symbolic links target the correct file.
- I tested that the change didn't break installation with the other binary 
packages.

[ Risks ]
(Discussion of the risks involved. E.g. code is trivial or
complex, key package vs leaf package, alternatives available.)

No particular risk AFAIK.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

[ Other info ]
(Anything else the release team should know.)

At the time of writing this, I'm waiting for my sponsor to upload the latest 
version to unstable. It is also tagged in the VCS if you want to upload it 
yourself.

unblock google-android-installers/1675172738
diff -Nru google-android-installers-1675172737/debian/changelog google-android-installers-1675172738/debian/changelog
--- google-android-installers-1675172737/debian/changelog	2023-04-09 22:31:58.000000000 +0200
+++ google-android-installers-1675172738/debian/changelog	2023-05-09 17:35:00.000000000 +0200
@@ -1,3 +1,9 @@
+google-android-installers (1675172738) unstable; urgency=medium
+
+  * Makefile: fix broken symbolic links (Closes: #1035713)
+
+ -- Fab Stz <fabstz...@yahoo.fr>  Tue, 09 May 2023 17:35:00 +0200
+
 google-android-installers (1675172737) unstable; urgency=medium
 
   * cmdline-tools: set Architecture to 'amd64 i386'
diff -Nru google-android-installers-1675172737/for-postinst/default/Makefile google-android-installers-1675172738/for-postinst/default/Makefile
--- google-android-installers-1675172737/for-postinst/default/Makefile	2023-04-09 22:31:58.000000000 +0200
+++ google-android-installers-1675172738/for-postinst/default/Makefile	2023-05-09 17:35:00.000000000 +0200
@@ -49,6 +49,34 @@
 	  cd $(DL_DIR) && unzip -ouq $(DL_DIR)/$(PKG_SOURCE); \
 	fi
 
+# Search for broken symbolic links & fix them
+	@if [ $$(unzip -Z -1 $(DL_DIR)/$(PKG_SOURCE) | cut -d '/' -f1 | sort -u | wc -l) -gt 1 ]; then \
+	  ZIP_ROOT_DIR=$(TRG_DIR) ;\
+	else \
+	  ZIP_ROOT_DIR=$$(unzip -Z -1 $(DL_DIR)/$(PKG_SOURCE) | head -1 | cut -d '/' -f 1) ;\
+	fi && \
+	BROKEN_SYMLINKS=$$(cd $(DL_DIR)/$$ZIP_ROOT_DIR && find -xtype l -exec ls {} \;) && \
+	if [ -n "$$BROKEN_SYMLINKS" ]; then \
+	  echo "\n  Fixing broken symbolic links."; \
+	fi && \
+	for file in $$BROKEN_SYMLINKS; do \
+	  cd $(DL_DIR)/$$ZIP_ROOT_DIR && \
+	  LINK_TARGET=$$(readlink "$$file") && \
+	  REL_PATH_TO_TARGET=$$(echo "$$LINK_TARGET" | sed "s|.*$$ZIP_ROOT_DIR/\(.*\)|\1|") && \
+	  echo "    Replacing symbolic link: $$file" && \
+	  echo "      Original target: $$LINK_TARGET" && \
+	  echo "      New target: $$REL_PATH_TO_TARGET" && \
+	  ln -fsr "$$REL_PATH_TO_TARGET" "$$file"; \
+	done; \
+	BROKEN_SYMLINKS_AFTER=$$(cd $(DL_DIR)/$$ZIP_ROOT_DIR && find -xtype l -exec ls {} \;) && \
+	if [ -n "$$BROKEN_SYMLINKS_AFTER" ]; then \
+	  echo "\n  Some files have broken symbolic links. Please report a bug to the package maintainer\n"; \
+	  for item in $$BROKEN_SYMLINKS_AFTER; do \
+	    echo "    $$item"; \
+	  done && \
+	  exit 1 ;\
+	fi
+
 $(DL_DIR)/$(PKG_SOURCE):
 	cd $(DL_DIR) && \
 		su nobody -s /bin/sh -c "wget --continue $(PKG_SOURCE_URL) -O $(PKG_SOURCE).tmp && mv $(PKG_SOURCE).tmp $(PKG_SOURCE)"

Reply via email to