Compare commits
3 commits
8016833a5b
...
f2a1d6c503
Author | SHA1 | Date | |
---|---|---|---|
f2a1d6c503 | |||
e738e4092b | |||
452391b55e |
2 changed files with 73 additions and 5 deletions
|
@ -44,10 +44,11 @@ if [[ "$#" -lt 1 ]]; then
|
||||||
echo -e " ./build ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ...";
|
echo -e " ./build ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ${CTOKEN}{action}${RS} ...";
|
||||||
echo -e "";
|
echo -e "";
|
||||||
echo -e "${CSECTION}Available actions${RS}";
|
echo -e "${CSECTION}Available actions${RS}";
|
||||||
echo -e " ${CACTION}setup${RS} - Perform initial setup";
|
echo -e " ${CACTION}setup${RS} - Perform initial setup";
|
||||||
echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository";
|
echo -e " ${CACTION}update${RS} - Scan for new packages and add them to the repository";
|
||||||
echo -e " ${CACTION}update-cron${RS} - Like ${CACTION}update${RS}, but silent unless something goes wrong";
|
echo -e " ${CACTION}update-cron${RS} - Like ${CACTION}update${RS}, but silent unless something goes wrong";
|
||||||
echo -e " ${CACTION}metafiles${RS} - Rebuild the repository metafiles only (useful if you've manually fiddled with the repo packages)";
|
echo -e " ${CACTION}metafiles${RS} - Rebuild the repository metafiles only (useful if you've manually fiddled with the repo packages)";
|
||||||
|
echo -e " ${CACTION}generate-summary${RS} - Generate a SUMMARY.txt file in the repo root";
|
||||||
echo -e "";
|
echo -e "";
|
||||||
|
|
||||||
exit 1;
|
exit 1;
|
||||||
|
@ -157,15 +158,40 @@ task_metafiles() {
|
||||||
task_begin "Signing release file";
|
task_begin "Signing release file";
|
||||||
execute gpg --yes -abs -u "${gpg_key_id}" -o Release.gpg Release
|
execute gpg --yes -abs -u "${gpg_key_id}" -o Release.gpg Release
|
||||||
task_end $?;
|
task_end $?;
|
||||||
|
|
||||||
|
tasks_run generate-summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Spits out a TSV record with 3 columns:
|
||||||
|
# 1. Package name
|
||||||
|
# 2. Package version
|
||||||
|
# 3. Package description
|
||||||
|
__analyse_package() { dpkg --info "$1" | awk '/^\s*Package:/ { gsub("\\s*Package:\\s*", ""); printf($0 "\t"); } /^\s*Version:/ { gsub("\\s*Version:\\s*", ""); printf($0 "\t"); } /^\s*Description:/ { gsub("\\s*Description:\\s*", ""); print($0); }'; };
|
||||||
|
|
||||||
|
_generate_summary() {
|
||||||
|
export -f __analyse_package;
|
||||||
|
find "${dir_sources}" -type f -name "*.deb" -print0 | \
|
||||||
|
xargs -0 -n1 -p "$(nproc)" -I{} bash -c 'do_work "{}"' | \ # Generate the TSV records in parallel
|
||||||
|
sort -k1,2V | \ # Sort on the package name, then version (note the 2V does a *version sort* on column 2)
|
||||||
|
uniq | \ # Remove duplicates (e.g. due to multiple architectures)
|
||||||
|
column -t -s "$(printf '\t')"; # Align all the columns nicely - ref https://unix.stackexchange.com/a/468048/64687
|
||||||
|
}
|
||||||
|
|
||||||
|
task_generate-summary() {
|
||||||
|
task_begin "Regenerating SUMMARY.txt";
|
||||||
|
_generate_summary >"${dir_repo}/SUMMARY.txt";
|
||||||
|
task_end "$?";
|
||||||
}
|
}
|
||||||
|
|
||||||
task_update-cron() {
|
task_update-cron() {
|
||||||
tmpfile="$(mktemp --suffix ".aptosaurus.log")";
|
tmpfile="$(mktemp --suffix ".aptosaurus.log")";
|
||||||
|
|
||||||
set +e;
|
set +e; # Allow errors - we're handling them explicitly here
|
||||||
|
# Save the output.....
|
||||||
bash ./aptosaurus.sh update | ansi_strip >"${tmpfile}";
|
bash ./aptosaurus.sh update | ansi_strip >"${tmpfile}";
|
||||||
exit_code="${?}";
|
exit_code="${?}";
|
||||||
|
|
||||||
|
# ....but only display it if something went wrong
|
||||||
if [[ "${exit_code}" -ne 0 ]]; then
|
if [[ "${exit_code}" -ne 0 ]]; then
|
||||||
cat "${tmpfile}";
|
cat "${tmpfile}";
|
||||||
fi
|
fi
|
||||||
|
|
42
header.html
Normal file
42
header.html
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--
|
||||||
|
If you're reading this, then this is the header.html file used with Nginx's
|
||||||
|
fancyindex thingy on apt.starbeamrainbowlabs.com. While you're welcome to
|
||||||
|
use this file as a guide for your own apt repository, I suggest that you
|
||||||
|
alter it to make it your own, as it contains a number specific references
|
||||||
|
to my own personal apt repository.
|
||||||
|
|
||||||
|
Note also that this file, once edited, must be symlinked into the repo
|
||||||
|
directory (once it's created by aptosaurus.sh) manually - this isn't done
|
||||||
|
automatically!
|
||||||
|
-->
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<title>sbrl apt repository</title>
|
||||||
|
<script>window.document.title = `${window.location.pathname} • sbrl apt repository`;</script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/theme.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>This is the starbeamrainbowlabs.com apt repository.</p>
|
||||||
|
|
||||||
|
<p>Add this repository to your debian-based system like this:</p>
|
||||||
|
|
||||||
|
<pre><code># Add the repository
|
||||||
|
echo "deb https://apt.starbeamrainbowlabs.com/ ./ # apt.starbeamrainbowlabs.com" | sudo tee /etc/apt/sources.list.d/sbrl.list
|
||||||
|
# Import the signing key
|
||||||
|
wget -q https://apt.starbeamrainbowlabs.com/aptosaurus.asc -O- | sudo apt-key add -
|
||||||
|
# Alternatively, import the signing key from a keyserver:
|
||||||
|
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D48D801C6A66A5D8
|
||||||
|
# Update apt's cache
|
||||||
|
sudo apt update</code></pre>
|
||||||
|
|
||||||
|
<p>Packages in this repository are automatically signed by aptosaurus, my apt repository bot. While every caution has been taken to avoid signing things we shouldn't, you should still exercise caution.</p>
|
||||||
|
|
||||||
|
<p>While packages in this repository primarily come from continuous integration / deployment, package updates are normally stashed and released every day at 2am, to ease updates for clients.</p>
|
||||||
|
|
||||||
|
<p>A human-readable summary of the packages available in this repository can be found in <a href="/SUMMARY.txt"><code>SUMMARY.txt</code></a>.</p>
|
||||||
|
|
||||||
|
<h1>Index of
|
Loading…
Reference in a new issue