Skip to content

Commit

Permalink
Allow ignore_marker to be a dangling symlink (#344)
Browse files Browse the repository at this point in the history
* Allow ignore_marker to be a dangling symlink

As per ros-infrastructure/rep#256

* os.path.lexists instead of (nonexistent) pathlib.path.lexists
  • Loading branch information
rotu committed May 4, 2020
1 parent e9e3710 commit 66893a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion colcon_core/package_identification/ignore.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright 2016-2018 Dirk Thomas
# Licensed under the Apache License, Version 2.0

import os.path
from colcon_core.package_identification import IgnoreLocationException
from colcon_core.package_identification \
import PackageIdentificationExtensionPoint
Expand All @@ -23,5 +24,5 @@ def __init__(self): # noqa: D107

def identify(self, desc): # noqa: D102
colcon_ignore = desc.path / IGNORE_MARKER
if colcon_ignore.exists():
if os.path.lexists(str(colcon_ignore)):
raise IgnoreLocationException()
3 changes: 2 additions & 1 deletion colcon_core/verb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from collections import OrderedDict
import os
import os.path
from pathlib import Path
import traceback

Expand Down Expand Up @@ -159,7 +160,7 @@ def _create_path(self, path):
if not path.exists():
path.mkdir(parents=True, exist_ok=True)
ignore_marker = path / IGNORE_MARKER
if not ignore_marker.exists():
if not os.path.lexists(str(ignore_marker)):
with ignore_marker.open('w'):
pass

Expand Down

0 comments on commit 66893a8

Please sign in to comment.