2013-11-23 04:46:04 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Usage: build_haiku_repository <initScript> <repositoryDir> <repoInfo>
|
|
|
|
# <packages> ...
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
|
|
|
if [ $# -le 2 ]; then
|
|
|
|
echo "$0: Missing parameters!" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
. $1
|
|
|
|
shift
|
|
|
|
|
|
|
|
repositoryDir="$1"
|
|
|
|
repoInfo="$2"
|
|
|
|
shift 2
|
|
|
|
# the remaining arguments are the packages
|
|
|
|
|
|
|
|
# this adds the build library dir to LD_LIBRARY_PATH
|
|
|
|
eval "$addBuildCompatibilityLibDir"
|
|
|
|
|
|
|
|
# create a clean repository directory
|
|
|
|
rm -rf "$repositoryDir"
|
|
|
|
mkdir "$repositoryDir"
|
|
|
|
|
|
|
|
packageDir="$repositoryDir/packages"
|
|
|
|
mkdir "$packageDir"
|
|
|
|
|
|
|
|
# Get the canonical names for the packages and copy them to the package
|
|
|
|
# directory.
|
|
|
|
for packageFile in "$@"; do
|
|
|
|
fileName=`"$package" info -f "%fileName%" "$packageFile"`
|
|
|
|
cp "$packageFile" "$packageDir/$fileName"
|
|
|
|
done
|
|
|
|
|
|
|
|
# build the repository file
|
2014-01-19 02:25:49 +04:00
|
|
|
cp "$repoInfo" "$repositoryDir/repo.info"
|
2014-11-16 17:58:03 +03:00
|
|
|
"$packageRepo" create "$repositoryDir/repo.info" "$packageDir"/*.hpkg
|
2013-11-23 04:46:04 +04:00
|
|
|
|
|
|
|
# create the checksum file
|
|
|
|
$sha256 "$repositoryDir/repo" \
|
|
|
|
| $sedExtendedRegex 's,([^[:space:]]*).*,\1,' > "$repositoryDir/repo.sha256"
|
|
|
|
# The sed part is only necessary for sha256sum, but it doesn't harm for
|
|
|
|
# sha256 either.
|