Skip to content

Commit

Permalink
tools: remove git diff exit-code and lint the code
Browse files Browse the repository at this point in the history
  • Loading branch information
fasenderos committed May 21, 2023
1 parent 1442177 commit e3e7759
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tools/dep_updaters/update-zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ DEPS_DIR="$BASE_DIR/deps"
echo "Comparing latest upstream with current revision"

# Revert zconf.h changes before checking diff
perl -i -pe 's|^//#include "chromeconf.h"|#include "chromeconf.h"|' $DEPS_DIR/zlib/zconf.h
git stash
perl -i -pe 's|^//#include "chromeconf.h"|#include "chromeconf.h"|' "$DEPS_DIR/zlib/zconf.h"
git stash -- "$DEPS_DIR/zlib/zconf.h"

git fetch https://chromium.googlesource.com/chromium/src/third_party/zlib.git HEAD

DIFF_TREE=$(
git diff stash@{0}:deps/zlib FETCH_HEAD -- zconf.h
git diff --exit-code --diff-filter=d HEAD:deps/zlib FETCH_HEAD -- ':!zconf.h' || echo 1
)
DIFF_TREE=$(git diff --diff-filter=d 'stash@{0}:deps/zlib' FETCH_HEAD)

git stash drop

Expand Down Expand Up @@ -73,7 +71,7 @@ mkdir "$DEPS_DIR/zlib/win32"

mv "$DEPS_DIR/zlib.def" "$DEPS_DIR/zlib/win32"

perl -i -pe 's|^#include "chromeconf.h"|//#include "chromeconf.h"|' $DEPS_DIR/zlib/zconf.h
perl -i -pe 's|^#include "chromeconf.h"|//#include "chromeconf.h"|' "$DEPS_DIR/zlib/zconf.h"

echo "All done!"
echo ""
Expand Down

0 comments on commit e3e7759

Please sign in to comment.