1#!/bin/sh 2# 3# Usage: build_haiku_repository <initScript> <repositoryDir> <repoInfo> 4# <packages> ... 5 6set -o errexit 7 8if [ $# -le 2 ]; then 9 echo "$0: Missing parameters!" >&2 10 exit 1 11fi 12 13. $1 14shift 15 16repositoryDir="$1" 17repoInfo="$2" 18shift 2 19# the remaining arguments are the packages 20 21# this adds the build library dir to LD_LIBRARY_PATH 22eval "$addBuildCompatibilityLibDir" 23 24# create a clean repository directory 25rm -rf "$repositoryDir" 26mkdir "$repositoryDir" 27 28packageDir="$repositoryDir/packages" 29mkdir "$packageDir" 30 31# Get the canonical names for the packages and copy them to the package 32# directory. 33for packageFile in "$@"; do 34 fileName=`"$package" info -f "%fileName%" "$packageFile"` 35 cp "$packageFile" "$packageDir/$fileName" 36done 37 38# build the repository file 39cp "$repoInfo" "$repositoryDir/repo.info" 40"$packageRepo" create "$repositoryDir/repo.info" "$packageDir"/*.hpkg 41 42# create the checksum file 43$sha256 "$repositoryDir/repo" \ 44 | $sedExtendedRegex 's,([^[:space:]]*).*,\1,' > "$repositoryDir/repo.sha256" 45 # The sed part is only necessary for sha256sum, but it doesn't harm for 46 # sha256 either. 47