From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Tue, 21 Mar 2006 14:57:29 +0000 (+0000)
Subject: - run createrepo as well
X-Git-Tag: bootcd-3.4-2~96
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a559eea8194206321604f2e53210b82d5b9c9089;p=bootcd.git

- run createrepo as well
- if run under sudo, allow user to delete the headers/ and repodata/
  directories
---

diff --git a/build.sh b/build.sh
index 72a5033..472cd13 100755
--- a/build.sh
+++ b/build.sh
@@ -111,6 +111,12 @@ EOF
    # system.
    if [ -n "$RPM_BUILD_DIR" ] ; then
        yum-arch $(dirname $RPM_BUILD_DIR)/RPMS
+       createrepo $(dirname $RPM_BUILD_DIR)/RPMS || :
+       # If run under sudo, allow user to delete the headers/ and
+       # repodata/ directories.
+       if [ -n "$SUDO_USER" ] ; then
+	   chown -R $SUDO_USER $(dirname $RPM_BUILD_DIR)/RPMS
+       fi
        cat >>yum.conf <<EOF
 [Bootstrap]
 name=Bootstrap RPMS -- $(dirname $RPM_BUILD_DIR)/RPMS/