mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-21 20:18:00 +01:00
remove zip dependency by replacing it with the zipfile module which is included in python
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
2d0d087cbb
commit
e5db85e6da
4 changed files with 5 additions and 12 deletions
|
@ -90,8 +90,6 @@ Dependencies
|
|||
|
||||
### Package building dependencies
|
||||
|
||||
`zip`: used to create one executable with all sources
|
||||
|
||||
`gzip`: used for compressing manuals (suppressable with `./configure --without-info-compression --without-man-compression`)
|
||||
|
||||
`texinfo`: used for building info manual (suppressable with `./configure --without-info`)
|
||||
|
|
|
@ -14,7 +14,6 @@ pv=0 # python version
|
|||
|
||||
|
||||
(hash chmod 2>/dev/null) || (br=1 ; ro=1 ; echo 'Missing chmod, install coreutils [build+runtime required]')
|
||||
(hash zip 2>/dev/null) || (br=1 ; echo 'Missing zip, install zip [build required]')
|
||||
|
||||
(hash gzip 2>/dev/null) || (bo=1 ; echo 'Missing gzip, install gzip [build optional]')
|
||||
(hash makeinfo 2>/dev/null) || (bo=1 ; echo 'Missing makeinfo, install texinfo [build optional]')
|
||||
|
|
|
@ -1667,12 +1667,6 @@ the file name) in addition to .pony-files or pony names.
|
|||
@pindex @command{python3}
|
||||
Required to run the @file{./setup.py} file, which is also invoked from the
|
||||
make script.
|
||||
@item zip
|
||||
@pindex @command{zip}
|
||||
Required to create an executable containing all Pythons files. This is done by
|
||||
creating an (uncompressed) zip-file with all source files and prepended with
|
||||
a shebang telling the operating system to run Python 3, and naming the mane
|
||||
file @file{__main__.py}.
|
||||
@item gzip
|
||||
@pindex @command{gzip}
|
||||
Used for compressing manuals. (Optional, standard)
|
||||
|
|
8
setup.py
8
setup.py
|
@ -4,6 +4,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from zipfile import ZipFile
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
|
||||
|
@ -430,9 +431,10 @@ class Setup():
|
|||
if filein is not None: filein .close()
|
||||
try:
|
||||
os.chdir('src')
|
||||
cmd = 'zip -0 ../ponysay.zip ' + ' '.join(ponysaysrc) # use not compress, prefer speed
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
print('Creating uncompressed zip file ponysay.zip with files from src: ' + ' '.join(ponysaysrc))
|
||||
with ZipFile('../ponysay.zip', 'w') as myzip:
|
||||
for src in ponysaysrc:
|
||||
myzip.write(src)
|
||||
finally:
|
||||
os.chdir('..')
|
||||
os.chmod('ponysay.zip', 0o755)
|
||||
|
|
Loading…
Reference in a new issue