summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-10-18 18:33:36 +0200
committerRemi Collet <fedora@famillecollet.com>2013-10-18 18:33:36 +0200
commit339b9d6250d149b4515e1887fc4b0e348f6707f8 (patch)
tree6f3124eb985bcf94f494ae83b3efd31db7b9b236
parent46ea03d5f65ac23568f6c1f2910cc8b3d2f2209a (diff)
improve pearup script to extract composer.json
-rwxr-xr-xpearup15
1 files changed, 14 insertions, 1 deletions
diff --git a/pearup b/pearup
index e256351..43e0f5d 100755
--- a/pearup
+++ b/pearup
@@ -11,18 +11,31 @@ fi
if ! grep -q pecl_name *spec; then
sed -e '/^Release:/s/[0-9].*$/1%{?dist}/' \
-i *spec
+else echo "Release inchangée"
fi
+if ! grep -q "^Version:.*$2" *spec; then
sed -e "/^Version:/s/$1/$2/" \
-e "s/%changelog/%changelog\n* $rpmdate $vendor - $2-1\n- Update to $2\n/" \
-e 's/\$RPM_BUILD_ROOT/%{buildroot}/' \
-e '/Conflicts:/s/>=/< /' \
-e 's/Conflicts:/Requires: /' \
-i *spec
+else echo "Version déjà modifiée"
+fi
spectool -g -S *spec
tar xf *-$1.tgz package.xml && mv package.xml package-$1.xml
+comp=$(tar xvf *-$1.tgz '*/composer.json')
+if [ -n "$comp" ]; then
+ mv $comp composer-$1.json
+fi
tar xf *-$2.tgz package.xml && mv package.xml package-$2.xml
+comp=$(tar xvf *-$2.tgz '*/composer.json')
+if [ -n "$comp" ]; then
+ mv $comp composer-$2.json
+fi
-colordiff -u package-$1.xml package-$2.xml
+colordiff -u package-$1.xml package-$2.xml
+colordiff -u composer-$1.json composer-$2.json