lazarusllong / sqldeveloper-package

Oracle SQL Developer Debian package builder
https://lazarusllong.github.io/sqldeveloper-package/
2 stars 3 forks source link

fixed objdump usage under non English locale #3

Open danilopiazza opened 6 years ago

danilopiazza commented 6 years ago

Running objdump under a non English locale may produce different results, as the "file format" string may be localized.

Because of this, the ARCH variable will not be initialized correctly:

+ objdump -p /tmp/tmp.upd5ASPK50/sqldeveloper-17.4.1.054.0712/usr/share/sqldeveloper/netbeans/platform/modules/lib/amd64/linux/libjnidispatch-422.so
+ grep -E file format
+ sed -e s/^.*file format //
+ cut -d - -f 2-
+ tr - _
+ local ARCH=

This end up causing a failure in the ln invocation with the ln: failed to create symbolic link '...': File exists error message:

+ [ -d /tmp/tmp.upd5ASPK50/sqldeveloper-17.4.1.054.0712/usr/lib/-linux-gnu/sqldeveloper/17.4.1.054.0712 ]
+ mv --strip-trailing-slashes /tmp/tmp.upd5ASPK50/sqldeveloper-17.4.1.054.0712/usr/share/sqldeveloper/netbeans/platform/modules/lib/amd64/linux/libjnidispatch-422.so /tmp/tmp.upd5ASPK50/sqldeveloper-17.4.1.054.0712/usr/lib/-linux-gnu/sqldeveloper/17.4.1.054.0712/libjnidispatch.so.4.2.2
+ ln -s libjnidispatch.so.4.2.2 /tmp/tmp.upd5ASPK50/sqldeveloper-17.4.1.054.0712/usr/lib/-linux-gnu/sqldeveloper/17.4.1.054.0712/libjnidispatch.so

A similar issue affects other tools which make use of objdump; see this CMake bug: https://cmake.org/Bug/view.php?id=15002

Forage commented 6 years ago

I ran into the same issue and I can confirm that the fix works. Thanks