52 lines
1.6 KiB
Bash
Executable File
52 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
source /opt/rust-package-builder/scripts/lib.sh
|
|
|
|
APTLY_CONF="$DATA_DIR/state/aptly.conf"
|
|
APTLY_ROOT="$DATA_DIR/aptly"
|
|
REPOSITORY="$DATA_DIR/repository"
|
|
|
|
mkdir -p "$APTLY_ROOT" "$REPOSITORY/releases"
|
|
|
|
cat > "$APTLY_CONF" <<JSON
|
|
{
|
|
"rootDir": "$APTLY_ROOT",
|
|
"architectures": ["amd64"],
|
|
"dependencyFollowSuggests": false,
|
|
"dependencyFollowRecommends": false,
|
|
"dependencyFollowAllVariants": false,
|
|
"dependencyFollowSource": false,
|
|
"gpgDisableSign": false,
|
|
"gpgDisableVerify": false,
|
|
"gpgProvider": "gpg",
|
|
"downloadSourcePackages": false,
|
|
"skipLegacyPool": true
|
|
}
|
|
JSON
|
|
|
|
export APTLY_CONF
|
|
|
|
if ! aptly -config="$APTLY_CONF" repo list -raw | grep -Fx package-builder >/dev/null; then
|
|
log "creating aptly local repository"
|
|
aptly -config="$APTLY_CONF" repo create \
|
|
-distribution="$REPO_DISTRIBUTION" \
|
|
-component="$REPO_COMPONENT" \
|
|
package-builder >/dev/null
|
|
fi
|
|
|
|
for item in apt rpm suse opnsense freebsd repo-key.gpg index.html LINUX-BUILD-INFO.txt SUSE-BUILD-INFO.txt; do
|
|
if [[ -e "$REPOSITORY/$item" && ! -L "$REPOSITORY/$item" ]]; then
|
|
fatal "$REPOSITORY/$item exists and is not a symlink; refusing to overwrite"
|
|
fi
|
|
done
|
|
|
|
ln -sfn current/apt "$REPOSITORY/apt"
|
|
ln -sfn current/rpm "$REPOSITORY/rpm"
|
|
ln -sfn current/suse "$REPOSITORY/suse"
|
|
ln -sfn current/opnsense "$REPOSITORY/opnsense"
|
|
ln -sfn current/freebsd "$REPOSITORY/freebsd"
|
|
ln -sfn current/repo-key.gpg "$REPOSITORY/repo-key.gpg"
|
|
ln -sfn current/index.html "$REPOSITORY/index.html"
|
|
ln -sfn current/LINUX-BUILD-INFO.txt "$REPOSITORY/LINUX-BUILD-INFO.txt"
|
|
ln -sfn current/SUSE-BUILD-INFO.txt "$REPOSITORY/SUSE-BUILD-INFO.txt"
|