@@ -1929,12 +1929,6 @@ def add_target(self, filepath, custom=None, fileinfo=None):
1929
1929
Add a filepath (must be relative to the repository's targets directory)
1930
1930
to the Targets object.
1931
1931
1932
- This method does not access the file system. 'filepath' must already
1933
- exist on the file system.
1934
-
1935
- If 'filepath' does not exist the file will still be added to 'roleinfo'.
1936
- Only later calls to write() and writeall() will fail.
1937
-
1938
1932
If 'filepath' has already been added, it will be replaced with any new
1939
1933
file or 'custom' information.
1940
1934
@@ -1948,11 +1942,21 @@ def add_target(self, filepath, custom=None, fileinfo=None):
1948
1942
targets directory.
1949
1943
1950
1944
custom:
1951
- An optional object providing additional information about the file.
1945
+ An optional dictionary providing additional information about the file.
1946
+ NOTE: if a custom value is passed, the fileinfo parameter must be None.
1947
+ This parameter will be deprecated in a future release of tuf, use of
1948
+ the fileinfo parameter is preferred.
1952
1949
1953
1950
fileinfo:
1954
- An optional fileinfo object, conforming to tuf.formats.FILEINFO_SCHEMA,
1955
- providing full information about the file.
1951
+ An optional fileinfo dictionary, conforming to
1952
+ tuf.formats.FILEINFO_SCHEMA, providing full information about the
1953
+ file, i.e:
1954
+ { 'length': 101,
1955
+ 'hashes': { 'sha256': '123EDF...' },
1956
+ 'version': 2, # optional
1957
+ 'custom': { 'permissions': '600'} # optional
1958
+ }
1959
+ NOTE: if a custom value is passed, the fileinfo parameter must be None.
1956
1960
1957
1961
<Exceptions>
1958
1962
securesystemslib.exceptions.FormatError, if 'filepath' is improperly
0 commit comments