[python-carbon] Use loop to rename files

Jamie Nguyen jamielinux at fedoraproject.org
Wed Oct 1 11:32:58 UTC 2014


commit f2d03543f4643ac678c00e849e3aed5eb4edbfc7
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Wed Oct 1 10:47:42 2014 +0100

    Use loop to rename files

 python-carbon.spec |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/python-carbon.spec b/python-carbon.spec
index 42dc9fb..39c29d1 100644
--- a/python-carbon.spec
+++ b/python-carbon.spec
@@ -48,15 +48,6 @@ a storage back-end.
 rm -rf %{buildroot}
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 
-# Temp mv to non .py locations
-pushd %{buildroot}/usr/bin/
-%{__mv} carbon-aggregator.py carbon-aggregator
-%{__mv} carbon-cache.py carbon-cache
-%{__mv} carbon-client.py carbon-client
-%{__mv} carbon-relay.py carbon-relay
-%{__mv} validate-storage-schemas.py validate-storage-schemas
-popd
-
 %{__mkdir_p} %{buildroot}%{_sysconfdir}/carbon
 %{__mkdir_p} %{buildroot}%{_localstatedir}/log/carbon
 %{__mkdir_p} %{buildroot}%{_localstatedir}/run/carbon
@@ -73,6 +64,11 @@ popd
 %{__install} -Dp -m0644 conf/carbon.conf.example %{buildroot}%{_sysconfdir}/carbon/carbon.conf
 %{__install} -Dp -m0644 conf/storage-schemas.conf.example %{buildroot}%{_sysconfdir}/carbon/storage-schemas.conf
 
+# remove .py suffix
+for i in %{buildroot}%{_bindir}/*.py; do
+    mv ${i} ${i%%.py}
+done
+
 
 %pre
 getent group carbon >/dev/null || groupadd -r carbon


More information about the scm-commits mailing list