n0k0m3 / revanced-build-template

Github Template for building Revanced
GNU General Public License v3.0
139 stars 155 forks source link

fix: Patches not being excluded from the build #30

Closed ManorSailor closed 2 years ago

ManorSailor commented 2 years ago

On testing the code with several echo statements in the script, the piece of code responsible for excluding patches was indeed working fine. Everything was working correctly except the patches weren't being excluded during the time build command was executed. This threw me off a bit, so I ventured into figuring out the cause, I saw some trailing white-spaces when the patches array was being unpacked. I added some code to get rid of that, Nope. It wasn't the issue.

I rewind back to 81ae527627c022f78e92b1129a1e4d0399f88ced when things were working fine & tested until they weren't. This 300c85f17ff4ec801c77f08a628da3c153fa6db9 commit caused it to break. I have no idea why.

I took the code snippet & executed it locally on my machine with a dummy file. It is working as expected, as long as there is anything other than a hash, it returned true, else it returned false. All good. Heck, even looking at Github Actions logs it was clear the code was being executed & patches were being added to the array.

Anyway. Apparently, all it needed was a hash in file. I tested this behavior multiple times & this shouldn't happen but for some weird reason including a single hash in patches.txt fixes this bug. Perhaps, this must be one of the most trivial bugfix. Although, I can imagine it being overlooked quite easily & causing frustrations for hours lol

Fixes #29

n0k0m3 commented 2 years ago

Thanks you saved me a day there lol. Was about to revert commit and test things out

n0k0m3 commented 2 years ago

I guess with this I'll need to make a test case to avoid problems going onward

ManorSailor commented 2 years ago

I guess with this I'll need to make a test case to avoid problems going onward

Good idea, since, I cannot figure out why adding a single hash in the file makes it work. I have exhausted my list of tests & none of them have proved fruitful.