[dpdk-dev] devtools: make log checking script BSD-compatible

Message ID 20170323150926.16818-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson March 23, 2017, 3:09 p.m. UTC
  The -e flag to readlink doesn't exist on FreeBSD so change it to -f instead
which is present on both BSD and Linux. Error reported is:

  readlink: illegal option -- e
  usage: readlink [-fn] [file ...]
  usage: dirname string [...]
  ./devtools/check-git-log.sh: /git-log-fixes.sh: not found

Fixes: 814c8822ef7b ("scripts: check cc stable mailing list in commit")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon March 27, 2017, 9:45 p.m. UTC | #1
2017-03-23 15:09, Bruce Richardson:
> The -e flag to readlink doesn't exist on FreeBSD so change it to -f instead
> which is present on both BSD and Linux. Error reported is:
> 
>   readlink: illegal option -- e
>   usage: readlink [-fn] [file ...]
>   usage: dirname string [...]
>   ./devtools/check-git-log.sh: /git-log-fixes.sh: not found
> 
> Fixes: 814c8822ef7b ("scripts: check cc stable mailing list in commit")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
[...]
> -selfdir=$(dirname $(readlink -e $0))
> +selfdir=$(dirname $(readlink -f $0))

You win the prize of the shortest fix with only one letter! :)

Applied, thanks
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index e3ac0e472..8449d4f67 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -47,7 +47,7 @@  if [ "$1" = '-h' -o "$1" = '--help' ] ; then
 	exit
 fi
 
-selfdir=$(dirname $(readlink -e $0))
+selfdir=$(dirname $(readlink -f $0))
 range=${1:-origin/master..}
 # convert -N to HEAD~N.. in order to comply with git-log-fixes.sh getopts
 if printf -- $range | grep -q '^-[0-9]\+' ; then