# python2 updating



## asdsdf (Sep 18, 2013)

So, on a couple of systems where I have Python installed, I'm having a couple of issues. One system had python27, one had both python27 and python33. Having read /usr/ports/UPDATING I saw the change in packages and the three steps for correctly updating Python, which I followed:


```
portmaster lang/python27
portmaster lang/python2
portmaster lang/python
```

(repeated on the other box for python33/python3/python).

Now when I run a `portmaster -a`, something has pulled in python26 and I get errors that this port is DEPRECATED. I've never knowingly installed python26 myself but I believe it's been installed as a dependency of lang/python2:


```
% sudo portmaster --show-work lang/python2

===>>> Port directory: /usr/ports/lang/python2

===>>> Starting check for all dependencies
===>>> Gathering dependency list for lang/python2 from ports

===>>> Installed lang/python26
===>>> Exiting
```

I've never used python26, I don't have it set as my default Python version in /etc/make.conf, so I'm not sure where this might be coming from or how to get around it. I tried removing all python* packages and then starting again (installing python27, python2 and python in that order) but the problem returned. Any way I can check where this dependency is being pulled from and remove it?


----------



## asdsdf (Sep 18, 2013)

Warning - anecdotal evidence...

I had a look through my portmaster.rc config and realized that I had it set to use packages for build-only dependencies (for quickness, as I also have "remove build-only deps" enabled, one of the systems is a VPS so saving disk space and avoiding compilation time is a good thing). I disabled the use of packages for build-only dependencies, then removed all python* ports from my system (including deleting remaining files from /var/db/pkg, /var/db/ports, /usr/ports/packages, and /usr/ports/packages/portmaster-backup to make sure my system was as clean as I could get it). This time, going down the chain of ports (python27, python2, python) has given me the expected result and I have just 2.7.5 installed which is used as default. No sign of python26.

So the only thing I can think of is that maybe because of my use of packages for build-dependencies, I was downloading a python2 package which had a dependency on python26, rather than building it from scratch with a dependency on python27. But as I say, that's purely anecdotal based on the fact that I've removed everything Python related before and had the python26 dependency come back while build-dependency packages were enabled. I could be way off the mark, but it seems to have solved the problem on my own systems so I'm happy...


----------



## SirDice (Sep 18, 2013)

asdsdf said:
			
		

> I had a look through my portmaster.rc config and realized that I had it set to use packages for build-only dependencies (for quickness, as I also have "remove build-only deps" enabled, one of the systems is a VPS so saving disk space and avoiding compilation time is a good thing).


I build everything at home where I've set up my own repository. I've set my VPS to use that repository. That way I have complete control over the options (including dependencies) and I don't have to build anything on the VPS itself. So there are never any build dependencies lingering about. 

What is your PACKAGESITE set to? If it's not set it's likely the packages came from a -RELEASE branch. Those are never updated after the release and may explain the dependency on the 'old' python26 port.


----------



## asdsdf (Sep 18, 2013)

I've never changed my PACKAGESITE so that probably does explain it, it'll still be whatever the default is in 9.1-RELEASE(-p7). Using a home repository isn't a bad idea, but my home upload is slow (sub-1Mbit) so that'll just move any delays to the network process. I can live with building build-deps from scratch, I just happened to see the option in portmaster.rc and thought it was a good idea, but hadn't thought about the repercussions because I thought that the new python27 port would have changed its dependencies so that the "old" python2 port was no longer satisfactory. You live and learn though, everything's back to normal now!


----------



## SirDice (Sep 18, 2013)

asdsdf said:
			
		

> Using a home repository isn't a bad idea, but my home upload is slow (sub-1Mbit) so that'll just move any delays to the network process.


I've used it with a 1 Mbit/s upstream connection. It's slow but it works and if you don't have a lot of ports installed on the VPS you don't have to update often. I only update the packages on the VPS if I run into a bug or if there's a security issue. And because it was rather slow I sometimes resorted to copying the files locally first before running the update. Another alternative, which I'm currently using, is getting another (cheap) VPS and using that as your build server/repository. The VPS is capped at the virtualization layer and they don't mind if I crank up the CPU load from time to time because it doesn't interfere with any of their other clients. Some VPS providers can supply an internal network connection from one VPS to the other. Data sent over that connection doesn't get accounted on your datalimit.


----------



## asdsdf (Sep 18, 2013)

Pretty much the only stuff on the VPS is web hosting stuff, which I like to keep up to date (nginx, php5, php5-fpm, phpMyAdmin, etc) so I tend to `portsnap update` daily and update stuff whenever it comes out, I'm pretty careful about reading /usr/ports/UPDATING which is why I was a bit surprised to be caught out this time. Some interesting alternatives you've suggested though, so I might well have a look into those.


----------

