mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
BaseTools: Update BrotliCompress script to handle the different input format
After this update, BrotliCompress can support below styles. BrotliCompress -e InputFile -o OutputFile BrotliCompress -e -o OutputFile InputFile Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
parent
267345ff4f
commit
83e901a507
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# This script will exec Brotli tool.
|
# This script will exec Brotli tool with -e/-d options.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
@ -13,50 +13,37 @@
|
|||||||
#
|
#
|
||||||
QLT="-q 9"
|
QLT="-q 9"
|
||||||
INPUTFLAG=0
|
INPUTFLAG=0
|
||||||
|
ARGS=
|
||||||
|
|
||||||
for arg; do
|
while test $# -gt 0
|
||||||
if [ $1 = -d ]
|
do
|
||||||
then
|
case $1 in
|
||||||
|
-e)
|
||||||
INPUTFLAG=1
|
INPUTFLAG=1
|
||||||
fi
|
;;
|
||||||
if [ $1 = -e ]
|
-d)
|
||||||
then
|
|
||||||
INPUTFLAG=1
|
INPUTFLAG=1
|
||||||
shift
|
ARGS+="$1 "
|
||||||
continue;
|
;;
|
||||||
fi
|
-o|-g)
|
||||||
if [ $1 = -g ]
|
|
||||||
then
|
|
||||||
ARGS+="$1 $2 "
|
ARGS+="$1 $2 "
|
||||||
shift
|
shift
|
||||||
shift
|
;;
|
||||||
continue;
|
-q)
|
||||||
fi
|
|
||||||
if [ $1 = -o ]
|
|
||||||
then
|
|
||||||
ARGS+="$1 $2 "
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;
|
|
||||||
fi
|
|
||||||
if [ $1 = -q ]
|
|
||||||
then
|
|
||||||
QLT="$1 $2 "
|
QLT="$1 $2 "
|
||||||
shift
|
shift
|
||||||
shift
|
;;
|
||||||
continue;
|
*)
|
||||||
fi
|
if [ $INPUTFLAG -eq 1 ]
|
||||||
if [ $INPUTFLAG -eq 1 ]
|
|
||||||
then
|
|
||||||
if [ -z $2 ]
|
|
||||||
then
|
then
|
||||||
ARGS+="$QLT -i $1 "
|
ARGS+="-i $1 "
|
||||||
break;
|
INPUTFLAG=0
|
||||||
|
else
|
||||||
|
ARGS+="$1 "
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
ARGS+="$1 "
|
shift
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
|
||||||
exec Brotli $ARGS
|
exec Brotli $ARGS $QLT
|
||||||
|
@ -16,12 +16,16 @@
|
|||||||
|
|
||||||
set QLT=-q 9
|
set QLT=-q 9
|
||||||
set INPUTFLAG=0
|
set INPUTFLAG=0
|
||||||
|
set ARGS=
|
||||||
|
|
||||||
:Begin
|
:Begin
|
||||||
if "%1"=="" goto End
|
if "%1"=="" goto End
|
||||||
|
|
||||||
if "%1"=="-d" (
|
if "%1"=="-d" (
|
||||||
set INPUTFLAG=1
|
set INPUTFLAG=1
|
||||||
|
set ARGS=%ARGS% %1
|
||||||
|
shift
|
||||||
|
goto Begin
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%1"=="-e" (
|
if "%1"=="-e" (
|
||||||
@ -51,17 +55,15 @@ if "%1"=="-q" (
|
|||||||
goto Begin
|
goto Begin
|
||||||
)
|
)
|
||||||
|
|
||||||
if %INPUTFLAG%==1 (
|
if %INPUTFLAG% == 1 (
|
||||||
if "%2"=="" (
|
set ARGS=%ARGS% -i %1
|
||||||
set ARGS=%ARGS% %QLT% -i %1
|
set INPUTFLAG=0
|
||||||
goto End
|
) else (
|
||||||
)
|
set ARGS=%ARGS% %1
|
||||||
)
|
)
|
||||||
|
|
||||||
set ARGS=%ARGS% %1
|
|
||||||
shift
|
shift
|
||||||
goto Begin
|
goto Begin
|
||||||
|
|
||||||
:End
|
:End
|
||||||
Brotli %ARGS%
|
Brotli %ARGS% %QLT%
|
||||||
@echo on
|
@echo on
|
||||||
|
Loading…
x
Reference in New Issue
Block a user