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}