openmainframeproject / software-discovery-tool

Software Discovery Tool
Apache License 2.0
31 stars 40 forks source link

Need to correct buggy code in ./bin/package_build.py for Fedora #142

Closed Princee215 closed 1 year ago

Princee215 commented 1 year ago

While looking at Fedora in ./bin/package_build.py in our core repository, I found a bug on line 162 that can be seen here https://github.com/openmainframeproject/software-discovery-tool/blob/master/bin/package_build.py#LL162C31-L162C31

sources = [34, 35, 36, 37,38]
for i in range(len(sources)): 
    q = f'Fedora_{sources[i-1]}_List.json'             
    file_name = f'{DATA_FILE_LOCATION}/{q}'
    print(f"Saved!\nfilename: {q}")

what is happening here is, for, Fedora 34 the file is saved with name Fedora_{sources[0-1}}_List.json = Fedora_sources[-1]_List.json = Fedora_38_List.json Fedora 35 is saved as Fedora_34_List.json Fedora 36 is saved as Fedora_35_List.json ...

image

Therefore we need to update the respective files for Fedora as of now all the data files are saved with the wrong name. We need to correct this in our core code as well as in our data files.

@pleia2, @arshPratap Please take a look at this.