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

check for dig and adjusts dependency check logic #457

Merged

Conversation

mwoolweaver
Copy link
Contributor

@mwoolweaver mwoolweaver commented Apr 2, 2025

Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

  • adds check for dig command

  • adjusts the logic for dependency check to check for all 3 before exiting.

How does this PR accomplish the above?:

check_dependencies() {
    local hasDeps=true
    # Check for required dependencies
    if ! command -v curl >/dev/null 2>&1; then
        printf "%b" "${check_box_bad} Error!\n    'curl' is missing but required.\n"
        hasDeps=false
    fi

    if ! command -v jq >/dev/null 2>&1; then
        printf "%b" "${check_box_bad} Error!\n    'jq' is missing but required.\n"
        hasDeps=false
    fi

    if ! command -v dig >/dev/null 2>&1; then 
        printf "%b" "${check_box_bad} Error!\n    'dig' is missing but required.\n" 
        hasDeps=false
     fi

     if ! command -v tput >/dev/null 2>&1; then 
        printf "%b" "${check_box_bad} Error!\n    'tput' is missing but required.\n" 
        hasDeps=false
     fi

     if [ "${hasDeps}" = false ]; then 
        printf "%b" "\n Please install the dependencies noted above.\n" 
        exit 1
     fi
}

fixes #455


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

@mwoolweaver mwoolweaver force-pushed the dependency-check-adjustment branch 3 times, most recently from 4a45b1f to 11282cd Compare April 2, 2025 23:40
@darkexplosiveqwx
Copy link

ncurses is required for getting the size of the terminal. Specifically the tput command from that package.

@mwoolweaver mwoolweaver force-pushed the dependency-check-adjustment branch 2 times, most recently from 5245e79 to 60b5980 Compare April 4, 2025 00:54
@mwoolweaver
Copy link
Contributor Author

ncurses is required for getting the size of the terminal. Specifically the tput command from that package.

added as well

@mwoolweaver mwoolweaver force-pushed the dependency-check-adjustment branch 6 times, most recently from f4a7d16 to c3a2335 Compare April 4, 2025 02:46
@yubiuser yubiuser mentioned this pull request Apr 4, 2025
@yubiuser yubiuser linked an issue Apr 4, 2025 that may be closed by this pull request
Co-authored-by: yubiuser <[email protected]>
Signed-off-by: Michael Woolweaver <[email protected]>
@mwoolweaver mwoolweaver force-pushed the dependency-check-adjustment branch from fbacf17 to 21e6ac0 Compare April 4, 2025 20:23
@yubiuser yubiuser merged commit f350acf into pi-hole:development Apr 4, 2025
3 checks passed
@mwoolweaver mwoolweaver deleted the dependency-check-adjustment branch April 6, 2025 04:23
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.

Missing required packages in setup/install documentation
3 participants