-
Notifications
You must be signed in to change notification settings - Fork 8
/
update_repository.sh
executable file
·45 lines (39 loc) · 1.47 KB
/
update_repository.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
# Fail if anything goes wrong.
set -e
# Print each line before executing.
set -x
# Get list of all packages with dependencies to install.
packages_with_aur_dependencies="$(aur depends --pkgname $INPUT_PACKAGES $INPUT_MISSING_AUR_DEPENDENCIES)"
echo "AUR Packages requested to install: $INPUT_PACKAGES"
echo "AUR Packages to fix missing dependencies: $INPUT_MISSING_AUR_DEPENDENCIES"
echo "AUR Packages to install (including dependencies): $packages_with_aur_dependencies"
# Sync repositories.
pacman -Sy
# Check for optional missing pacman dependencies to install.
if [ -n "$INPUT_MISSING_PACMAN_DEPENDENCIES" ]
then
echo "Additional Pacman packages to install: $INPUT_MISSING_PACMAN_DEPENDENCIES"
pacman --noconfirm -S $INPUT_MISSING_PACMAN_DEPENDENCIES
fi
# Add the packages to the local repository.
sudo --user builder \
aur sync \
--noconfirm --noview \
--database aurci2 --root /local_repository \
$packages_with_aur_dependencies
# Move the local repository to the workspace.
if [ -n "$GITHUB_WORKSPACE" ]
then
rm -f /local_repository/*.old
echo "Moving repository to github workspace"
mv /local_repository/* $GITHUB_WORKSPACE/
# make sure that the .db/.files files are in place
# Note: Symlinks fail to upload, so copy those files
cd $GITHUB_WORKSPACE
rm aurci2.db aurci2.files
cp aurci2.db.tar.gz aurci2.db
cp aurci2.files.tar.gz aurci2.files
else
echo "No github workspace known (GITHUB_WORKSPACE is unset)."
fi