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

Update pkglist.awk #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update pkglist.awk #92

wants to merge 1 commit into from

Conversation

gorsing
Copy link

@gorsing gorsing commented Oct 1, 2024

Changes Made:

  1. Functions Created
    Four functions were introduced to modularize the logic and improve readability:

    • process_file: Handles file processing logic.
    • extract_fmri: Extracts the FMRI from a given line.
    • check_facet: Checks for the facet condition in the file.
    • print_fmri: Outputs the FMRI and facet information.
  2. Variable Names
    Descriptive variable names were introduced, and local scope was applied where necessary to enhance readability and maintainability.

  3. Control Flow
    The do...while loops were replaced with standard while loops to simplify and improve clarity.

  4. Separation of Concerns
    Each function now focuses on a single responsibility, making the code easier to understand, maintain, and modify.


This refactoring preserves the original functionality while significantly improving the code’s readability and future adaptability.

Changes Made:

    Functions Created:
        process_file: Handles file processing logic.
        extract_fmri: Extracts the FMRI from a given line.
        check_facet: Checks for the facet condition in the file.
        print_fmri: Outputs the FMRI and facet information.

    Variable Names: Improved readability by using more descriptive variable names and adding local scope where necessary.

    Control Flow: The do...while loops were replaced with standard while loops to improve clarity.

    Separation of Concerns: Each function is focused on a single task, making it easier to read and maintain.

This refactoring should maintain the original functionality while making the code easier to understand and modify in the future.
@danmcd
Copy link
Member

danmcd commented Oct 1, 2024

We do not accept pull requests. Please visit here:

https://illumos.org/docs/contributing/gerrit/

and submit this via Gerrit, and remind the community at the illumos developer's list:

https://illumos.org/docs/community/lists/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants