#!/usr/bin/env python3 # Copyright (c) 2015 Nuxi, https://nuxi.nl/ # # SPDX-License-Identifier: BSD-2-Clause import logging import os import sys from src import util from src.repository import Repository # Setup logging logging.basicConfig(level=logging.INFO) # Locations relative to the source tree. DIR_ROOT = os.getcwd() DIR_DISTFILES = os.path.join(DIR_ROOT, '_obj/distfiles') DIR_TMP = os.path.join(DIR_ROOT, '_obj/fixup_patches') # Parse all of the BUILD rules. repo = Repository(None) # type: ignore for arg in sys.argv[1:]: for filename in util.walk_files(arg): if os.path.basename(filename) == 'BUILD': repo.add_build_file(filename, DIR_DISTFILES) # Regenerate all the patches. for distfile in repo.get_distfiles(): distfile.fixup_patches(DIR_TMP)
DIR_DEBIAN_CATALOG = '/usr/local/www/nuxi.nl/public/distfiles/cloudabi-ports/debian' DIR_FREEBSD_CATALOG = '/usr/local/www/nuxi.nl/public/distfiles/cloudabi-ports/freebsd' DIR_NETBSD_CATALOG = '/usr/local/www/nuxi.nl/public/distfiles/cloudabi-ports/netbsd' DIR_OPENBSD_CATALOG = '/usr/local/www/nuxi.nl/public/distfiles/cloudabi-ports/openbsd' # Location of the catalog signing keys. DEBIAN_PRIVATE_KEY = '31344B15' FREEBSD_PRIVATE_KEY = '/home/edje/.cloudabi-ports-freebsd.key' # Zap the old temporary directory. util.remove_and_make_dir(DIR_TMP) # Parse all of the BUILD rules. repo = Repository(os.path.join(DIR_TMP, 'install')) # repo = Repository(os.path.join(os.getcwd(), '_obj/install')) for filename in util.walk_files(os.path.join(os.getcwd(), 'packages')): if os.path.basename(filename) == 'BUILD': repo.add_build_file(filename, DIR_DISTFILES) target_packages = repo.get_target_packages() # The catalogs that we want to create. debian_path = os.path.join(DIR_TMP, 'debian') debian_catalog = DebianCatalog(DIR_DEBIAN_CATALOG, debian_path) freebsd_path = os.path.join(DIR_TMP, 'freebsd') freebsd_catalog = FreeBSDCatalog(DIR_FREEBSD_CATALOG, freebsd_path) netbsd_path = os.path.join(DIR_TMP, 'netbsd') netbsd_catalog = NetBSDCatalog(DIR_NETBSD_CATALOG, netbsd_path) openbsd_path = os.path.join(DIR_TMP, 'openbsd') openbsd_catalog = OpenBSDCatalog(DIR_OPENBSD_CATALOG, openbsd_path) # Build all packages.
DIR_ROOT = os.getcwd() DIR_DISTFILES = os.path.join(DIR_ROOT, '_obj/distfiles') DIR_INSTALL = os.path.join(DIR_ROOT, '_obj/install') DIR_PACKAGES_ARCHLINUX = os.path.join(DIR_ROOT, '_obj/packages/archlinux') DIR_PACKAGES_CYGWIN = os.path.join(DIR_ROOT, '_obj/packages/cygwin') DIR_PACKAGES_DEBIAN = os.path.join(DIR_ROOT, '_obj/packages/debian') DIR_PACKAGES_FREEBSD = os.path.join(DIR_ROOT, '_obj/packages/freebsd') DIR_PACKAGES_HOMEBREW = os.path.join(DIR_ROOT, '_obj/packages/homebrew') DIR_PACKAGES_NETBSD = os.path.join(DIR_ROOT, '_obj/packages/netbsd') DIR_PACKAGES_OPENBSD = os.path.join(DIR_ROOT, '_obj/packages/openbsd') DIR_PACKAGES_REDHAT = os.path.join(DIR_ROOT, '_obj/packages/redhat') DIR_REPOSITORY = os.path.join(DIR_ROOT, 'packages') # Parse all of the BUILD rules. repo = Repository(DIR_INSTALL) for filename in util.walk_files(DIR_REPOSITORY): if os.path.basename(filename) == 'BUILD': repo.add_build_file(filename, DIR_DISTFILES) target_packages = repo.get_target_packages() catalogs = { ArchLinuxCatalog(None, DIR_PACKAGES_ARCHLINUX), CygwinCatalog(None, DIR_PACKAGES_CYGWIN), DebianCatalog(None, DIR_PACKAGES_DEBIAN), FreeBSDCatalog(None, DIR_PACKAGES_FREEBSD), HomebrewCatalog(None, DIR_PACKAGES_HOMEBREW, 'http://example.com/'), NetBSDCatalog(None, DIR_PACKAGES_NETBSD), OpenBSDCatalog(None, DIR_PACKAGES_OPENBSD), RedHatCatalog(None, DIR_PACKAGES_REDHAT), }
#!/usr/bin/env python3 # Copyright (c) 2015 Nuxi, https://nuxi.nl/ # # This file is distributed under a 2-clause BSD license. # See the LICENSE file for details. import logging import os import sys from src import util from src.repository import Repository # Setup logging logging.basicConfig(level=logging.INFO) # Locations relative to the source tree. DIR_ROOT = os.getcwd() DIR_DISTFILES = os.path.join(DIR_ROOT, "_obj/distfiles") DIR_TMP = os.path.join(DIR_ROOT, "_obj/fixup_patches") # Parse all of the BUILD rules. repo = Repository(None) for filename in util.walk_files(sys.argv[1]): if os.path.basename(filename) == "BUILD": repo.add_build_file(filename, DIR_DISTFILES) # Regenerate all the patches. for distfile in repo.get_distfiles(): distfile.fixup_patches(DIR_TMP)
import stat import subprocess import sys from src import config from src import util from src.repository import Repository # Locations relative to the source tree. DIR_ROOT = os.getcwd() DIR_DISTFILES = os.path.join(DIR_ROOT, '_obj/distfiles') DIR_INSTALL = os.path.join(DIR_ROOT, '_obj/install') DIR_REPOSITORY = os.path.join(DIR_ROOT, 'packages') # Parse all of the BUILD rules. repo = Repository(DIR_INSTALL) for dirname, filename in util.walk_files(DIR_REPOSITORY): if filename == 'BUILD': repo.add_build_file(os.path.join(dirname, 'BUILD'), DIR_DISTFILES) target_packages = repo.get_target_packages() if len(sys.argv) > 1: # Only build the packages provided on the command line. for name in set(sys.argv[1:]): for arch in config.ARCHITECTURES: target_packages[(name, arch)].build() else: # Build all packages. for name, arch in target_packages: target_packages[(name, arch)].build()
#!/usr/bin/env python3 # Copyright (c) 2015 Nuxi, https://nuxi.nl/ # # This file is distributed under a 2-clause BSD license. # See the LICENSE file for details. import logging import os import sys from src import util from src.repository import Repository # Setup logging logging.basicConfig(level=logging.INFO) # Locations relative to the source tree. DIR_ROOT = os.getcwd() DIR_DISTFILES = os.path.join(DIR_ROOT, '_obj/distfiles') DIR_TMP = os.path.join(DIR_ROOT, '_obj/fixup_patches') # Parse all of the BUILD rules. repo = Repository(None) for filename in util.walk_files(sys.argv[1]): if os.path.basename(filename) == 'BUILD': repo.add_build_file(filename, DIR_DISTFILES) # Regenerate all the patches. for distfile in repo.get_distfiles(): distfile.fixup_patches(DIR_TMP)
ARCHLINUX_PRIVATE_KEY = '31344B15' CYGWIN_PRIVATE_KEY = 'A4836F43' DEBIAN_PRIVATE_KEY = '31344B15' FREEBSD_PRIVATE_KEY = '/home/ed/.cloudabi-ports-freebsd.key' REDHAT_PRIVATE_KEY = '31344B15' # The Homebrew repository needs to know its own URL. HOMEBREW_URL = 'https://nuxi.nl/distfiles/cloudabi-ports/homebrew/' # Zap the old temporary directory. util.remove_and_make_dir(DIR_TMP) # Parse all of the BUILD rules. repo = Repository(os.path.join(DIR_TMP, 'install')) # repo = Repository(os.path.join(os.getcwd(), '_obj/install')) for filename in util.walk_files(os.path.join(os.getcwd(), 'packages')): if os.path.basename(filename) == 'BUILD': repo.add_build_file(filename, DIR_DISTFILES) target_packages = repo.get_target_packages() # The catalogs that we want to create. archlinux_path = os.path.join(DIR_TMP, 'archlinux') archlinux_catalog = ArchLinuxCatalog(DIR_ARCHLINUX_CATALOG, archlinux_path) cygwin_path = os.path.join(DIR_TMP, 'cygwin') cygwin_catalog = CygwinCatalog(DIR_CYGWIN_CATALOG, cygwin_path) debian_path = os.path.join(DIR_TMP, 'debian') debian_catalog = DebianCatalog(DIR_DEBIAN_CATALOG, debian_path) freebsd_path = os.path.join(DIR_TMP, 'freebsd') freebsd_catalog = FreeBSDCatalog(DIR_FREEBSD_CATALOG, freebsd_path) homebrew_path = os.path.join(DIR_TMP, 'homebrew') homebrew_catalog = HomebrewCatalog(DIR_HOMEBREW_CATALOG, homebrew_path,