You've got a lot of code here that's essentially repeated. I would look at doing this another way, such as putting it in a function maybe and having a common error message. "Invalid PKGBUILD ID specified." or something.
- [aur-dev] [PATCH] Sanitize input of package functions in pk... Callan Barrett
- Re: [aur-dev] [PATCH] Sanitize input of package functi... Loui