#3 Fix up python2 removal commit
Merged 5 years ago by cstratak. Opened 5 years ago by cstratak.
Unknown source py2removal  into  master

@@ -1,20 +1,3 @@

- diff -up virtualenvwrapper-4.8.2/virtualenvwrapper_lazy.sh.default-binaries virtualenvwrapper-4.8.2/virtualenvwrapper_lazy.sh

- --- virtualenvwrapper-4.8.2/virtualenvwrapper_lazy.sh.default-binaries	2018-09-28 15:43:12.316145003 +0200

- +++ virtualenvwrapper-4.8.2/virtualenvwrapper_lazy.sh	2018-09-28 15:44:34.491084969 +0200

- @@ -5,11 +5,11 @@ export _VIRTUALENVWRAPPER_API="$_VIRTUAL

-  

-  if [ -z "$VIRTUALENVWRAPPER_SCRIPT" ]

-  then

- -    export VIRTUALENVWRAPPER_SCRIPT="$(command \which virtualenvwrapper.sh)"

- +    export VIRTUALENVWRAPPER_SCRIPT="$(command \which virtualenvwrapper-3.sh)"

-  fi

-  if [ -z "$VIRTUALENVWRAPPER_SCRIPT" ]

-  then

- -    echo "ERROR: virtualenvwrapper_lazy.sh: Could not find virtualenvwrapper.sh" 1>&2

- +    echo "ERROR: virtualenvwrapper_lazy-3.sh: Could not find virtualenvwrapper-3.sh" 1>&2

-  fi

-  

-  # Load the real implementation of the API from virtualenvwrapper.sh

  diff -up virtualenvwrapper-4.8.2/virtualenvwrapper.sh.default-binaries virtualenvwrapper-4.8.2/virtualenvwrapper.sh

  --- virtualenvwrapper-4.8.2/virtualenvwrapper.sh.default-binaries	2018-09-28 15:43:12.316145003 +0200

  +++ virtualenvwrapper-4.8.2/virtualenvwrapper.sh	2018-09-28 15:45:32.496042583 +0200

file modified
+19 -14
@@ -42,6 +42,15 @@

  Requires:           which

  %{?python_provide:%python_provide python3-%{modname}}

  

+ # The python2 subpackage was dropped on F30 and the

+ # unversioned shell scripts were moved to the python3

+ # subpackage.

+ # A conflicts tag was added, to mark when the change

+ # happened, which in conjunction with an entry at

+ # fedora-obsolete-packages should provide a clean

+ # upgrade path.

+ Conflicts: python2-%{modname} < 4.8.2-7

+ 

  %description -n python3-%{modname}

  %{desc}

  
@@ -50,9 +59,6 @@

  rm -rf %{modname}.egg-info

  # Fix default binaries

  %patch0 -p1 -b .default-binaries

- # Copy patched version

- cp %{modname}.sh %{modname}-3.sh

- cp %{modname}_lazy.sh %{modname}_lazy-3.sh

  

  %build

  %py3_build
@@ -60,19 +66,15 @@

  %install

  %py3_install

  

- # Install both versions of shell scripts

- install -m 0755 %{modname}-3.sh %{buildroot}/%{_bindir}/%{modname}-3.sh

- install -m 0755 %{modname}_lazy-3.sh %{buildroot}/%{_bindir}/%{modname}_lazy-3.sh

- 

  # Prepend a shebang to these so they are not stripped of executable bits

- sed -i '1i #!/bin/sh' %{buildroot}/%{_bindir}/%{modname}-3.sh

- 

- # Remove installed version

- rm %{buildroot}/%{_bindir}/%{modname}.sh

- rm %{buildroot}/%{_bindir}/%{modname}_lazy.sh

+ sed -i '1i #!/bin/sh' %{buildroot}/%{_bindir}/%{modname}.sh

  

  %{__mkdir_p} %{buildroot}/%{_sysconfdir}/profile.d/

- ln -s %{_bindir}/virtualenvwrapper_lazy-3.sh %{buildroot}/%{_sysconfdir}/profile.d/virtualenvwrapper-3.sh

+ ln -s %{_bindir}/virtualenvwrapper_lazy.sh %{buildroot}/%{_sysconfdir}/profile.d/virtualenvwrapper.sh

+ 

+ ln -s %{_bindir}/virtualenvwrapper_lazy.sh %{buildroot}/%{_bindir}/virtualenvwrapper_lazy-3.sh

+ ln -s %{_bindir}/virtualenvwrapper.sh %{buildroot}/%{_bindir}/virtualenvwrapper-3.sh

+ 

  

  #%%check

  # Tests won't fly in koji since they try to install stuff from pypi
@@ -80,11 +82,14 @@

  

  %files -n python3-%{modname}

  %doc PKG-INFO docs

+ %license LICENSE

  %{python3_sitelib}/%{modname}

  %{python3_sitelib}/%{modname}-%{version}*

+ %{_bindir}/virtualenvwrapper.sh

+ %{_bindir}/virtualenvwrapper_lazy.sh

  %{_bindir}/virtualenvwrapper-3.sh

  %{_bindir}/virtualenvwrapper_lazy-3.sh

- %config(noreplace) %{_sysconfdir}/profile.d/virtualenvwrapper-3.sh

+ %config(noreplace) %{_sysconfdir}/profile.d/virtualenvwrapper.sh

  

  %changelog

  * Thu Nov 22 2018 Charalampos Stratakis <cstratak@redhat.com> - 4.8.2-8

Due to moving the unversioned scripts to the python3 subpackage, this package now conflicts with its python2 equivalent. I added a conflicts tag for a more informative dnf output, however the python2 subpackage should be added to fedora-obsolete packages. As it stands, the upgrade path is NOT clean if the package is built.

Also I changed a bit the approach of how the scripts are handled. Basically instead of copying and moving them around I created symbolic links that point to the unversioned binaries, for backwards compatibility.

Also added the LICENSE file as it was missing from the file list.

Metadata Update from @cstratak:
- Request assigned

5 years ago

You should hardcode the version-release pair here.

rebased onto 9fc470b

5 years ago

Rebased and added a comment.

The change looks good assuming the obsoleting will be done form fedora-obsolete-packages.

I haven't tested the tool.

Metadata Update from @cstratak:
- Request assigned

5 years ago

Requesting a review from kevin.

I am not a fan of Conflicts, but I guess the only other choice is Obsoleting it with the python3 subpackage which really isn't what people might expect. ;(

Otherwise seems ok if you want to merge and build...

Pull-Request has been merged by cstratak

5 years ago

Merged and building: https://koji.fedoraproject.org/koji/taskinfo?taskID=31534983

Miro an Obsoletes entry at fedora-obsolete-packages will be required as to not break users who have installed the package.

@cstratak I'll add it in the next batch.