Skip to content

Commit

Permalink
Merge pull request #4 from conda-forge/master
Browse files Browse the repository at this point in the history
rerender
  • Loading branch information
basnijholt authored Sep 20, 2016
2 parents ae46110 + 5341892 commit 8b405d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
23 changes: 17 additions & 6 deletions .CI/create_feedstocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,28 @@ def write_token(name, token):
# Finish quietly.
pass

# Parse `git status --porcelain` to handle some merge conflicts and generate the removed recipe list.
changed_files = subprocess.check_output(['git', 'status', '--porcelain', recipe_directory_name],
universal_newlines=True)
changed_files = changed_files.splitlines()

# Add all files from AU conflicts. They are new files that we weren't tracking previously.
# Adding them resolves the conflict and doesn't actually add anything to the index.
new_file_conflicts = filter(lambda _: _.startswith("AU "), changed_files)
new_file_conflicts = map(lambda _ : _.replace("AU", "", 1).lstrip(), new_file_conflicts)
for each_new_file in new_file_conflicts:
subprocess.check_call(['git', 'add', each_new_file])

# Generate a fresh listing of recipes removed.
# This gets pretty ugly as we parse `git status --porcelain`.
#
# * Each line we get back is a change to a file in the recipe directory.
# * We narrow the list down to recipes that are staged for deletion (ignores examples).
# * Then we clean up the list so that it only has the recipe names.
removed_recipes = subprocess.check_output(['git', 'status', '--porcelain', recipe_directory_name],
universal_newlines=True)
removed_recipes = removed_recipes.splitlines()
removed_recipes = filter(lambda _: _.startswith("D "), removed_recipes)
removed_recipes = list(map(lambda _ : _.replace("D", "", 1).lstrip(), removed_recipes))
removed_recipes = filter(lambda _: _.startswith("D "), changed_files)
removed_recipes = map(lambda _ : _.replace("D", "", 1).lstrip(), removed_recipes)
removed_recipes = map(lambda _ : os.path.relpath(_, recipe_directory_name), removed_recipes)
removed_recipes = map(lambda _ : _.split(os.path.sep)[0], removed_recipes)
removed_recipes = sorted(set(removed_recipes))

# Commit any removed packages.
subprocess.check_call(['git', 'status'])
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ script:
echo "Building all recipes.";
source ./.CI/build_all;
fi

1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit 8b405d0

Please sign in to comment.