mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-24 01:16:05 +01:00
43 lines
668 B
Bash
43 lines
668 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
souce /etc/de-p1st-repo/arch-repo.cfg || exit
|
||
|
|
||
|
|
||
|
#
|
||
|
# add new packages to database
|
||
|
#
|
||
|
function add_to_db(){
|
||
|
mapfile -t PKGS < <(cat new-pkg.txt)
|
||
|
for PKG in "${PKGS[@]}"; do
|
||
|
repo-add -n "${REMOTE_DB_NAME}.db.tar.gz" "${PKG}" || exit
|
||
|
done
|
||
|
}
|
||
|
|
||
|
|
||
|
#
|
||
|
# generate index.html
|
||
|
#
|
||
|
function generate_index(){
|
||
|
echo '<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>privacy1st.de Arch Packages</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h1>privacy1st.de Arch Packages</h1>
|
||
|
' > index.html
|
||
|
|
||
|
for PKG in ./*.pkg.tar.{xz,zst}; do
|
||
|
echo "<p><a href=\"$PKG\">$PKG</a></p>" >> index.html;
|
||
|
done
|
||
|
|
||
|
echo '
|
||
|
</body>
|
||
|
</html>' >> index.html
|
||
|
}
|
||
|
|
||
|
|
||
|
cd "${REMOTE_PKG_DIR}" || exit
|
||
|
add_to_db
|
||
|
generate_index
|