[CentOS-devel] [PATCH] Better error reporting on invalid dirs

Pat Riehecky

riehecky at fnal.gov
Mon Jun 15 13:30:42 UTC 2015


---
 get_sources.sh         |    3 ++-
 into_srpm.sh           |    3 ++-
 return_disttag.sh      |    3 ++-
 show_possible_srpms.sh |    3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/get_sources.sh b/get_sources.sh
index 0a22451..77dfd4a 100755
--- a/get_sources.sh
+++ b/get_sources.sh
@@ -152,7 +152,8 @@ pn=${meta%.metadata}
 pn=${pn#.}
 
 if [ ! -d .git ] || [ ! -d SPECS ]; then
-  echo 'You need to run this from inside a sources git repo' >&2
+  thisdir=$(pwd)
+  echo "${thisdir}: You need to run this from inside a sources git repo" >&2
   exit 1
 fi
 mkdir -p SOURCES
diff --git a/into_srpm.sh b/into_srpm.sh
index 5399dc9..a47f6f4 100755
--- a/into_srpm.sh
+++ b/into_srpm.sh
@@ -107,7 +107,8 @@ while [[ 0 -eq 0 ]]; do
 done
 
 if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then
-    echo 'You need to run this from inside a sources git repo' >&2
+    thisdir=$(pwd)
+    echo "${thisdir}: You need to run this from inside a sources git repo" >&2
     exit 1
 fi
 
diff --git a/return_disttag.sh b/return_disttag.sh
index 0048cd6..c390343 100755
--- a/return_disttag.sh
+++ b/return_disttag.sh
@@ -72,7 +72,8 @@ warn () {
 }
 
 if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then
-    echo 'You need to run this from inside a sources git repo' >&2
+    thisdir=$(pwd)
+    echo "${thisdir}: You need to run this from inside a sources git repo" >&2
     exit 1
 fi
 
diff --git a/show_possible_srpms.sh b/show_possible_srpms.sh
index 83c4d08..f357d7d 100755
--- a/show_possible_srpms.sh
+++ b/show_possible_srpms.sh
@@ -93,7 +93,8 @@ while [[ 0 -eq 0 ]]; do
 done
 
 if [[ ! -d .git ]] || [[ ! -d SPECS ]]; then
-    echo 'You need to run this from inside a sources git repo' >&2
+    thisdir=$(pwd)
+    echo "${thisdir}: You need to run this from inside a sources git repo" >&2
     exit 1
 fi
 
-- 
1.7.1




More information about the CentOS-devel mailing list