mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
lib/oe: support wildcards in path.remove
Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
parent
dfd7e1f76b
commit
a5884df90d
|
@ -45,9 +45,10 @@ def format_display(path, metadata):
|
||||||
|
|
||||||
def remove(path):
|
def remove(path):
|
||||||
"""Equivalent to rm -f or rm -rf"""
|
"""Equivalent to rm -f or rm -rf"""
|
||||||
import os, errno, shutil
|
import os, errno, shutil, glob
|
||||||
|
for name in glob.glob(path):
|
||||||
try:
|
try:
|
||||||
os.unlink(path)
|
os.unlink(name)
|
||||||
except OSError, exc:
|
except OSError, exc:
|
||||||
if exc.errno == errno.EISDIR:
|
if exc.errno == errno.EISDIR:
|
||||||
shutil.rmtree(path)
|
shutil.rmtree(path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user