[Compress] Added option to store symlinks.
This commit is contained in:
parent
651f3890d5
commit
a0075d12c7
|
|
@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
Global option: `drc_exclusions_workaround`
|
Global option: `drc_exclusions_workaround`
|
||||||
KiCad bug [11562](https://gitlab.com/kicad/code/kicad/-/issues/11562)
|
KiCad bug [11562](https://gitlab.com/kicad/code/kicad/-/issues/11562)
|
||||||
- Internal BoM: KiCad 6 text variables expansion in the fields (#247)
|
- Internal BoM: KiCad 6 text variables expansion in the fields (#247)
|
||||||
|
- Compress: Option to store symlinks. (See #265)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- OAR computation (Report) (#225)
|
- OAR computation (Report) (#225)
|
||||||
|
|
|
||||||
|
|
@ -1471,6 +1471,7 @@ Notes:
|
||||||
- **`format`**: [string='ZIP'] [ZIP,TAR,RAR] Output file format.
|
- **`format`**: [string='ZIP'] [ZIP,TAR,RAR] Output file format.
|
||||||
- **`output`**: [string='%f-%i%I%v.%x'] Name for the generated archive (%i=name of the output %x=according to format). Affected by global options.
|
- **`output`**: [string='%f-%i%I%v.%x'] Name for the generated archive (%i=name of the output %x=according to format). Affected by global options.
|
||||||
- `compression`: [string='auto'] [auto,stored,deflated,bzip2,lzma] Compression algorithm. Use auto to let KiBot select a suitable one.
|
- `compression`: [string='auto'] [auto,stored,deflated,bzip2,lzma] Compression algorithm. Use auto to let KiBot select a suitable one.
|
||||||
|
- `follow_links`: [boolean=true] Store the file pointed by symlinks, not the symlink.
|
||||||
- `move_files`: [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive.
|
- `move_files`: [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive.
|
||||||
- *remove_files*: Alias for move_files.
|
- *remove_files*: Alias for move_files.
|
||||||
- `category`: [string|list(string)=''] The category for this output. If not specified an internally defined category is used.
|
- `category`: [string|list(string)=''] The category for this output. If not specified an internally defined category is used.
|
||||||
|
|
|
||||||
|
|
@ -400,6 +400,8 @@ outputs:
|
||||||
# By default this pattern is applied to the output dir specified with `-d` command line option.
|
# By default this pattern is applied to the output dir specified with `-d` command line option.
|
||||||
# See the `from_cwd` option
|
# See the `from_cwd` option
|
||||||
source: '*'
|
source: '*'
|
||||||
|
# [boolean=true] Store the file pointed by symlinks, not the symlink
|
||||||
|
follow_links: true
|
||||||
# [string='ZIP'] [ZIP,TAR,RAR] Output file format
|
# [string='ZIP'] [ZIP,TAR,RAR] Output file format
|
||||||
format: 'ZIP'
|
format: 'ZIP'
|
||||||
# [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive
|
# [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,8 @@ class CompressOptions(BaseOptions):
|
||||||
""" Move the files to the archive. In other words: remove the files after adding them to the archive """
|
""" Move the files to the archive. In other words: remove the files after adding them to the archive """
|
||||||
self.remove_files = None
|
self.remove_files = None
|
||||||
""" {move_files} """
|
""" {move_files} """
|
||||||
|
self.follow_links = True
|
||||||
|
""" Store the file pointed by symlinks, not the symlink """
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def config(self, parent):
|
def config(self, parent):
|
||||||
|
|
@ -176,7 +178,7 @@ class CompressOptions(BaseOptions):
|
||||||
logger.debug('- Pattern {} list of files: {}'.format(source, files_list))
|
logger.debug('- Pattern {} list of files: {}'.format(source, files_list))
|
||||||
# Filter and adapt them
|
# Filter and adapt them
|
||||||
for fname in filter(re.compile(f.filter).match, files_list):
|
for fname in filter(re.compile(f.filter).match, files_list):
|
||||||
fname_real = os.path.realpath(fname)
|
fname_real = os.path.realpath(fname) if self.follow_links else os.path.abspath(fname)
|
||||||
# Avoid including the output
|
# Avoid including the output
|
||||||
if fname_real == output_real:
|
if fname_real == output_real:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue