forked from uchks/repo.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updaterepo.sh
executable file
·88 lines (66 loc) · 2.93 KB
/
updaterepo.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
if [[ "$OSTYPE" == "linux"* ]]; then #
cd "$(dirname "$0")" || exit
rm Packages Packages.xz Packages.gz Packages.bz2 Packages.zst Release 2> /dev/null
apt-ftparchive packages ./debians > Packages
gzip -c9 Packages > Packages.gz
xz -c9 Packages > Packages.xz
zstd -c19 Packages > Packages.zst
bzip2 -c9 Packages > Packages.bz2
apt-ftparchive release -c ./assets/repo/repo.conf . > Release
echo "Repository Updated!"
elif [[ "$(uname)" == Darwin ]] && [[ "$(uname -p)" == i386 ]]; then
cd "$(dirname "$0")" || exit
echo "Checking for Homebrew, wget, xz, & zstd..."
if test ! "$(which brew)"; then
/bin/bash -c "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install.sh)"
fi
brew list --verbose wget || brew install wget
brew list --verbose xz || brew install xz
brew list --verbose zstd || brew install zstd
clear
wget -q -nc https://apt.procurs.us/apt-ftparchive
sudo chmod 751 ./apt-ftparchive
rm {Packages{,.xz,.gz,.bz2,.zst},Release{,.gpg}} 2> /dev/null
./apt-ftparchive packages ./debians > Packages
gzip -c9 Packages > Packages.gz
xz -c9 Packages > Packages.xz
zstd -c19 Packages > Packages.zst
bzip2 -c9 Packages > Packages.bz2
./apt-ftparchive release -c ./assets/repo/repo.conf . > Release
echo "Repository Updated!"
elif [[ "$(uname -r)" == *Microsoft ]]; then
cd "$(dirname "$0")" || exit
rm Packages Packages.xz Packages.gz Packages.bz2 Packages.zst Release 2> /dev/null
apt-ftparchive packages ./debians > Packages
gzip -c9 Packages > Packages.gz
xz -c9 Packages > Packages.xz
zstd -c19 Packages > Packages.zst
bzip2 -c9 Packages > Packages.bz2
apt-ftparchive release -c ./assets/repo/repo.conf . > Release
echo "Repository Updated!"
elif [[ "$(uname -r)" == *microsoft-standard ]]; then
cd "$(dirname "$0")" || exit
rm Packages Packages.xz Packages.gz Packages.bz2 Packages.zst Release 2> /dev/null
apt-ftparchive packages ./debians > Packages
gzip -c9 Packages > Packages.gz
xz -c9 Packages > Packages.xz
zstd -c19 Packages > Packages.zst
bzip2 -c9 Packages > Packages.bz2
apt-ftparchive release -c ./assets/repo/repo.conf . > Release
echo "Repository Updated!"
elif [[ "$(uname)" == Darwin ]] && [[ "$(uname -p)" != i386 ]]; then
cd "$(dirname "$0")" || exit
echo "Checking for apt-ftparchive..."
if test ! "$(apt-ftparchive)"; then
apt update && apt install apt-utils -y
fi
rm {Packages{,.xz,.gz,.bz2,.zst},Release{,.gpg}} 2> /dev/null
apt-ftparchive packages ./debians > Packages
gzip -c9 Packages > Packages.gz
xz -c9 Packages > Packages.xz
zstd -c19 Packages > Packages.zst
bzip2 -c9 Packages > Packages.bz2
apt-ftparchive release -c ./assets/repo/repo.conf . > Release
echo "Repository Updated!"
fi