-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_server.sh
executable file
·56 lines (42 loc) · 1.25 KB
/
get_server.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
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Function to handle repository operations
get_server() {
local server=$1
local package_name=$PACKAGE_NAME
# Access the environment variables
local zst_file=$ZST_FILE
#local sig_file=$SIG_FILE
# Clone the repository
print_message1 "Cloning the $server"
git clone [email protected]:arch-linux-gui/$server.git
print_message4 $zst_file
#print_message4 $sig_file
mkdir alg-newpackages
destination="alg-newpackages/"
destination1="$server/x86_64/"
# Remove the previous .zst file(s)
old_zst_files="$destination1$package_name-*zst"
for file in $old_zst_files; do
if [ -e "$file" ]; then
rm "$file"
fi
done
#old_sig_files="$destination1$package_name-*zst.sig"
#for file in $old_sig_files; do
# if [ -e "$file" ]; then
# rm "$file"
# fi
#done
# Copy the new file to the destination
cp $pkgbuild_path/$zst_file $destination
#cp $pkgbuild_path/$sig_file $destination
# Update the repository database
#print_message1 "Updating the repository database"
#cd $server/x86_64/
#./update_repo.sh
#cd ../..
cd $pkgbuild_path
print_message2 "Cleaning up PKGBUILD"
./cleanup.sh
path_origin
}