1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 18:52:10 +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 7989c7e973
commit 26263ad784

View File

@ -311,6 +311,12 @@ class Serviceinfo:
def execute(self, dir): def execute(self, dir):
import tempfile 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: for call in self.commands:
temp_dir = tempfile.mkdtemp() temp_dir = tempfile.mkdtemp()
name = call.split(None, 1)[0] name = call.split(None, 1)[0]