Author d.amian
Recipients d.amian, eric.araujo, jsjgruber, tarek
Date 2011-11-21.16:29:53
SpamBayes Score 3.71403e-12
Marked as misclassified No
Message-id <CABJvE6JYOzLL5wtG-ipGOWFjzVxuA6+qUSV1KAWGuzEoAxXgow@mail.gmail.com>
In-reply-to <1321626627.03.0.197752380943.issue13420@psf.upfronthosting.co.za>
Content
2011/11/18 Éric Araujo <report@bugs.python.org>

>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> > I've a project, in the setup.py file, I've a function called
> update_prefix, that updates the
> > 'path_project' variable with prefix arguments from setup.py
> > If you runs setup.py with --prefix=/usr, then the file in
> 'projectname/projectnameconfig.py' is
> > modified changing the 'path_project' variable from @PREFIX@+"share/projectname"
> to
> > '/usr/share/projectname'. If you runs setup.py without prefix arguments,
> the prefix is '/usr/local'.
>
> Did you write a custom 'install' class or are you for example looking at
> sys.argv to decide whether to run your function?  If it’s not implemented
> as a distutils command, it’s not surprising that it does not integrate well.
>

Really I've a function to update prefix based on sys.argv but i changed
this using a custom class command and the same issue occurs

>
> > [...]
> > That is cause of the issue, that I explain in the early comment, I fixed
> it rounding to two decimals
> > instead of rounding to integer.
>
> Okay.  Can you make sure that this is the source of the problem, for
> example by adding time.sleep(1) between build and install?
>

I puts a time.sleep(1) bewteen 'setup.py build' and 'setup.py install' and
I got these results:

*Without waiting:

$debuild -us -uc
[...]
mkdir -p debian/python-module-stampdir
cd . && \
python setup.py build \
--build-base="/tmp/pdal/pdal2-0.3.1/./build"
running build
running build_py
copying pdal/pdalconfig.py -> build/lib.linux-i686-2.7/pdal
running build_scripts
[...]
python setup.py install \
--root="/tmp/pdal/pdal2-0.3.1/debian/pdal2/" \
--install-purelib=/usr/lib/python2.7/site-packages/ \
-f --prefix=/usr
[...]
running build
running build_py
running build_scripts
[...]

$

The stats of files are:

File: «pdal/pdalconfig.py»
Modify: 2011-11-21 13:44:52.497971724 +0100

File: «build/lib.linux-i686-2.7/pdal/pdalconfig.py»
Modify: 2011-11-21 13:44:52.000000000 +0100

It doesn't copy in the install step because st_mtimes in newer() are the
same:
ST_MTIME-source- 1321879492
ST_MTIME-target- 1321879492

*Waiting a second between build and install:

$debuild -us -uc
[...]
mkdir -p debian/python-module-stampdir
cd . && \
python setup.py build \
--build-base="/tmp/pdal/pdal2-0.3.1/./build"
running build
running build_py
copying pdal/pdalconfig.py -> build/lib.linux-i686-2.7/pdal
running build_scripts
[...]
python setup.py install \
--root="/tmp/pdal/pdal2-0.3.1/debian/pdal2/" \
--install-purelib=/usr/lib/python2.7/site-packages/ \
-f --prefix=/usr
[...]
running build
running build_py
copying pdal/pdalconfig.py -> build/lib.linux-i686-2.7/pdal
running build_scripts
[...]

$

Obviously the file has been copied as st_mtimes in newer() differ by a
second
ST_MTIME-source- 1321879603
ST_MTIME-target- 1321879602

>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue13420>
> _______________________________________
>
History
Date User Action Args
2011-11-21 16:29:55d.amiansetrecipients: + d.amian, tarek, eric.araujo, jsjgruber
2011-11-21 16:29:54d.amianlinkissue13420 messages
2011-11-21 16:29:53d.amiancreate