Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #981, implement better filename parser #1156

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Feb 5, 2021

Describe the contribution

Implemements a new function in FS to parse an input file name from a user - CFE_FS_ParseInputFileName()

The new function produces fully-qualified output where the input may omit either a pathname or an extension. These items will be added from the specified defaults, if missing, and a complete fully-qualified filename will be output.

If the input is already a fully qualified filename, then the output is the same as the input (basically a copy).

This initially is used to provide better cross-platform startup script processing, where module suffix may differ across platforms. Only the "basename" of the filename needs to be specified in the startup script - everything else can come from defaults.

Fixes #981

Testing performed
Build and sanity test CFE.
Check startup with all combinations of filename in script - fully qualified, basename only.
Check startup with new default startup script that has basename only - works on both Linux (.so) and RTEMS (.obj) with no change.

Expected behavior changes
Easier switching between platforms - startup script does not need to change to account for the different suffix that different platforms use.

System(s) tested on
Ubuntu 20.04 (native)
RTEMS 4.11 (i686, QEMU)

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

@jphickey
Copy link
Contributor Author

jphickey commented Feb 5, 2021

This also needs a rebase when next baseline is ready. Commit for pre-review is in cc5c968.

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Feb 5, 2021
@astrogeco
Copy link
Contributor

astrogeco commented Feb 17, 2021

CCB 2021-02-17 APPROVED

  • attempts to avoid the pain of file extensions across platforms
  • adds a new function to file services
  • Use this new function instead of strcpy
  • doesn't break existing scripts
  • push to remote again since cfe_fs should have two functions not one

@astrogeco astrogeco added conflicts and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Feb 17, 2021
Implmements a new function in FS to parse an input file name
from a user.  Initially applied to startup script processing.

The new function produces fully-qualified output where the input
may omit either a pathname or an extension.  These items will be
added from the specified defaults, if missing, and a complete
fully-qualified filename will be output.

If the input is already a fully qualified filename, then the
output is the same as the input (basically a copy).

This initially is used to provide better cross-platform startup
script processing, where module suffix may differ across platforms.
Only the "basename" of the filename needs to be specified in the
startup script - everything else can come from defaults.
@jphickey jphickey force-pushed the fix-981-better-filename-parser branch from cc5c968 to 361eb65 Compare February 26, 2021 19:05
@jphickey jphickey marked this pull request as ready for review February 26, 2021 20:49
@jphickey
Copy link
Contributor Author

This should be good to merge now.

@astrogeco astrogeco changed the base branch from main to integration-candidate March 2, 2021 19:03
@astrogeco astrogeco merged commit f55cc82 into nasa:integration-candidate Mar 2, 2021
@jphickey jphickey deleted the fix-981-better-filename-parser branch March 10, 2021 14:43
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update startup processing to optionally use module suffix
3 participants