Instantly share code, notes, and snippets.

What would you like to do?
diff --git a/PKGBUILD.old b/PKGBUILD
index 4c46ccf..69e3ce2 100644
--- a/PKGBUILD.old
@@ -15,32 +15,30 @@ source=(
- 'c2777e058734f5b70f6d9d9550cd36596e6002ecfefbe2836b495c640de133f55859339e0438ce76fcf70c3bc3221ae2204ce99608dcbe9561f9b13f237fb9c9'
- )
package() {
local cert_tag='icp_br'
cd ${srcdir}
- for cert in $(find * -name '*.crt'); do
+ find * -name '*.crt' -print0 | while IFS= read -r -d '' cert; do
#'tag' each certificate's filename, so it's easier to identify them, since
#looks like we cannot put them in a subdirectory anymore.
- local new_cert_name=${cert_tag}.${cert}
+ local new_cert_name=${cert_tag}.$(echo ${cert} | tr ' ' '_')
#avanced debugging techniques
- #echo "> processing $cert (to become $new_cert_name)"
+ echo "> processing $cert (to become $new_cert_name)"
#some certificates are distributed with a .crt extension but are actually
#in DER format instead of PEM (probably because government). If that's the
#case, we convert them to PEM so everything works properly.
if [ "$(file $cert | cut -f2 -d\: | tr -d ' ')" = "data" ]; then
local cert_der=${cert}.der
- mv ${cert} ${cert_der}
+ mv "${cert}" ${cert_der}
/usr/bin/openssl x509 -in ${cert_der} -inform der -out ${new_cert_name}
rm $cert_der
msg2 "Converted '$(basename $cert)' from DER to PEM"
- mv ${cert} ${new_cert_name}
+ mv "${cert}" ${new_cert_name}
install -d -m0755 $pkgdir/etc/ca-certificates/trust-source/anchors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment