pyther / upstream_sync

script to help mirror upstream repositories
MIT License
47 stars 16 forks source link

add logic to detect and support mirroring srpms with reposync method #7

Closed scootersmk closed 8 years ago

scootersmk commented 8 years ago

Tried to mirror some source rpms, but currently they will get ignored and i'll get the following warning: WARNING:root:unable to detect architecture for graphviz-SRPMS

The following change tries to detect mirrors of source rpms, and then adds the --source options to reposync INSTEAD of the --arch option.

From reposync manpage:

--source Also download .src.rpm files.

Successfully tested locally for my use case:

$ chmod +x upstream_sync.py $ ./upstream_sync.py $ ls mirror/upstream/graphviz/ srpms $ ls mirror/upstream/graphviz/srpms/ graphviz-2.38.0-1.src.rpm graphviz-cairo-2.8-1.src.rpm gtkglarea2-1.99.0-8.fc9.src.rpm gtkglext-1.2.06.fc9.src.rpm gts-0.7.6-14.fc14.src.rpm repodata webdot-2.30-1.src.rpm $ cat confd_dir/graphviz.repo [graphviz-SRPMS] url = http://www.graphviz.org/pub/graphviz/stable/SRPMS/ path = graphviz/srpms createrepo = true $