diff options
Diffstat (limited to 'pearup')
-rwxr-xr-x | pearup | 53 |
1 files changed, 37 insertions, 16 deletions
@@ -14,34 +14,55 @@ else name=$(basename $PWD).spec fi +oldver="$1" +newver="$2" +rpmver="$2" + +if [ "x$4" = "xGA" ]; then + sed -e '/global upstream_prever/s/^#global/%global/' \ + -i *spec +elif [ -n "$4" ]; then + oldver="$1$4" +fi + +if [ "x$5" = "xGA" ]; then + sed -e '/global upstream_prever/s/^%global/#global/' \ + -i *spec +elif [ -n "$5" ]; then + sed -e "/global upstream_prever/s/$4/$5/" \ + -i *spec + newver="$2$5" + rpmver="$2~$5" +fi + if ! grep -q pecl_name $name; then -sed -e '/^Release:/s/[0-9].*$/1%{?dist}/' \ - -i *spec + sed -e '/^Release:/s/[0-9].*$/1%{?dist}/' \ + -i *spec else echo "Release inchangée" fi if ! grep -q "^Version:.*$2" $name; then -sed -e "/^Version:/s/$1/$2/" \ - -e "/upstream_version/s/$1/$2/" \ - -e "s/%changelog/%changelog\n* $rpmdate $vendor - $2-1\n- update to $2\n/" \ - -e 's/\$RPM_BUILD_ROOT/%{buildroot}/' \ - -i $name + sed -e "/^Version:/s/$1/$2/" \ + -e "/upstream_version/s/$1/$2/" \ + -e "s/%changelog/%changelog\n* $rpmdate $vendor - $rpmver-1\n- update to $newver\n/" \ + -e 's/\$RPM_BUILD_ROOT/%{buildroot}/' \ + -i $name else echo "Version déjà modifiée" fi spectool -g -S $name -tar xf *-$1.tgz package.xml && mv package.xml package-$1.xml -comp=$(tar xvf *-$1.tgz '*/composer.json') +tar xf *-$oldver.tgz package.xml && mv package.xml package-$oldver.xml +comp=$(tar xvf *-$oldver.tgz '*/composer.json') if [ -n "$comp" ]; then - mv $comp composer-$1.json + mv $comp composer-$oldver.json fi -tar xf *-$2.tgz package.xml && mv package.xml package-$2.xml -comp=$(tar xvf *-$2.tgz '*/composer.json') +tar xf *-$newver.tgz package.xml && mv package.xml package-$newver.xml +comp=$(tar xvf *-$newver.tgz '*/composer.json') if [ -n "$comp" ]; then - mv $comp composer-$2.json + mv $comp composer-$newver.json fi -colordiff -u package-$1.xml package-$2.xml -[ -f composer-$1.json -a -f composer-$2.json ] && \ - colordiff -u composer-$1.json composer-$2.json +colordiff -u package-$oldver.xml package-$newver.xml +[ -f composer-$oldver.json -a -f composer-$newver.json ] && \ + colordiff -u composer-$oldver.json composer-$newver.json |