Closed hathach closed 5 years ago
you mean this line? https://github.com/adafruit/arduino-board-index/blob/gh-pages/bpt.py#L181
yeah I think it is that one, It will later call the write_archive https://github.com/adafruit/arduino-board-index/blob/gh-pages/bpt_model.py#L152
which will add the whole folder including the .git
.
looking at some recent package e.g boards/adafruit-samd-1.2.2.tar.bz2
The .git folder is half of the size but not useful to end user.
got it! next time we do an update let me know, and ill test/update the script then, OK?
ok, I will ping you next release :+1:
@ladyada doing release for nrf52. Seem like bpt_model did try to exclude .git
when write_archive() but somehow .git
still manage to go through.
https://github.com/adafruit/arduino-board-index/blob/gh-pages/bpt_model.py#L155
sorry i did not get to it yet! do you want to wait before relesae and i can look this weekend?
@ladyada no problem, I am debugging it. It is good chance to get more familiar with python. seem like the exclude is deprecated and we should use filter in python 3 for TarFile.add
def add(self, name, arcname=None, recursive=True, exclude=None, *, filter=None):
"""Add the file `name' to the archive. `name' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname'
specifies an alternative name for the file in the archive.
Directories are added recursively by default. This can be avoided by
setting `recursive' to False. `exclude' is a function that should
return True for each filename to be excluded. `filter' is a function
that expects a TarInfo object argument and returns the changed
TarInfo object, if it returns None the TarInfo object will be
excluded from the archive.
"""
self._check("awx")
if arcname is None:
arcname = name
# Exclude pathnames.
if exclude is not None:
import warnings
warnings.warn("use the filter argument instead",
DeprecationWarning, 2)
if exclude(name):
self._dbg(2, "tarfile: Excluded %r" % name)
return
.git folder is included in the tar.bz2 archive file. It should be removed to reduce BSP size.