[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [OSSTEST PATCH 2/3] Shell fixup: Make all invocations of `.' (`source') use ./



On Thu, 2015-09-24 at 18:29 +0100, Ian Jackson wrote:
> In POSIX, `.' (the shell builtin) respects PATH, and does not search
> `.' (the current directory).
> 
> Change all the invocations which refer to files which are part of
> osstest to say `. ./foo' instead of simply `. foo'.
> 
> I have checked the results of
>   git-grep '^[ \t]*\. [^./]'
> after this patch and the remaining five hits are of no concern.
> 
> As a double-check of my hand-editing, I have also done this
>   perl -i~ -pe 's#^(\s*\. )\./#$1#' *
> and verified that the resulting tree is almost identical to that
> before this commit.  There is one difference, where the original
> code already said `. ./job'.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

I think there are good reasons for not simply adding . to $PATH at the top
of the various scripts.

> ---
>  ap-fetch-version               |    6 +++---
>  ap-fetch-version-baseline      |    2 +-
>  ap-fetch-version-baseline-late |    6 +++---
>  ap-fetch-version-old           |    6 +++---
>  ap-print-url                   |    6 +++---
>  ap-push                        |    6 +++---
>  ap-qemu-revision               |    4 ++--
>  ap-qemu-url                    |    4 ++--
>  cr-all-branch-statuses         |    2 +-
>  cr-daily-branch                |    4 ++--
>  cr-try-bisect                  |    4 ++--
>  cr-try-bisect-adhoc            |    6 +++---
>  cri-args-hostlists             |    6 +++---
>  cri-common                     |    4 ++--
>  cri-lock-repos                 |    2 +-
>  make-distros-flight            |    6 +++---
>  make-flight                    |    8 ++++----
>  mg-all-branch-statuses         |    2 +-
>  mg-cpu-microcode-update        |    4 ++--
>  mg-debian-installer-update     |    4 ++--
>  mg-debian-installer-update-all |    2 +-
>  mg-execute-flight              |    2 +-
>  mg-pxe-loader-update           |    4 ++--
>  standalone                     |    2 +-
>  standalone-reset               |    4 ++--
>  25 files changed, 53 insertions(+), 53 deletions(-)
> 
> diff --git a/ap-fetch-version b/ap-fetch-version
> index 62adf79..086aa62 100755
> --- a/ap-fetch-version
> +++ b/ap-fetch-version
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  if info_linux_tree "$branch"; then
>       repo_tree_rev_fetch_git linux \
> diff --git a/ap-fetch-version-baseline b/ap-fetch-version-baseline
> index e693e16..8889d1e 100755
> --- a/ap-fetch-version-baseline
> +++ b/ap-fetch-version-baseline
> @@ -21,7 +21,7 @@ set -e
>  
>  branch=$1
>  
> -. cri-lock-repos
> +. ./cri-lock-repos
>  
>  : ${BASE_TREE_LINUX:=git://xenbits.xen.org/people/ianc/linux-2.6.git}
>  : ${BASE_TAG_LINUX:=xen/next-2.6.32}
> diff --git a/ap-fetch-version-baseline-late b/ap-fetch-version-baseline
> -late
> index ef1a8b1..3db443d 100755
> --- a/ap-fetch-version-baseline-late
> +++ b/ap-fetch-version-baseline-late
> @@ -22,10 +22,10 @@ set -e
>  branch=$1
>  new=$2
>  
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  case "$branch" in
>  
> diff --git a/ap-fetch-version-old b/ap-fetch-version-old
> index 716fc8f..9d5487a 100755
> --- a/ap-fetch-version-old
> +++ b/ap-fetch-version-old
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  : ${BASE_TAG_LINUX2639:=tested/2.6.39.x}
>  : ${BASE_LOCALREV_LINUX:=daily-cron.$branch.old}
> diff --git a/ap-print-url b/ap-print-url
> index c161169..1b178c7 100755
> --- a/ap-print-url
> +++ b/ap-print-url
> @@ -20,10 +20,10 @@
>  set -e
>  
>  branch=$1
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
> -. ap-common
> +. ./ap-common
>  
>  if info_linux_tree "$branch"; then
>       echo $TREE_LINUX_THIS
> diff --git a/ap-push b/ap-push
> index aa0ec3d..ea21887 100755
> --- a/ap-push
> +++ b/ap-push
> @@ -21,13 +21,13 @@ set -ex
>  
>  branch=$1
>  revision=$2
> -. cri-lock-repos
> -. cri-common
> +. ./cri-lock-repos
> +. ./cri-common
>  select_xenbranch
>  
>  : ${TAG_LINUX2639:=tested/2.6.39.x}
>  
> -. ap-common
> +. ./ap-common
>  
>  TREE_LINUX=$PUSH_TREE_LINUX
>  TREE_QEMU_MAINLINE=$PUSH_TREE_QEMU_MAINLINE
> diff --git a/ap-qemu-revision b/ap-qemu-revision
> index abfa650..de105ca 100755
> --- a/ap-qemu-revision
> +++ b/ap-qemu-revision
> @@ -22,8 +22,8 @@ set -e
>  xenbranch=$1
>  xenrevision=$2
>  
> -. cri-lock-repos
> -. ap-common
> +. ./cri-lock-repos
> +. ./ap-common
>  
>  cd "$repos/xen"
>  git cat-file blob $xenrevision:Config.mk | perl -ne '
> diff --git a/ap-qemu-url b/ap-qemu-url
> index 1161a46..6ed704a 100755
> --- a/ap-qemu-url
> +++ b/ap-qemu-url
> @@ -21,7 +21,7 @@ set -e
>  
>  xenbranch=$1
>  
> -. cri-lock-repos
> -. ap-common
> +. ./cri-lock-repos
> +. ./ap-common
>  
>  echo $TREE_QEMU
> diff --git a/cr-all-branch-statuses b/cr-all-branch-statuses
> index f9885db..f4ed46e 100755
> --- a/cr-all-branch-statuses
> +++ b/cr-all-branch-statuses
> @@ -18,7 +18,7 @@
>  
>  set -ex
>  
> -. cri-args-hostlists
> +. ./cri-args-hostlists
>  branch=$1; shift
>  
>  check_stop all-branch-statuses.
> diff --git a/cr-daily-branch b/cr-daily-branch
> index dd9c30a..06f4b38 100755
> --- a/cr-daily-branch
> +++ b/cr-daily-branch
> @@ -19,8 +19,8 @@
>  
>  set -ex
>  
> -. cri-args-hostlists
> -. ap-common
> +. ./cri-args-hostlists
> +. ./ap-common
>  branch=$1; shift
>  select_branch
>  info_linux_tree $branch ||:
> diff --git a/cr-try-bisect b/cr-try-bisect
> index 8f00537..06c4940 100755
> --- a/cr-try-bisect
> +++ b/cr-try-bisect
> @@ -19,8 +19,8 @@
>  
>  set -ex
>  
> -. cri-bisect
> -. cri-args-hostlists
> +. ./cri-bisect
> +. ./cri-args-hostlists
>  
>  branch=$1; shift
>  select_branch
> diff --git a/cr-try-bisect-adhoc b/cr-try-bisect-adhoc
> index c34c74c..4ff8b8c 100755
> --- a/cr-try-bisect-adhoc
> +++ b/cr-try-bisect-adhoc
> @@ -21,7 +21,7 @@ set -ex
>  
>  export OSSTEST_BLESSING=adhoc
>  
> -. cri-common
> +. ./cri-common
>  
>  nope () { echo "nope: $*"; exit 0; }
>  
> @@ -34,8 +34,8 @@ if ! test -f job; then nope "no job"; exit 0; fi
>  #   testid=
>  #   bisect= list of args to cs-bisection-step, eg  '--fail
> -flight=<mumble>'
>  
> -. cri-bisect
> -. cri-args-hostlists
> +. ./cri-bisect
> +. ./cri-args-hostlists
>  select_branch
>  
>  export OSSTEST_BLESSING=adhoc
> diff --git a/cri-args-hostlists b/cri-args-hostlists
> index 0dd2ef3..58a2252 100644
> --- a/cri-args-hostlists
> +++ b/cri-args-hostlists
> @@ -34,13 +34,13 @@ check_stop () {
>       check_stop_core "$1"
>       if test -f ${1}xsettings; then
>               echo "loading ${1}xsettings"
> -             . ${1}xsettings
> +             . ./${1}xsettings
>       fi
>  }
>  
>  check_stop ''
>  
> -. cri-common
> +. ./cri-common
>  
>  dcs=daily-cron-settings
>  
> @@ -56,7 +56,7 @@ fi
>  
>  : ${OSSTEST_EMAIL_HEADER:=daily-cron-email-$OSSTEST_BLESSING}
>  
> -. ${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
> +. ./${OSSTEST_CRON_SETTINGS:-$dcs-$OSSTEST_BLESSING}
>  
>  : ${OSSTEST_PUSH:=false}
>  
> diff --git a/cri-common b/cri-common
> index c874ff9..6dfe8df 100644
> --- a/cri-common
> +++ b/cri-common
> @@ -17,7 +17,7 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  umask 002
>  
> @@ -101,6 +101,6 @@ select_branch () {
>       mrof="$branch.mro"
>  
>       if test -f branch-settings.$branch; then
> -             . branch-settings.$branch
> +             . ./branch-settings.$branch
>       fi
>  }
> diff --git a/cri-lock-repos b/cri-lock-repos
> index c8269f3..e75e3f5 100644
> --- a/cri-lock-repos
> +++ b/cri-lock-repos
> @@ -17,7 +17,7 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  
> -. cri-common
> +. ./cri-common
>  
>  repos=`getrepos`
>  repos_lock="$repos/lock"
> diff --git a/make-distros-flight b/make-distros-flight
> index d407fcb..697a171 100755
> --- a/make-distros-flight
> +++ b/make-distros-flight
> @@ -26,9 +26,9 @@ buildflight=$4
>  
>  flight=`./cs-flight-create $blessing $branch`
>  
> -. cri-common
> -. ap-common
> -. mfi-common
> +. ./cri-common
> +. ./ap-common
> +. ./mfi-common
>  
>  defsuite=`getconfig DebianSuite`
>  defguestsuite=`getconfig GuestDebianSuite`
> diff --git a/make-flight b/make-flight
> index 70c909d..8dc4e64 100755
> --- a/make-flight
> +++ b/make-flight
> @@ -26,10 +26,10 @@ buildflight=$4
>  
>  flight=`./cs-flight-create $blessing $branch`
>  
> -. cri-common
> -. cri-getplatforms
> -. ap-common
> -. mfi-common
> +. ./cri-common
> +. ./cri-getplatforms
> +. ./ap-common
> +. ./mfi-common
>  
>  defsuite=`getconfig DebianSuite`
>  defguestsuite=`getconfig GuestDebianSuite`
> diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
> index bba7216..74dc09a 100755
> --- a/mg-all-branch-statuses
> +++ b/mg-all-branch-statuses
> @@ -27,7 +27,7 @@
>  
>  set -e
>  
> -. cri-common
> +. ./cri-common
>  
>  mkdir -p tmp
>  
> diff --git a/mg-cpu-microcode-update b/mg-cpu-microcode-update
> index c375a43..4d51dfb 100755
> --- a/mg-cpu-microcode-update
> +++ b/mg-cpu-microcode-update
> @@ -2,8 +2,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  # iucode_tool is in /usr/sbin, see #788459.
>  export PATH="/usr/local/sbin:$PATH:/sbin:/usr/sbin"
> diff --git a/mg-debian-installer-update b/mg-debian-installer-update
> index 526cdf1..6070b8a 100755
> --- a/mg-debian-installer-update
> +++ b/mg-debian-installer-update
> @@ -21,8 +21,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  suite=$1
>  arch=$2
> diff --git a/mg-debian-installer-update-all b/mg-debian-installer-update
> -all
> index 241e2e3..1bbaef7 100755
> --- a/mg-debian-installer-update-all
> +++ b/mg-debian-installer-update-all
> @@ -20,7 +20,7 @@
>  
>  set -e
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  suite=`getconfig DebianSuite`
>  fws=`getconfig DebianNonfreeFirmware`
> diff --git a/mg-execute-flight b/mg-execute-flight
> index 7f3d969..0d8c792 100755
> --- a/mg-execute-flight
> +++ b/mg-execute-flight
> @@ -48,7 +48,7 @@ while [ $# != 0 ]; do
>       esac
>  done
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  if [ x"$flight" = x ]; then badusage; fi
>  
> diff --git a/mg-pxe-loader-update b/mg-pxe-loader-update
> index 386e449..9774350 100755
> --- a/mg-pxe-loader-update
> +++ b/mg-pxe-loader-update
> @@ -23,8 +23,8 @@
>  
>  set -e
>  
> -. cri-getconfig
> -. mgi-common
> +. ./cri-getconfig
> +. ./mgi-common
>  
>  suite=$1
>  
> diff --git a/standalone b/standalone
> index 60b6666..9383d72 100755
> --- a/standalone
> +++ b/standalone
> @@ -123,7 +123,7 @@ while true ; do
>      esac
>  done
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  WebspaceLog=`OSSTEST_CONFIG=$config getconfig WebspaceLog`
>  if [ ! -r "$WebspaceLog" ] ; then
> diff --git a/standalone-reset b/standalone-reset
> index 8555039..0a69915 100755
> --- a/standalone-reset
> +++ b/standalone-reset
> @@ -37,10 +37,10 @@ done
>  shift $((OPTIND-1))
>  
>  if [ -f standalone.config ] ; then
> -    . standalone.config
> +    . ./standalone.config
>  fi
>  
> -. cri-getconfig
> +. ./cri-getconfig
>  
>  jobdb=`getconfig JobDB`
>  if [ "$jobdb" != Standalone ]; then

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.