jschanck/ntru

File 'package_pqclean.sh' contains bad characters

Closed this issue · 4 comments

Fix below (tested):

diff --git a/package_pqclean.sh b/package_pqclean.sh
index 2aa1300..6d46a55 100755
--- a/package_pqclean.sh
+++ b/package_pqclean.sh
@@ -16,7 +16,7 @@ for PARAM in hrss701 hps2048509 hps2048677 hps4096821; do
   mkdir -p ${DIRNAME}/ntru${PARAM}/avx2
   mkdir -p ${DIRNAME}/ntru${PARAM}/clean
 
-  export NTRU_NAMESPACE=PQCLEAN_NTRU${PARAM^^}_AVX2_
+  export NTRU_NAMESPACE=PQCLEAN_NTRU${PARAM}_AVX2_
   ( cd ${WORKDIR}/avx2-${PARAM} && make -B asm )
 
   ( cd ${WORKDIR}/ref-${PARAM}/

As the #!/bin/bash at the top of the file indicates, this is a bash script. And those are a bash feature. Search for ^^ on https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html.

@jschanck I understand now what you tried to do with ^^, but unfortunately it didn't work on Mac and CentOS - just blew the script. Needless to say, I used bash on all of the platforms - fairly recent on Mac, and whatever version came with CentOS.

Perhaps what you tried to accomplish with that conversion, isn't worth breaking at least two platforms?

OK, ^^ is newer than I thought. Fixed.

Thanks!

FYI, on Mac I have bash v5.0.17 and 3.2.57 (system-provided), on CentOS - v4.4.19.