From 86276afd3b7539b4a00ef378592e6466a5fa94bc Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 10 Jul 2013 09:05:47 +0000 Subject: [PATCH] Fixing bug 3643: remove createrepo from buildkit spec and add error check while using it. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16926 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-buildkit/bin/buildkit | 9 +++++++++ xCAT-buildkit/xCAT-buildkit.spec | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 1871410e2..afc2c2969 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -626,6 +626,15 @@ sub kit_buildrepo my $rc = 0; my $repoid = $::KIT_BUILDREPO; + + if ( !$debianflag ){ + + # Check if createrepo bin exists or not. Fail at the beginning. + if (! (-e "/usr/bin/createrepo") ) { + print "Error: /usr/bin/createrepo does not exist, install createrepo first\n"; + return 1; + } + } $repoid =~ s/\s+//g; $repoid =~ tr/A-Z/a-z/; # convert to lowercase if ( $repoid ne 'all' ) { diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 179422ce8..766465817 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -25,7 +25,7 @@ BuildArch: noarch # No dependencies on any other xCAT rpms # so that this rpm can be installed in a separate build server -Requires: /usr/bin/rpmbuild createrepo +Requires: /usr/bin/rpmbuild Provides: xCAT-buildkit = %{epoch}:%{version}