-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CEF_Parser-update.sh wrapper fixes wild diffs from Parse::Yapp hash r…
…andomization
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# CEF_Parser-update.sh - shell warpper for CEF_Parser-update.pl to update CEF_Parser.pm with minimal diffs | ||
# Copyright (c) 2023 by Ian Kluft | ||
# Open Source license: Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Run this to update the generated parser code after modifications to the CEF grammar. | ||
export PERL_HASH_SEED=0 | ||
export PERL_PERTURB_KEYS="NO" | ||
readlink=$(which readlink) | ||
dirname=$(which dirname) | ||
if [ -n "$readlink" ] && [ -n "$dirname" ] | ||
then | ||
# find location of the script because CEF_Parser-update.pl is in the same directory | ||
canonical_script="$( $readlink -f -- "$0" )" | ||
dir=$( $dirname -- "$canonical_script") | ||
else | ||
# without readlink and dirname, we're at a disadvantage to determine the location of the script | ||
# -> fall back to a requirement to run this script from the build root | ||
dir="tools" | ||
fi | ||
|
||
# find the update script | ||
update_script="$dir/CEF_Parser-update.pl" | ||
if [ ! -f "$update_script" ] | ||
then | ||
echo "update script not found at $update_script" | ||
exit 1 | ||
fi | ||
|
||
# run the update script | ||
perl "$update_script" |