RepositoryRules: RepositoryConfig does not need/use URL now.
[haiku.git] / build / scripts / build_haiku_repository
blob00c8fdec0c5c19f2e66b5d18f732d9d6c35ba417
1 #!/bin/sh
3 # Usage: build_haiku_repository <initScript> <repositoryDir> <repoInfo>
4 # <packages> ...
6 set -o errexit
8 if [ $# -le 2 ]; then
9 echo "$0: Missing parameters!" >&2
10 exit 1
13 . $1
14 shift
16 repositoryDir="$1"
17 repoInfo="$2"
18 shift 2
19 # the remaining arguments are the packages
21 # this adds the build library dir to LD_LIBRARY_PATH
22 eval "$addBuildCompatibilityLibDir"
24 # create a clean repository directory
25 rm -rf "$repositoryDir"
26 mkdir "$repositoryDir"
28 packageDir="$repositoryDir/packages"
29 mkdir "$packageDir"
31 # Get the canonical names for the packages and copy them to the package
32 # directory.
33 for packageFile in "$@"; do
34 fileName=`"$package" info -f "%fileName%" "$packageFile"`
35 cp "$packageFile" "$packageDir/$fileName"
36 done
38 # build the repository file
39 cp "$repoInfo" "$repositoryDir/repo.info"
40 "$packageRepo" create "$repositoryDir/repo.info" "$packageDir"/*.hpkg
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.