configure_ports_system.ksh 833 B

12345678910111213141516171819202122232425262728
  1. #!/bin/ksh
  2. print "Fetching the Ports Tree..."
  3. cd /tmp
  4. ftp https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/{ports.tar.gz,SHA256.sig}
  5. signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz
  6. print "Fetching the Ports Tree... DONE"
  7. print "Unpacking ports..."
  8. cd /usr
  9. doas mkdir -p ports
  10. doas tar xzf /tmp/ports.tar.gz
  11. doas chgrp -R wsrc ports
  12. doas chmod -R 775 ports
  13. cvs -qd anoncvs@anoncvs.au.openbsd.org:/cvs checkout -rOPENBSD_$(uname -r | tr . _) -P ports
  14. config_ports="$(cat /etc/mk.conf 2>/dev/null | grep "WRKOBJDIR=/usr/obj/ports")"
  15. if [ "$config_ports" = "" ]; then
  16. print "INFO: Adding port config to /etc/mk.conf..."
  17. {
  18. echo "WRKOBJDIR=/usr/obj/ports"
  19. echo "DISTDIR=/usr/distfiles"
  20. echo "PACKAGE_REPOSITORY=/usr/packages"
  21. } | doas tee -a /etc/mk.conf
  22. fi
  23. doas pkg_add portslist