misc/collect.py: introduce variable {base} to fix download_url
authorMoritz Warning <moritzwarning@web.de>
Thu, 17 Sep 2020 20:00:47 +0000 (22:00 +0200)
committerMoritz Warning <moritzwarning@web.de>
Wed, 23 Sep 2020 17:27:17 +0000 (19:27 +0200)
commitd6a169ef822a9aedef532eceac6a1fced32623c6
treeff01a63796c757c89fd462edd8c45f73b09a24d5
parentd6c0b040029749c4caa92dfee2bd2da78ae64c82
misc/collect.py: introduce variable {base} to fix download_url

While scanning a directory for profile.json files of different releases,
the releases might be in different sub directories. But the collect.py
script only takes one download URL template for all overview.json files.

This commit introduces a variable {base} for the download URL parameter
that will be replaced by the sub directory that distinguish the location
of different release from each other.

Example path structure:
* ../tmp/releases/18.06.8/targets
* ../tmp/snapshot/targets

collect.py call:
```
./misc/collect.py scan "https://download.openwrt.org/{base}/{target}" ../tmp/ www/
```
In www/config.json:
```
versions: {'18.06.8': 'data/18.06.8/overview.json', 'SNAPSHOT': 'data/SNAPSHOT/overview.json'},
```

In www/data/18.06.8/overview.json:
```
"download_url": "https://download.openwrt.org/releases/18.06.8/targets/{target}",
```

In www/data/SNAPSHOT/overview.json:
```
"download_url": "https://download.openwrt.org/snapshots/targets/{target}"
```
misc/collect.py