Bug 211781 - cad/NASTRAN-95: Workaround bug reporting the system is Linux based.
Summary: cad/NASTRAN-95: Workaround bug reporting the system is Linux based.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-12 14:18 UTC by Pedro F. Giffuni
Modified: 2016-08-23 02:30 UTC (History)
1 user (show)

See Also:


Attachments
reinplace FREEBSD instead of LINUX (464 bytes, patch)
2016-08-12 14:18 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer freebsd_triage 2016-08-12 14:18:49 UTC
Created attachment 173593 [details]
reinplace FREEBSD instead of LINUX

There is a minor bug where the code has a 'LINUX   ' string hardcoded and the reports appear to be generated on LINUX INTEL platform.
The string length is fixed and it's customary in FORTRAN to use capital letters so as a quick fix hardcode the 'FREEBSD' value instead.

The resulting reports look like this now:

                             ****
                           *      *
                          *        *
                          *  N A S T R A N
                          *        *
                           *      *
                             ****

                       INTEL COMPUTER SYSTEMS
                           FREEBSD VERSION
Comment 1 John Marino freebsd_committer freebsd_triage 2016-08-12 19:28:39 UTC
how about using ${OPSYS:tu} so that this fix will apple to DragonFly too?
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-08-12 19:54:24 UTC
(In reply to John Marino from comment #1)

I though about it but DRAGONFLY may be one character too long (FREEBSD is right on the limit and even breaks a comment).

I won't object if you want to test/commit it though.
Comment 3 John Marino freebsd_committer freebsd_triage 2016-08-18 13:34:08 UTC
if it's a technical limitation, that's fine.
It probably should be documented in a comment in the port makefile so this knowledge doesn't get lost later.
Comment 4 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-08-18 14:41:08 UTC
(In reply to John Marino from comment #3)

TBH, I didn't try, I just noticed they existing strings are fixed length and I haven't programmed in FORTRAN since the 80's.

BTW, what does Dragonfly report with $OPSYS? Just Dragonfly or DragonflyBSD?
Comment 5 John Marino freebsd_committer freebsd_triage 2016-08-18 14:45:32 UTC
it returns "DragonFly", thanks.  My fortran is rusty too, I'd have to review the basics before trying to modify it.
Comment 6 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-08-18 16:19:43 UTC
(In reply to John Marino from comment #5)
FWIW, if I use DRAGONFLY, the report will read:

                            INTEL COMPUTER SYSTEMS   
                                DRAGONF VERSION
Comment 7 John Marino freebsd_committer freebsd_triage 2016-08-18 20:24:56 UTC
Yeah, I think the best we can do is "BSD VERSION" but leaving it "FREEBSD" version is reasonable, given the 6/7 character limit.
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-08-23 02:30:11 UTC
A commit references this bug:

Author: marino
Date: Tue Aug 23 02:29:45 UTC 2016
New revision: 420643
URL: https://svnweb.freebsd.org/changeset/ports/420643

Log:
  cad/NASTRAN-95: Report version as FREEBSD rather than LINUX

  The maximum string length is 7 characters, so setting it to OPSYS:tu
  wouldn't work in all cases (e.g. DragonFly) but having NASTRAN advertise
  itself as a native FreeBSD program is still better in any case.

  PR:		211781
  Submitted by:	maintainer (pfg)

Changes:
  head/cad/NASTRAN-95/Makefile