Bug 1256730: fail configure when api keyfiles do not exist; r?glandium draft
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 02 Mar 2016 20:47:02 +0000
changeset 398102 84b0800c8f1ff5ec52079bdda1127111c5668650
parent 398101 33b8617a72339f68b7b77f10e972f94d92e57609
child 527591 c31fae698e2517120c9ddadbe9ccd5b314b9fe2a
push id25449
push userdmitchell@mozilla.com
push dateMon, 08 Aug 2016 18:40:57 +0000
reviewersglandium
bugs1256730
milestone51.0a1
Bug 1256730: fail configure when api keyfiles do not exist; r?glandium MozReview-Commit-ID: 7uWkr1IIAlM
old-configure.in
--- a/old-configure.in
+++ b/old-configure.in
@@ -2498,63 +2498,78 @@ case "${target}" in
         ;;
 
 esac
 
 # Allow to specify a Mozilla API key file that contains the secret key to be
 # used for various Mozilla API requests.
 MOZ_ARG_WITH_STRING(mozilla-api-keyfile,
 [  --with-mozilla-api-keyfile=file   Use the secret key contained in the given keyfile for Mozilla API requests],
-  MOZ_MOZILLA_API_KEY=`cat $withval`)
+ [if test ! -f $withval ; then
+    AC_MSG_ERROR([--with-mozilla-api-keyfile file $withval not found])
+  fi
+  MOZ_MOZILLA_API_KEY=`cat $withval`])
 if test -z "$MOZ_MOZILLA_API_KEY"; then
     MOZ_MOZILLA_API_KEY=no-mozilla-api-key
 fi
 AC_SUBST(MOZ_MOZILLA_API_KEY)
 
 # Allow to specify a Google API key file that contains the secret key to be
 # used for various Google API requests.
 MOZ_ARG_WITH_STRING(google-api-keyfile,
 [  --with-google-api-keyfile=file   Use the secret key contained in the given keyfile for Google API requests],
-  MOZ_GOOGLE_API_KEY=`cat $withval`)
+ [if test ! -f $withval ; then
+    AC_MSG_ERROR([--with-google-api-keyfile file $withval not found])
+  fi
+  MOZ_GOOGLE_API_KEY=`cat $withval`])
 if test -z "$MOZ_GOOGLE_API_KEY"; then
     MOZ_GOOGLE_API_KEY=no-google-api-key
 fi
 AC_SUBST(MOZ_GOOGLE_API_KEY)
 
 # Allow to specify a Google OAuth API key file that contains the client ID and
 # the secret key to be used for various Google OAuth API requests.
 MOZ_ARG_WITH_STRING(google-oauth-api-keyfile,
 [ --with-google-oauth-api-keyfile=file  Use the client id and secret key contained in the given keyfile for Google OAuth API requests],
- [MOZ_GOOGLE_OAUTH_API_CLIENTID=`cat $withval | cut -f 1 -d " "`
+ [if test ! -f $withval ; then
+    AC_MSG_ERROR([--with-google-oauth-api-keyfile file $withval not found])
+  fi
+  MOZ_GOOGLE_OAUTH_API_CLIENTID=`cat $withval | cut -f 1 -d " "`
   MOZ_GOOGLE_OAUTH_API_KEY=`cat $withval | cut -f 2 -d " "`])
 if test -z "$MOZ_GOOGLE_OAUTH_API_CLIENTID"; then
     MOZ_GOOGLE_OAUTH_API_CLIENTID=no-google-oauth-api-clientid
     MOZ_GOOGLE_OAUTH_API_KEY=no-google-oauth-api-key
 fi
 AC_SUBST(MOZ_GOOGLE_OAUTH_API_CLIENTID)
 AC_SUBST(MOZ_GOOGLE_OAUTH_API_KEY)
 
 # Allow specifying a Bing API key file that contains the client ID and the
 # secret key to be used for the Bing Translation API requests.
 MOZ_ARG_WITH_STRING(bing-api-keyfile,
 [  --with-bing-api-keyfile=file   Use the client id and secret key contained in the given keyfile for Bing API requests],
- [MOZ_BING_API_CLIENTID=`cat $withval | cut -f 1 -d " "`
+ [if test ! -f $withval ; then
+    AC_MSG_ERROR([--with-bing-api-keyfile file $withval not found])
+  fi
+  MOZ_BING_API_CLIENTID=`cat $withval | cut -f 1 -d " "`
   MOZ_BING_API_KEY=`cat $withval | cut -f 2 -d " "`])
 if test -z "$MOZ_BING_API_CLIENTID"; then
     MOZ_BING_API_CLIENTID=no-bing-api-clientid
     MOZ_BING_API_KEY=no-bing-api-key
 fi
 AC_SUBST(MOZ_BING_API_CLIENTID)
 AC_SUBST(MOZ_BING_API_KEY)
 
 # Allow specifying an Adjust SDK key file that contains the app token used for
 # Adjust SDK requests.
 MOZ_ARG_WITH_STRING(adjust-sdk-keyfile,
 [  --with-adjust-sdk-keyfile=file   Use the app token contained in the given keyfile for Adjust SDK requests],
-  MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN=`cat $withval`)
+ [if test ! -f $withval; then
+    AC_MSG_ERROR([--with-adjust-sdk-keyfile file $withval not found])
+  fi
+  MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN=`cat $withval`])
 AC_SUBST(MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN)
 
 # Optional Firefox for Android partner distribution directory.
 MOZ_ARG_WITH_STRING(android-distribution-directory,
 [  --with-android-distribution-directory=dir
                           Optional Firefox for Android partner distribution directory.],
   MOZ_ANDROID_DISTRIBUTION_DIRECTORY=$withval)