1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

fix file duplications, cleanup possible existing service generated files before create new ones

This commit is contained in:
Adrian Schröter 2011-01-06 15:03:18 +01:00
parent 186d4ae4f7
commit 7988624403

View File

@ -311,6 +311,12 @@ class Serviceinfo:
def execute(self, dir):
import tempfile
# cleanup existing generated files
for filename in os.listdir(dir):
if filename.startswith('_service:') or filename.startswith('_service_'):
os.unlink(os.path.join(dir, filename))
# recreate files
for call in self.commands:
temp_dir = tempfile.mkdtemp()
name = call.split(None, 1)[0]