]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
Fix the source manifest generation by using a simple shell script to scan the SRPMS...
authorDavid Scott <dave.scott@eu.citrix.com>
Mon, 12 Jul 2010 07:33:28 +0000 (08:33 +0100)
committerDavid Scott <dave.scott@eu.citrix.com>
Mon, 12 Jul 2010 07:33:28 +0000 (08:33 +0100)
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
mk/Makefile
mk/srpms-to-manifest [new file with mode: 0644]

index 5c0129fb657540554c6204fff0dad3ef92f4f0e3..e0b9806f5e6a51ce32dda6b384cb7911bd97b5a9 100644 (file)
@@ -26,10 +26,7 @@ srpm:
 
 $(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP)
        rm -f $@
-       @for srpm in "$(/bin/ls -1 ${MY_OUTPUT_DIR}/SRPMS)"; do \
-               path=$(MY_OUTPUT_DIR)/SRPMS/${srpm}; \
-               echo "$(${RPM} --qf "%{name}" -qp ${path}) $(${RPM} --qf "%{License}" -qp ${path}) ${path}" >>$@; \
-       done
+       /bin/sh ./srpms-to-manifest api-libs $(MY_OUTPUT_DIR)/SRPMS > $@
 
 .PHONY: clean
        rm -f *.rpm
diff --git a/mk/srpms-to-manifest b/mk/srpms-to-manifest
new file mode 100644 (file)
index 0000000..92f187e
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# take a component and a directory as arguments, write to stdout a 
+# MANIFEST file fragment
+if [ -z "${RPM}" ]; then
+  RPM=/bin/rpm
+fi
+
+component=$1
+dir=$2
+for path in $(/bin/ls -1 $2/*.src.rpm); do
+  name=$(${RPM} --qf "%{name}" -qp ${path})
+  license=$(${RPM} --qf "%{License}" -qp ${path})
+  license=$(echo ${license} | /bin/sed -e 's/\s/_/g')
+  echo "${component} ${license} file ${path}"
+done