make-apt-repos.sh 702 B

12345678910111213141516
  1. #!/bin/bash
  2. # This builds a series of Debian repositories for each distribution.
  3. export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
  4. for distro in debian-* ubuntu-*; do
  5. if [ -n "`find ${distro} -name '*.deb' -type f`" ]; then
  6. arches=`ls ${distro}/*.deb | cut -d _ -f 3 | cut -d . -f 1 | xargs | sed 's/ /,/g'`
  7. distro_name=`echo $distro | cut -d '-' -f 2`
  8. echo '---' $distro / $distro_name / $arches
  9. aptly repo create -architectures=${arches} -comment="ZeroTier, Inc. Debian Packages" -component="main" -distribution=${distro_name} zt-release-${distro_name}
  10. aptly repo add zt-release-${distro_name} ${distro}/*.deb
  11. aptly publish repo zt-release-${distro_name} $distro_name
  12. fi
  13. done