• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:without +full:- +full:perl

9 #      http://www.apache.org/licenses/LICENSE-2.0
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 # ./import_scrypt.sh import scrypt-*.tar.gz
27 set -e
28 set -x
29 trap "echo WARNING: Exiting on non-zero subprocess exit code" ERR;
38 declare -r message=$1
45 declare -r message=$1
51 echo " ./import_scrypt.sh import </path/to/scrypt-*.tar.gz>"
53 echo " ./import_scrypt.sh generate <patch/*.patch> </path/to/scrypt-*.tar.gz>"
58 if [ ! -d patches ]; then
62 if [ ! -f scrypt.version ]; then
71 SCRYPT_DIR=scrypt-$SCRYPT_VERSION
74 if [ ! -f scrypt.config ]; then
79 if [ "$CONFIGURE_ARGS" == "" -o "$UNNEEDED_SOURCES" == "" -o "$NEEDED_SOURCES" == "" ]; then
83 declare -r command=$1
86 declare -r tar=$1
90 declare -r patch=$1
92 [ -d $SCRYPT_DIR ] || usage "$SCRYPT_DIR not found, did you mean to use generate?"
93 [ -d $SCRYPT_DIR_ORIG ] || usage "$SCRYPT_DIR_ORIG not found, did you mean to use generate?"
96 declare -r patch=$1
98 declare -r tar=$1
108 # - if "$2" is not empty, output it directly
109 # - otherwise, change the file extension of $1 from .pl to .S and output
114 # $1: generator path (perl script)
125 # $1: generator (perl script)
130 perl "$1" > "$OUT"
136 # The perl scripts expect to run the target compiler as $CC to determine
139 CC=true perl "$1" o32 > "$OUT"
145 perl "$1" elf -fPIC > "$OUT"
151 perl "$1" elf "$OUT" > "$OUT"
156 # $1: space-separated list
160 declare -r pattern=$1
162 echo "$@" | tr ' ' '\n' | grep -e "$pattern" | tr '\n' ' '
165 # Sort and remove duplicates in a space-separated list
166 # $1: space-separated list
167 # Out: new space-separated list
169 echo "$@" | tr ' ' '\n' | sort -u | tr '\n' ' ' | \
170 sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
174 echo "// Auto-generated - DO NOT EDIT!"
176 echo "// ./import_scrypt.sh import /path/to/scrypt-$SCRYPT_VERSION.tar.gz"
184 # echo $(var_value FOO_$BAR) -> prints the value of ${FOO_bar}
189 # that begin with an underscore (e.g. "-n")
193 # Same as var_value, but returns sorted output without duplicates.
195 # Out: variable value (if space-separated list, sorted with no duplicates)
204 declare -r indent="$1"
206 declare -r name="$1"
209 if [ -n "$*" ]; then
218 # Print an architecture-specific section
222 declare -r arch="$1"
223 declare -r variant="$2"
225 declare -r srcs="$(var_sorted_value SCRYPT_SOURCES_${arch})"
226 declare -r exclude_srcs="$(var_sorted_value SCRYPT_SOURCES_EXCLUDES_${arch})"
228 declare -r srcs_variant="$(var_sorted_value SCRYPT_SOURCES_${arch}_${variant})"
229 declare -r exclude_srcs_variant="$(var_sorted_value SCRYPT_SOURCES_EXCLUDES_${arch}_${variant})"
231 if [ -n "${srcs}${exclude_srcs}${srcs_variant}${exclude_srcs_variant}" ]; then
237 if [ -n "${src_variant}${exclude_srcs_variant}" ]; then
252 declare -r output="$1"
259 declare -r tmpfile=$(mktemp)
260 (grep -e -D Makefile | grep -v CONFIGURE_ARGS= | grep -v OPTIONS=) > $tmpfile
262 declare -r ac_cflags=$(filter_by_egrep "^-D" $(grep -e "^CFLAG=" $tmpfile))
263 declare -r ac_depflags=$(filter_by_egrep "^-D" $(grep -e "^DEPFLAG=" $tmpfile))
264 rm -f $tmpfile
282 // http://www.apache.org/licenses/LICENSE-2.0
286 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
328 declare -r SCRYPT_SOURCE=$1
345 rm -r $i
353 declare -r patch=$1
359 declare -r patch=$1
360 declare -r SCRYPT_SOURCE=$2
368 rm -rf $SCRYPT_DIR/$i
369 cp -rf $i $SCRYPT_DIR/$i
376 # Find all files in a sub-directory that are encoded in ISO-8859
378 # Out: list of files in $1 that are encoded as ISO-8859.
380 find $1 -type f -print0 | xargs -0 file | fgrep "ISO-8859" | cut -d: -f1
383 # Convert all ISO-8859 files in a given subdirectory to UTF-8
386 declare -r iso_files=$(find_iso8859_files "$1")
388 iconv --from-code iso-8859-1 --to-code utf-8 $iso_file > $iso_file.tmp
389 rm -f $iso_file
395 declare -r SCRYPT_SOURCE=$1
396 declare -r readonly=$2
402 tar -zxf $SCRYPT_SOURCE
404 cp -rfP $SCRYPT_DIR $SCRYPT_DIR_ORIG
405 if [ ! -z $readonly ]; then
406 find $SCRYPT_DIR_ORIG -type f -print0 | xargs -0 chmod a-w
412 (cd $SCRYPT_DIR_ORIG && rm -rf $UNNEEDED_SOURCES)
413 (cd $SCRYPT_DIR && rm -r $UNNEEDED_SOURCES)
417 rm -rf $SCRYPT_DIR_ORIG
418 rm -rf $SCRYPT_DIR
422 declare -r dir=$1
423 declare -r skip_patch=$2
431 …patch -p1 --merge < ../patches/$i || die "Could not apply patches/$i. Fix source and run: $0 regen…
439 find . \( -type f -o -type l \) -name "*.orig" -print0 | xargs -0 rm -f
445 declare -r patch=$1
448 find $SCRYPT_DIR -type f -name "*.orig" -print0 | xargs -0 rm -f
449 find $SCRYPT_DIR -type f -name "*~" -print0 | xargs -0 rm -f
451 declare -r variable_name=SCRYPT_PATCHES_`basename $patch .patch | sed s/-/_/`_SOURCES
453 eval declare -r sources=\$$variable_name
454 rm -f $patch
457 …LC_ALL=C TZ=UTC0 diff -aupN $SCRYPT_DIR_ORIG/$i $SCRYPT_DIR/$i >> $patch && die "ERROR: No diff fo…