ufw

Please support './setup.py build' in addition to './setup.py install'

Bug #819600 reported by ndowens
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ufw
Fix Released
Wishlist
Unassigned

Bug Description

In file common.py it lists variables such as #CONFIG_PREFIX# and so on. If ran ufw will print unable to find #CONFIG_PREFIX#/file . So in order to correct the issue I had to create a patch which I am including .

UFW version:
0.30.1

Distribution:
Fedora 15

Output of running 'ufw status'
WARN: '#CONFIG_PREFIX#/ufw/applications.d' does not exist
ERROR: Couldn't stat '#CONFIG_PREFIX#/default/ufw'

Revision history for this message
ndowens (ndowens04) wrote :
Revision history for this message
ndowens (ndowens04) wrote :

Also I am packaging ufw for Fedora as well.

Revision history for this message
Sławomir Nizio (snizio) wrote :

See my patch in attachment. It seems to be related.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Sorry I am only just now seeing this bug. ndowens, does snizio's patch fix the issue for you?

Changed in ufw:
status: New → Incomplete
assignee: nobody → Jamie Strandboge (jdstrand)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

S. Nizio-- I'm having trouble reproducing this. Is this still a problem with 0.33? If so, can you provide exact steps on how to reproduce?

In Ubuntu, we handle multiple pythons by using:
$(PYTHON2) ./setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
$(PYTHON) ./setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb

Granted, there is some magic there with our dh_python, but I would think you could do something like this in Gentoo:
$(PYTHON2) ./setup.py install --root=build-$(PYTHON2)
$(PYTHON) ./setup.py install --root=build-$(PYTHON)

Revision history for this message
Sławomir Nizio (snizio) wrote :

I'll try to share my observations; I must admit that my knowledge about distutils is very limited.
It breaks when 'python setup.py build' is used. It can be reproduced this way:
> cd ufw-0.33/
> python setup.py build # or setup.py build -b build-xxx -> files will be in build.xxx instead of 'build'

> grep state_dir build/lib/ufw/common.py
state_dir = "#STATE_PREFIX#"

and what happens is my case is something like:
> python setup.py build -b build-xxx
> rootdir=dir_of_your_choice
> python setup.py build -b build-xxx install --root="$rootdir"
> grep '^\w*_dir' "$rootdir"/usr/lib/python2.7/site-packages/ufw/common.py
state_dir = "#STATE_PREFIX#"
share_dir = "#SHARE_DIR#"
trans_dir = share_dir
config_dir = "#CONFIG_PREFIX#"
prefix_dir = "#PREFIX#"
iptables_dir = "#IPTABLES_DIR#"

which is probably what reporter's scripts do too.

However this patch is a hack and I don't know if distutils can or cannot handle it better, but I would like to admit that there is a way I could most likely use - "separate source directories" feature. (The current approach has advantages though.)

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Yes, I was able to reproduce, but the patch breaks the documented case for installing with './setup.py install ...'. I suggest using the installation instructions that are in README for now. I'll mark this bug as Wishlist to support installing in the method you described.

summary: - Unable to find #CONFIG_PREFIX#
+ Please support './setup.py build' in addition to './setup.py install'
Changed in ufw:
assignee: Jamie Strandboge (jdstrand) → nobody
importance: Undecided → Wishlist
status: Incomplete → Triaged
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Rather, ufw-0.30.1-common.py-file.patch breaks the documented method of installation.

Changed in ufw:
status: Triaged → Fix Committed
milestone: none → 0.34
Changed in ufw:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.