mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Modify: clean use glob to match filename that need remove
This commit is contained in:
parent
44c0079dc9
commit
be18f72a69
1 changed files with 4 additions and 5 deletions
9
setup.py
9
setup.py
|
@ -8,6 +8,7 @@ from __future__ import with_statement
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import glob
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from distutils.cmd import Command
|
from distutils.cmd import Command
|
||||||
from distutils.command.build import build
|
from distutils.command.build import build
|
||||||
|
@ -117,11 +118,9 @@ class Clean(clean):
|
||||||
for subdir in ('salt', 'tests', 'doc'):
|
for subdir in ('salt', 'tests', 'doc'):
|
||||||
root = os.path.join(os.path.dirname(__file__), subdir)
|
root = os.path.join(os.path.dirname(__file__), subdir)
|
||||||
for dirname, dirnames, filenames in os.walk(root):
|
for dirname, dirnames, filenames in os.walk(root):
|
||||||
for filename in filenames:
|
for to_remove_filename in glob.glob(
|
||||||
for ext in remove_extensions:
|
'{0}/*.py[oc]'.format(dirname)):
|
||||||
if filename.endswith(ext):
|
os.remove(to_remove_filename)
|
||||||
os.remove(os.path.join(dirname, filename))
|
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
INSTALL_VERSION_TEMPLATE = '''\
|
INSTALL_VERSION_TEMPLATE = '''\
|
||||||
|
|
Loading…
Add table
Reference in a new issue