On Mon, 2017-09-25 at 15:04 +0000, Ritesh Raj Sarraf wrote:
> Currently, setup.py relies on '/etc/apt/sources.list' to detect if it
> is an apt based system.
> In my opinion, this is fragile, especially given that
> /etc/apt/sources.list.d/ sub config dir model is also supported.
>
> I propose that a check on /usr/bin/apt or /usr/bin/apt-get be made
> instead. Both binaries are provided by the 'apt' pacakge.
The other bigger problem is that this code check happens outside of any
target. Which results in even the clean target failing. And I cannot
counter the failure with a debian patch I carry in my packaging.
Hence, can you please fix the setup.py script to not be so fragile and
cut out a new release ?
My current patch to setup.py is below. It still is very fragile given
that both distribution types have the possibility of having the
secondary package manager.
# try to auto-setup packaging_impl
if len(sys.argv) >= 2 and sys.argv[1] != 'sdist' and not
os.path.exists('apport/packaging_impl.py'):
- if os.path.exists('/etc/apt/sources.list'):
+ if os.path.exists('/usr/bin/apt-get'): print('Installing apt/dpkg packaging backend.') shutil.copy('backends/packaging-apt-dpkg.py',
'apport/packaging_impl.py')
elif os.path.exists('/usr/bin/rpm'):
On Mon, 2017-09-25 at 15:04 +0000, Ritesh Raj Sarraf wrote: sources. list' to detect if it sources. list.d/ sub config dir model is also supported.
> Currently, setup.py relies on '/etc/apt/
> is an apt based system.
> In my opinion, this is fragile, especially given that
> /etc/apt/
>
> I propose that a check on /usr/bin/apt or /usr/bin/apt-get be made
> instead. Both binaries are provided by the 'apt' pacakge.
The other bigger problem is that this code check happens outside of any
target. Which results in even the clean target failing. And I cannot
counter the failure with a debian patch I carry in my packaging.
Hence, can you please fix the setup.py script to not be so fragile and
cut out a new release ?
My current patch to setup.py is below. It still is very fragile given
that both distribution types have the possibility of having the
secondary package manager.
LP: 1719338
DBUG: 876683
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,7 @@
# try to auto-setup packaging_impl exists( 'apport/ packaging_ impl.py' ): exists( '/etc/apt/ sources. list'): exists( '/usr/bin/ apt-get' ):
print( 'Installing apt/dpkg packaging backend.')
shutil. copy('backends/ packaging- apt-dpkg. py', packaging_ impl.py' ) exists( '/usr/bin/ rpm'):
if len(sys.argv) >= 2 and sys.argv[1] != 'sdist' and not
os.path.
- if os.path.
+ if os.path.
'apport/
elif os.path.
-- www.researchut. com
Ritesh Raj Sarraf
RESEARCHUT - http://
"Necessity is the mother of invention."