diff mbox

[ndctl,v2] rpmbuild: check for rpmbuild working directories

Message ID 20171129171100.6654-1-vishal.l.verma@intel.com (mailing list archive)
State Accepted
Commit 4db2ec8d8dde
Headers show

Commit Message

Verma, Vishal L Nov. 29, 2017, 5:11 p.m. UTC
The rpmbuild and make-git-snapshot assume that the various ~/rpmbuild/*
directories are present. In case they weren't, git-archive would fail
with something like:

  /root/rpmbuild/SOURCES/ndctl-58.2.38.g8ad8f4c.tar.gz: No such file or directory

Add a check to make sure they are present, and exit out with a relevant
message.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 rpmbuild.sh | 1 +
 1 file changed, 1 insertion(+)

Comments

Dan Williams Nov. 29, 2017, 5:13 p.m. UTC | #1
On Wed, Nov 29, 2017 at 9:11 AM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> The rpmbuild and make-git-snapshot assume that the various ~/rpmbuild/*
> directories are present. In case they weren't, git-archive would fail
> with something like:
>
>   /root/rpmbuild/SOURCES/ndctl-58.2.38.g8ad8f4c.tar.gz: No such file or directory
>
> Add a check to make sure they are present, and exit out with a relevant
> message.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Looks good, applied.
diff mbox

Patch

diff --git a/rpmbuild.sh b/rpmbuild.sh
index 4535b46..fe4154b 100755
--- a/rpmbuild.sh
+++ b/rpmbuild.sh
@@ -1,5 +1,6 @@ 
 #!/bin/bash
 pushd $(dirname $0) >/dev/null
+[ ! -d ~/rpmbuild/SOURCES ] && echo "rpmdev tree not found" && exit 1
 ./make-git-snapshot.sh
 popd > /dev/null
 rpmbuild -ba $(dirname $0)/rhel/ndctl.spec