Hi Jim,
On 07/ 7/15 02:45 PM, Jim Klimov wrote:
Hello Ram,
Makes sense, and that's why I started with touch-files following an
established example so as to support anything regardless of matching,
only an admin (or wrap-package) who'd touch the file is needed. ;)
Adding a touch file is okay. I have no objections to having that option in.
I think a "case" would be more readable and conservative on resources
than a stack of if-elif-else-fi (don't have to call an external program
too many times) and would suffice especially since you are comparing
fixed strings or, at most, simple wildcards here.
Yes, I'm aware of this but as of now, I'd rather have everything working
than
fork-avoidance optimizations. This can come at a later step.
In the patch itself, here's a bit that worries me: either I've had a
night too sleepless, or there is a logical error here:
+ STR_KERN_MAJOR=`echo "$PKGFMRI" | sed
's/^.*\@//;s/\,.*//;s/\-.*//'`
+ if test "$STR_KERN_MAJOR" = "5.12"; then
+ ###(comments snipped)
+ BRANCH_VERSION=$STR_KERN_MAJOR
+ HOST_OS_MAJORVERSION=`echo "$BRANCH_VERSION" |
cut -f2 -d'-' | cut -f1,2 -d'.'`
+ if test "$HOST_OS_MAJORVERSION" = "5.12"; then
+ HOST_OS_MAJORVERSION="12"
+ HOST_OS_MINORVERSION=`echo
"$BRANCH_VERSION" | cut -f2 -d'-' | cut -f6 -d'.'`
+ return 0
+ else
+ errorprint "Failed to parse the Solaris
kernel major version."
+ exit 1
Here you have STR_KERN_MAJOR=="5.12" (fixed, no more, no less), then
assign BRANCH_VERSION to the same "5.12" and try to `cut` major/minor
versions out of it. You do get "5.12" again as major, but minor without
the dash-separated part of the FMRI is meaningless (and ends up empty).
Oops, my mistake. Thanks. I've attached a new patch of that part of the code
which I think should address the problem.
Otherwise, cutting the "5.11", "0.5.11" or "5.12" parts seems to work
correctly here.
Also, in line 10 (added comment for OI Hipster string) there is "of"
instead of "or" ;)
Also fixed in the patch I've attached.
Let me know how this works for the OS/distros in question here.
Regards,
Ram.
Index: src/VBox/Installer/solaris/vboxconfig.sh
===================================================================
--- src/VBox/Installer/solaris/vboxconfig.sh (revision 101493)
+++ src/VBox/Installer/solaris/vboxconfig.sh (working copy)
@@ -245,7 +245,8 @@
# or "pkg://solaris/system/[email protected],5.11-5.12.0.0.0.4.1:20120908T030246Z"
# or "pkg://solaris/system/[email protected],5.11-0.175.0.0.0.1.0:20111012T032837Z"
# or "pkg://solaris/system/[email protected]:20121012T032837Z" [1]
- # [1]: The sed below doesn't handle this. It's instead parsed below in the PSARC/2012/240 case.
+ # or "pkg://openindiana.org/system/[email protected]:20150621T130732Z" (OI Hipster'15) [1]
+ # [1]: The sed below doesn't handle these. It's instead parsed below in the exceptions case.
STR_KERN_MAJOR=`echo "$PKGFMRI" | sed 's/^.*\@//;s/\,.*//'`
if test ! -z "$STR_KERN_MAJOR"; then
# The format is "0.5.11" or "5.12"
@@ -257,18 +258,21 @@
elif test "$STR_KERN_MAJOR" = "0.5.11" || test "$STR_KERN_MAJOR" = "5.11"; then
HOST_OS_MAJORVERSION="11"
else
- # This could be the PSARC/2012/240 naming scheme for S12.
- # The format is "pkg://solaris/system/[email protected]:20121012T032837Z"
- # The "5.12" following the "@" is the nominal version which we ignore for now as it is
- # not set by most pkg(5) tools...
- # STR_KERN_MAJOR is now of the format "5.12-5.12.0.0.0.9.1.3.0:20121012T032837Z" with '9' representing
- # the build number.
- BRANCH_VERSION=$STR_KERN_MAJOR
- HOST_OS_MAJORVERSION=`echo "$BRANCH_VERSION" | cut -f2 -d'-' | cut -f1,2 -d'.'`
- if test "$HOST_OS_MAJORVERSION" = "5.12"; then
+ # Handle exceptions
+ # The format is "pkg://solaris/system/[email protected]:20121012T032837Z" [1]
+ # or "pkg://openindiana.org/system/[email protected]:20150621T130732Z" (OI Hipster'15)
+ # [1]: This could be the PSARC/2012/240 naming scheme for S12.
+ # with '9' representing the build number. The "5.12" following the "@" is the nominal version
+ # which we ignore for now (as it is not set by most pkg(5) tools) and grab the "5.12" that follows
+ STR_KERN_MAJOR=`echo "$PKGFMRI" | sed 's/^.*\@//;s/\,.*//;s/\-.*//'`
+ if test "$STR_KERN_MAJOR" = "5.12"; then
HOST_OS_MAJORVERSION="12"
- HOST_OS_MINORVERSION=`echo "$BRANCH_VERSION" | cut -f2 -d'-' | cut -f6 -d'.'`
+ HOST_OS_MINORVERSION=`echo "$PKGFMRI" | cut -f2 -d'@' | cut -f2 -d'-' | cut -f6 -d'.'`
return 0
+ elif test "$STR_KERN_MAJOR" = "0.5.11"; then
+ # OI Hipster'15, assume snv_151 compatibility
+ HOST_OS_MAJORVERSION="11"
+ HOST_OS_MINORVERSION=151
else
errorprint "Failed to parse the Solaris kernel major version."
exit 1
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev