Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --skip-install and --auto-install options #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions build-ffmpeg
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ usage() {
echo " --small Prioritize small size over speed and usability; don't build manpages"
echo " --full-static Build a full static FFmpeg binary (eg. glibc, pthreads etc...) **only Linux**"
echo " Note: Because of the NSS (Name Service Switch), glibc does not recommend static links."
echo " --skip-install Don't install FFmpeg, FFprobe, and FFplay binaries to your system"
echo " --auto-install Install FFmpeg, FFprobe, and FFplay binaries to your system"
echo " Note: Without --skip-install or --auto-install the script will prompt you to install."
echo ""
}

Expand Down Expand Up @@ -286,6 +289,20 @@ while (($# > 0)); do
CONFIGURE_OPTIONS+=("--enable-small" "--disable-doc")
MANPAGES=0
fi
if [[ "$1" == "--skip-install" ]]; then
SKIPINSTALL=yes
if [[ "$AUTOINSTALL" == "yes" ]]; then
echo "Error: The option --skip-install cannot be used with --auto-install"
exit 1
fi
fi
if [[ "$1" == "--auto-install" ]]; then
AUTOINSTALL=yes
if [[ "$SKIPINSTALL" == "yes" ]]; then
echo "Error: The option --auto-install cannot be used with --skip-install"
exit 1
fi
fi
shift
;;
*)
Expand Down Expand Up @@ -1111,13 +1128,16 @@ echo ""
INSTALL_NOW=0
if [[ "$AUTOINSTALL" == "yes" ]]; then
INSTALL_NOW=1
echo "Automatically installing these binaries because the --auto-install option was used or AUTOINSTALL=yes was run."
elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
read -r -p "Install these binaries to your $INSTALL_FOLDER folder? Existing binaries will be replaced. [Y/n] " response
case $response in
"" | [yY][eE][sS] | [yY])
INSTALL_NOW=1
;;
esac
else
echo "Skipping install of these binaries because the --skip-install option was used or SKIPINSTALL=yes was run."
fi

if [ "$INSTALL_NOW" = 1 ]; then
Expand Down