E530 Make PADD compatible with non-master branches by yubiuser · Pull Request #232 · pi-hole/PADD · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@yubiuser
Copy link
Member
@yubiuser yubiuser commented Jun 23, 2022
  • What does this PR aim to accomplish?:

This PR allows to run PADD if non-master branches are used.
The issue so far was that PADD used fixed arguments when obtaining the version information via pihole -v. If one was using custom branches, the version information do not appear (nor not at the spot) where they are expected. Therefore ./piholeVersion could contained special characters (e.g. () which were parsed by PADD and made the script fail.

This PR does

  1. xx_version_latest is always the last column in pihole -v (therefore using awk '{print $(NF)}`)
  2. Check if the xx_version string matches [0-9] or [0-9].[0-9]+ via the RegEX
    2.1) if not, set the version to N/A
  3. Do not hardcode v in the output but the version string before printing (avoids vN/A being printed`

P.S. as we are try to be POSIX compliant, we can't use =~ for RegEx matching but use grep -E instead

Master:
Bildschirmfoto zu 2022-06-23 14-10-17

Dev:
Bildschirmfoto zu 2022-06-23 14-11-50


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)

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

@yubiuser yubiuser requested a review from a team June 23, 2022 12:27
@dschaper
Copy link
Member

Can you squash these to one commit and force-push the branch?

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser
Copy link
Member Author

Done.

@yubiuser yubiuser merged commit ca72012 into development Jun 25, 2022
@yubiuser yubiuser deleted the custom_branch branch June 25, 2022 20:35
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.

3 participants

0