You've already forked Repository
Initialize Git Repository: 'Repository'
All checks were successful
Repository (Bookworm) / Repository [arm64] (push) Successful in 11s
Repository (Bookworm) / Repository [amd64] (push) Successful in 10s
Repository (Noble) / Repository [arm64] (push) Successful in 10s
Repository (Noble) / Repository [amd64] (push) Successful in 11s
Repository (Trixie) / Repository [arm64] (push) Successful in 24s
Repository (Trixie) / Repository [amd64] (push) Successful in 19s
All checks were successful
Repository (Bookworm) / Repository [arm64] (push) Successful in 11s
Repository (Bookworm) / Repository [amd64] (push) Successful in 10s
Repository (Noble) / Repository [arm64] (push) Successful in 10s
Repository (Noble) / Repository [amd64] (push) Successful in 11s
Repository (Trixie) / Repository [arm64] (push) Successful in 24s
Repository (Trixie) / Repository [amd64] (push) Successful in 19s
This commit is contained in:
2
root/DEBIAN/conffiles
Normal file
2
root/DEBIAN/conffiles
Normal file
@@ -0,0 +1,2 @@
|
||||
/etc/reprepro/distributions
|
||||
/etc/reprepro/options
|
||||
10
root/DEBIAN/control
Normal file
10
root/DEBIAN/control
Normal file
@@ -0,0 +1,10 @@
|
||||
Package: repository
|
||||
Version: 1.0.0
|
||||
Architecture:
|
||||
Installed-Size:
|
||||
Depends: reprepro, gpg
|
||||
Priority: optional
|
||||
Section: misc
|
||||
Homepage: http://www.privlab.it
|
||||
Maintainer: PrivLab <repository@privlab.it>
|
||||
Description: Management Tool for Debian package repository producer
|
||||
55
root/DEBIAN/postinst
Normal file
55
root/DEBIAN/postinst
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -d '/run/systemd/system' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
|
||||
case "${1}" in
|
||||
configure)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper unmask 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper unmask 'reprepro.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
if /usr/bin/deb-systemd-helper --quiet was-enabled 'reprepro.path'; then
|
||||
/usr/bin/deb-systemd-helper enable 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
else
|
||||
/usr/bin/deb-systemd-helper update-state 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
/usr/bin/install --directory '/var/lib/reprepro'
|
||||
/usr/bin/install --directory --mode='700' '/var/lib/reprepro/gnupg'
|
||||
/usr/bin/install --directory '/var/lib/reprepro/include'
|
||||
/usr/bin/install --directory '/var/log/reprepro'
|
||||
/usr/bin/install --directory '/var/logrotate/reprepro'
|
||||
if [ ! -f '/var/lib/reprepro/gnupg/pubring.kbx' ] || \
|
||||
[ ! -f '/var/lib/reprepro/gnupg/trustdb.gpg' ]; then
|
||||
/usr/bin/gpg --batch --gen-key --homedir '/var/lib/reprepro/gnupg' --quiet <<EOF
|
||||
Key-Type: RSA
|
||||
Key-Length: 4096
|
||||
Subkey-Type: RSA
|
||||
Subkey-Length: 4096
|
||||
Name-Real: Repository
|
||||
Expire-Date: 0
|
||||
%no-protection
|
||||
EOF
|
||||
fi
|
||||
if [ -x '/usr/bin/deb-systemd-invoke' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
if [ -n "${2}" ]; then
|
||||
_dh_action='restart'
|
||||
else
|
||||
_dh_action='start'
|
||||
fi
|
||||
/usr/bin/deb-systemd-invoke "${_dh_action}" 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
39
root/DEBIAN/postrm
Normal file
39
root/DEBIAN/postrm
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -d '/run/systemd/system' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
|
||||
case "${1}" in
|
||||
remove)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper mask 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper mask 'reprepro.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
/usr/bin/rm --force --recursive '/var/lib/reprepro/include'
|
||||
/usr/bin/rm --force --recursive '/var/lib/reprepro/list'
|
||||
/usr/bin/rm --force --recursive '/var/lib/reprepro/morgue'
|
||||
;;
|
||||
purge)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper purge 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper purge 'reprepro.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper unmask 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper unmask 'reprepro.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
/usr/bin/rm --force --recursive '/var/lib/reprepro'
|
||||
;;
|
||||
esac
|
||||
|
||||
/usr/bin/rm --force --recursive '/var/log/reprepro'
|
||||
/usr/bin/rm --force --recursive '/var/logrotate/reprepro'
|
||||
17
root/DEBIAN/prerm
Normal file
17
root/DEBIAN/prerm
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
case "${1}" in
|
||||
remove)
|
||||
if [ -x '/usr/bin/deb-systemd-invoke' ]; then
|
||||
/usr/bin/deb-systemd-invoke stop 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-invoke stop 'reprepro.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-invoke disable 'reprepro.path' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
78
root/etc/logrotate.d/reprepro
Normal file
78
root/etc/logrotate.d/reprepro
Normal file
@@ -0,0 +1,78 @@
|
||||
/var/log/reprepro/*.log {
|
||||
# Truncate the original log file in place after creating a copy,
|
||||
# instead of moving the old log file and optionally creating a
|
||||
# new one. It can be used when some program cannot be told to
|
||||
# close its logfile and thus might continue writing (appending)
|
||||
# to the previous log file forever. Note that there is a very
|
||||
# small time slice between copying the file and truncating it, so
|
||||
# some logging data might be lost. When this option is used, the
|
||||
# create option will have no effect, as the old log file stays in
|
||||
# place.
|
||||
copytruncate
|
||||
|
||||
# Archive old versions of log files adding a daily extension like
|
||||
# YYYYMMDD instead of simply adding a number. The extension may
|
||||
# be configured using the dateformat option.
|
||||
dateext
|
||||
|
||||
# Specify the extension for dateext using the notation similar to
|
||||
# strftime(3) function. Only %Y %m %d and %s specifiers are allowed.
|
||||
# The default value is -%Y%m%d. Note that also the character
|
||||
# separating log name from the extension is part of the dateformat
|
||||
# string. The system clock must be set past Sep 9th 2001 for %s to
|
||||
# work correctly. Note that the datestamps generated by this format
|
||||
# must be lexically sortable (i.e., first the year, then the month
|
||||
# then the day. e.g., 2001/12/01 is ok, but 01/12/2001 is not, since
|
||||
# 01/11/2002 would sort lower while it is later). This is because when
|
||||
# using the rotate option, logrotate sorts all rotated filenames to
|
||||
# find out which logfiles are older and should be removed.
|
||||
dateformat .%Y-%m-%d
|
||||
|
||||
# Use yesterday's instead of today's date to create the dateext
|
||||
# extension, so that the rotated log file has a date in its name that
|
||||
# is the same as the timestamps within it.
|
||||
dateyesterday
|
||||
|
||||
# Postpone compression of the previous log file to the next rotation
|
||||
# cycle. This only has effect when used in combination with compress.
|
||||
# It can be used when some program cannot be told to close its logfile
|
||||
# and thus might continue writing to the previous log file for some time.
|
||||
delaycompress
|
||||
|
||||
# If the log file is missing, go on to the next one without issuing an
|
||||
# error message.
|
||||
missingok
|
||||
|
||||
# Do not copy the original log file and leave it in place.
|
||||
nocopy
|
||||
|
||||
# New log files are not created.
|
||||
nocreate
|
||||
|
||||
# Don't mail old log files to any address.
|
||||
nomail
|
||||
|
||||
# Do not use shred when deleting old log files.
|
||||
noshred
|
||||
|
||||
# Do not rotate the log if it is empty.
|
||||
notifempty
|
||||
|
||||
# Logs are moved into directory for rotation. The directory must be on the
|
||||
# same physical device as the log file being rotated, and is assumed to be
|
||||
# relative to the directory holding the log file unless an absolute path
|
||||
# name is specified. When this option is used all old versions of the log
|
||||
# end up in directory.
|
||||
olddir /var/logrotate/reprepro
|
||||
|
||||
# Log files are rotated count times before being removed or mailed to the
|
||||
# address specified in a mail directive. If count is 0, old versions are
|
||||
# removed rather than rotated.
|
||||
rotate 1
|
||||
|
||||
# Log files are rotated if the current weekday is less than the weekday of
|
||||
# the last rotation or if more than a week has passed since the last
|
||||
# rotation. This is normally the same as rotating logs on the first day of
|
||||
# the week, but it works better if logrotate is not run every night.
|
||||
weekly
|
||||
}
|
||||
31
root/etc/reprepro/distributions
Normal file
31
root/etc/reprepro/distributions
Normal file
@@ -0,0 +1,31 @@
|
||||
Codename: bookworm
|
||||
Suite: oldstable
|
||||
Origin: Oldstable Repository
|
||||
Label: Oldstable Repository
|
||||
Description: Debian Bookworm Oldstable Repository
|
||||
Architectures: amd64 arm64
|
||||
Components: bookworm bookworm-ceph bookworm-pbs bookworm-pve
|
||||
Update: bookworm
|
||||
SignWith:
|
||||
Log: bookworm.log
|
||||
|
||||
Codename: trixie
|
||||
Suite: stable
|
||||
Origin: Stable Repository
|
||||
Label: Stable Repository
|
||||
Description: Debian Trixie Stable Repository
|
||||
Architectures: amd64 arm64
|
||||
Components: trixie trixie-ceph trixie-pbs trixie-pve
|
||||
Update: trixie
|
||||
SignWith:
|
||||
Log: trixie.log
|
||||
|
||||
Codename: noble
|
||||
Suite: stable
|
||||
Origin: Stable Repository
|
||||
Label: Stable Repository
|
||||
Description: Ubuntu Noble Numbat Stable Repository
|
||||
Architectures: amd64 arm64
|
||||
Components: noble
|
||||
SignWith:
|
||||
Log: noble.log
|
||||
9
root/etc/reprepro/options
Normal file
9
root/etc/reprepro/options
Normal file
@@ -0,0 +1,9 @@
|
||||
verbose
|
||||
outdir /var/lib/reprepro
|
||||
confdir /etc/reprepro
|
||||
distdir /var/lib/reprepro/dists
|
||||
logdir /var/log/reprepro
|
||||
dbdir /var/lib/reprepro/db
|
||||
listdir /var/lib/reprepro/list
|
||||
morguedir /var/lib/reprepro/morgue
|
||||
gnupghome /var/lib/reprepro/gnupg
|
||||
8
root/lib/systemd/system/reprepro.path
Normal file
8
root/lib/systemd/system/reprepro.path
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Reprepro Package Import
|
||||
|
||||
[Path]
|
||||
PathExistsGlob=/var/lib/reprepro/include/*.run
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
6
root/lib/systemd/system/reprepro.service
Normal file
6
root/lib/systemd/system/reprepro.service
Normal file
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Reprepro Package Import
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/sbin/repository -d
|
||||
437
root/usr/sbin/repository
Normal file
437
root/usr/sbin/repository
Normal file
@@ -0,0 +1,437 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
###
|
||||
#
|
||||
# Options Section
|
||||
#
|
||||
###
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
|
||||
###
|
||||
#
|
||||
# Function Section
|
||||
#
|
||||
###
|
||||
|
||||
function help () {
|
||||
local HELP
|
||||
case "${1}" in
|
||||
general)
|
||||
read -r -d '' HELP << EOL
|
||||
Usage: repository (OPTION)
|
||||
|
||||
Options:
|
||||
[ -h ] | Help
|
||||
[ -i ] | Include Package
|
||||
[ -l ] | List Repository Packages
|
||||
[ -r ] | Remove Package
|
||||
[ -u ] | Update Repository (Additional)
|
||||
EOL
|
||||
;;
|
||||
include)
|
||||
read -r -d '' HELP << EOL
|
||||
Usage: repository -i (COMPONENT) (PACKAGE)
|
||||
|
||||
Components:
|
||||
[ bookworm ] | Debian GNU/Linux Bookworm
|
||||
[ noble ] | Ubuntu GNU/Linux Noble Numbat
|
||||
[ trixie ] | Debian GNU/Linux Trixie
|
||||
|
||||
Package:
|
||||
The package that you want to publish in
|
||||
the repository.
|
||||
EOL
|
||||
;;
|
||||
list)
|
||||
read -r -d '' HELP << EOL
|
||||
Usage: repository -l (COMPONENT)
|
||||
|
||||
Components:
|
||||
[ all ] | All distributions listed below
|
||||
[ bookworm ] | Debian GNU/Linux Bookworm
|
||||
[ noble ] | Ubuntu GNU/Linux Noble Numbat
|
||||
[ trixie ] | Debian GNU/Linux Trixie
|
||||
EOL
|
||||
;;
|
||||
remove)
|
||||
read -r -d '' HELP << EOL
|
||||
Usage: repository -r (COMPONENT) (ARCHITECTURE) (PACKAGE)
|
||||
|
||||
Package:
|
||||
The package name that you want to remove.
|
||||
|
||||
Components:
|
||||
[ all ] | All distributions listed below
|
||||
[ bookworm ] | Debian GNU/Linux Bookworm
|
||||
[ noble ] | Ubuntu GNU/Linux Noble Numbat
|
||||
[ trixie ] | Debian GNU/Linux Trixie
|
||||
|
||||
Architectures:
|
||||
- all | All architectures listed below
|
||||
- arm64 | ARM64
|
||||
- amd64 | AMD64
|
||||
EOL
|
||||
;;
|
||||
update)
|
||||
read -r -d '' HELP << EOL
|
||||
Usage: repository -u (COMPONENT) (SERVICE)
|
||||
|
||||
Components:
|
||||
[ bookworm ] | Debian GNU/Linux Bookworm
|
||||
[ trixie ] | Debian GNU/Linux Trixie
|
||||
|
||||
Services:
|
||||
[ pve ] | Proxmox Virtual Environment
|
||||
[ pve-ceph ] | Proxmox Virtual Environment Ceph Squid
|
||||
[ pbs ] | Proxmox Backup Server
|
||||
EOL
|
||||
;;
|
||||
esac
|
||||
/usr/bin/echo -e "${HELP}"
|
||||
}
|
||||
|
||||
function proxmox-backup-server () {
|
||||
TMP=$(/usr/bin/mktemp --directory --quiet)
|
||||
trap "/usr/bin/rm --force --recursive ${TMP}" EXIT
|
||||
/usr/bin/wget --quiet --output-document="${TMP}/gitapi.json" "${REPOSITORY}"
|
||||
URLS=$(/usr/bin/grep 'browser_download_url' "${TMP}/gitapi.json" | /usr/bin/cut --delimiter='"' --fields='4')
|
||||
for URL in ${URLS}; do
|
||||
DEB=$(/usr/bin/basename "${URL}")
|
||||
PACKAGE=$(/usr/bin/basename "${URL%%_*}")
|
||||
VERSION_A="${DEB#*_}"
|
||||
VERSION_A="${VERSION_A%_*.deb}"
|
||||
VERSION_B=$(/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" --architecture 'arm64' list "${CODENAME}" "${PACKAGE}" | /usr/bin/mawk '{print $NF}' | /usr/bin/head --lines='1')
|
||||
if [[ -z "${VERSION_B}" ]] || \
|
||||
/usr/bin/dpkg --compare-versions "$VERSION_A" gt "${VERSION_B}" 2>/dev/null; then
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
/usr/bin/echo "Download (wofferl/proxmox-backup-arm64): ${DEB}"
|
||||
/usr/bin/wget --quiet --output-document="${TMP}/${DEB}" "${URL}"
|
||||
PACKAGE=$(/usr/bin/dpkg-deb --info "${TMP}/${DEB}" | /usr/bin/grep ' Package:' | /usr/bin/sed --expression='s/ Package: //')
|
||||
VERSION=$(/usr/bin/dpkg-deb --info "${TMP}/${DEB}" | /usr/bin/grep ' Version:' | /usr/bin/sed --expression='s/ Version: //')
|
||||
/usr/bin/echo "Repository (${COMPONENT}/arm64): ${PACKAGE} [${VERSION}]"
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" --architecture 'arm64' includedeb "${CODENAME}" "${TMP}/${DEB}" &> '/dev/null'
|
||||
/usr/bin/rm --force "${TEMP}/${DEB}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function proxmox-virtual-environment () {
|
||||
TMP=$(/usr/bin/mktemp --directory --quiet)
|
||||
trap "/usr/bin/rm --force --recursive ${TMP}" EXIT
|
||||
declare -A DEBS
|
||||
declare -A VERSIONS
|
||||
/usr/bin/wget --quiet --output-document="${TMP}/repository.html" "${REPOSITORY}"
|
||||
URLS=$(/usr/bin/grep --perl-regexp --only-matching 'href="\K[^"]*(arm64|amd64|all)[^"]*\.deb' "${TMP}/repository.html")
|
||||
/usr/bin/sleep '3s'
|
||||
for DEB in ${URLS}; do
|
||||
NAME=$(/bin/echo "${DEB}" | /usr/bin/sed -E 's/(_[0-9].*)//')
|
||||
VERSION="${DEB#*_}"
|
||||
VERSION="${VERSION%_*.deb}"
|
||||
if [[ -z "${VERSIONS[$NAME]}" ]] || \
|
||||
/usr/bin/dpkg --compare-versions "$VERSION" gt "${VERSIONS[$NAME]}" 2>/dev/null; then
|
||||
DEBS[$NAME]="$DEB"
|
||||
VERSIONS[$NAME]="$VERSION"
|
||||
fi
|
||||
done
|
||||
for DEB in "${DEBS[@]}"; do
|
||||
PACKAGE="${DEB%%_*}"
|
||||
VERSION_A="${DEB#*_}"
|
||||
VERSION_A="${VERSION_A%_*.deb}"
|
||||
VERSION_B=$(/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" --architecture 'arm64' list "${CODENAME}" "${PACKAGE}" | /usr/bin/mawk '{print $NF}' | /usr/bin/head --lines='1')
|
||||
if /usr/bin/dpkg --compare-versions "$VERSION_A" gt "${VERSION_B}" 2>/dev/null; then
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
/usr/bin/echo "Download (lierfang/pxvirt): ${DEB}"
|
||||
/usr/bin/wget --quiet --output-document="${TMP}/${DEB}" "${REPOSITORY}${DEB}"
|
||||
PACKAGE=$(/usr/bin/dpkg-deb --info "${TMP}/${DEB}" | /usr/bin/grep ' Package:' | /usr/bin/sed --expression='s/ Package: //')
|
||||
VERSION=$(/usr/bin/dpkg-deb --info "${TMP}/${DEB}" | /usr/bin/grep ' Version:' | /usr/bin/sed --expression='s/ Version: //')
|
||||
/usr/bin/echo "Repository (${COMPONENT}/arm64): ${PACKAGE} [${VERSION}]"
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" --architecture 'arm64' includedeb "${CODENAME}" "${TMP}/${DEB}" &> '/dev/null'
|
||||
/usr/bin/rm --force "${TMP}/${DEB}"
|
||||
fi
|
||||
unset DEBS
|
||||
unset VERSIONS
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
#
|
||||
# Runtime Environment
|
||||
#
|
||||
###
|
||||
|
||||
if [[ "${EUID}" -ne '0' ]]; then
|
||||
/usr/bin/echo -e 'Error: Permission Denied'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OUTDIR=$(/usr/bin/grep 'outdir' '/etc/reprepro/options' | /usr/bin/sed --expression='s/outdir //')
|
||||
|
||||
while getopts ':dhilru' OPT; do
|
||||
case "${OPT}" in
|
||||
d)
|
||||
for DEB in "${OUTDIR}/include/"*'.run'; do
|
||||
/usr/bin/rm --force "${DEB}"
|
||||
DEB="${DEB%.run}"
|
||||
if ! /usr/bin/dpkg-deb --info "${DEB}" &> '/dev/null'; then
|
||||
/usr/bin/rm --force "${DEB}"
|
||||
continue
|
||||
fi
|
||||
PACKAGE=$(/usr/bin/dpkg-deb --info "${DEB}" | /usr/bin/grep ' Package:' | /usr/bin/sed --expression='s/ Package: //')
|
||||
ARCHITECTURE=$(/usr/bin/dpkg-deb --info "${DEB}" | /usr/bin/grep ' Architecture:' | /usr/bin/sed --expression='s/ Architecture: //')
|
||||
case "${DEB}" in
|
||||
*_bookworm_*)
|
||||
CODENAME='bookworm'
|
||||
COMPONENT='bookworm'
|
||||
;;
|
||||
*_noble_*)
|
||||
CODENAME='noble'
|
||||
COMPONENT='noble'
|
||||
;;
|
||||
*_trixie_*)
|
||||
CODENAME='trixie'
|
||||
COMPONENT='trixie'
|
||||
;;
|
||||
*)
|
||||
/usr/bin/rm --force "${DEB}"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
if /usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" list "${CODENAME}" "${PACKAGE}" | /usr/bin/grep --only-matching --quiet "${PACKAGE}"; then
|
||||
/usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" remove "${CODENAME}" "${PACKAGE}" &> '/dev/null'
|
||||
fi
|
||||
/usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" includedeb "${CODENAME}" "${DEB}" &> '/dev/null'
|
||||
/usr/bin/rm --force "${DEB}"
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
h)
|
||||
set +e
|
||||
help general
|
||||
exit 0
|
||||
;;
|
||||
i)
|
||||
COMPONENT="${2}"
|
||||
DEB="${3}"
|
||||
CODENAME="${COMPONENT%%-*}"
|
||||
if [[ -z "${DEB}" ]] || \
|
||||
[[ -z "${COMPONENT}" ]]; then
|
||||
set +e
|
||||
help 'include'
|
||||
exit 0
|
||||
fi
|
||||
if ! /usr/bin/dpkg-deb --info "${DEB}" &> '/dev/null'; then
|
||||
/usr/bin/echo "Error: The file '${DEB}' is not a Debian package."
|
||||
exit 1
|
||||
fi
|
||||
PACKAGE=$(/usr/bin/dpkg-deb --info "${DEB}" | /usr/bin/grep ' Package:' | /usr/bin/sed --expression='s/ Package: //')
|
||||
VERSION=$(/usr/bin/dpkg-deb --info "${DEB}" | /usr/bin/grep ' Version:' | /usr/bin/sed --expression='s/ Version: //')
|
||||
ARCHITECTURE=$(/usr/bin/dpkg-deb --info "${DEB}" | /usr/bin/grep ' Architecture:' | /usr/bin/sed --expression='s/ Architecture: //')
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
/usr/bin/echo "Repository (${COMPONENT}/${ARCHITECTURE}): ${PACKAGE} [${VERSION}]"
|
||||
if [[ -f "${OUTDIR}/pool/${COMPONENT}/${PACKAGE:0:1}/${PACKAGE}/${PACKAGE}_${VERSION}_${ARCHITECTURE}.deb" ]]; then
|
||||
/usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" remove "${CODENAME}" "${PACKAGE}" &> '/dev/null'
|
||||
fi
|
||||
/usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" includedeb "${CODENAME}" "${DEB}" &> '/dev/null'
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
exit 0
|
||||
;;
|
||||
l)
|
||||
COMPONENT="${2}"
|
||||
if [[ -z "${COMPONENT}" ]]; then
|
||||
set +e
|
||||
help 'list'
|
||||
exit 0
|
||||
fi
|
||||
case "${COMPONENT}" in
|
||||
all)
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo '# --- Repository Packages'
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Bookworm'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'bookworm' list 'bookworm' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Noble'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'noble' list 'noble' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Trixie'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'trixie' list 'trixie' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
;;
|
||||
bookworm)
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo '# --- Repository Packages'
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Bookworm'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'bookworm' list 'bookworm' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
;;
|
||||
noble)
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo '# --- Repository Packages'
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Noble'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'noble' list 'noble' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
;;
|
||||
trixie)
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo '# --- Repository Packages'
|
||||
/usr/bin/echo '# ---'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/echo '# --- Trixie'
|
||||
/usr/bin/echo ''
|
||||
/usr/bin/reprepro --confdir '/etc/reprepro' --component 'trixie' list 'trixie' | /usr/bin/sed --expression='s/^\([^|]*\)|\1|//'
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'list'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
r)
|
||||
COMPONENTS="${2}"
|
||||
ARCHITECTURES="${3}"
|
||||
PACKAGE="${4}"
|
||||
if [[ -z "${PACKAGE}" ]] || \
|
||||
[[ -z "${COMPONENTS}" ]] || \
|
||||
[[ -z "${ARCHITECTURES}" ]]; then
|
||||
set +e
|
||||
help 'remove'
|
||||
exit 0
|
||||
fi
|
||||
case "${COMPONENTS}" in
|
||||
all)
|
||||
COMPONENTS=('bookworm' 'noble' 'trixie')
|
||||
;;
|
||||
bookworm)
|
||||
COMPONENTS=('bookworm')
|
||||
;;
|
||||
noble)
|
||||
COMPONENTS=('noble')
|
||||
;;
|
||||
trixie)
|
||||
COMPONENTS=('trixie')
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'remove'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
case "${ARCHITECTURES}" in
|
||||
all)
|
||||
ARCHITECTURES=('arm64' 'amd64')
|
||||
;;
|
||||
arm64)
|
||||
ARCHITECTURES=('arm64')
|
||||
;;
|
||||
amd64)
|
||||
ARCHITECTURES=('amd64')
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'remove'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
for COMPONENT in "${COMPONENTS[@]}"; do
|
||||
CODENAME="${COMPONENT%%-*}"
|
||||
for ARCHITECTURE in "${ARCHITECTURES[@]}"; do
|
||||
if /usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" list "${CODENAME}" "${PACKAGE}" | /usr/bin/grep --only-matching --quiet "${PACKAGE}"; then
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
/usr/bin/echo "Repository (${COMPONENT}/${ARCHITECTURE}): ${PACKAGE}"
|
||||
/usr/bin/reprepro --silent --confdir '/etc/reprepro' --component "${COMPONENT}" --architecture "${ARCHITECTURE}" remove "${CODENAME}" "${PACKAGE}" &> '/dev/null'
|
||||
/usr/bin/echo '# --- --- --- --- --- #'
|
||||
fi
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
u)
|
||||
CODENAME="${2}"
|
||||
PROJECT="${3}"
|
||||
if [[ -z "${CODENAME}" ]] || \
|
||||
[[ -z "${PROJECT}" ]]; then
|
||||
set +e
|
||||
help update
|
||||
exit 0
|
||||
fi
|
||||
case "${CODENAME}" in
|
||||
bookworm)
|
||||
case "${PROJECT}" in
|
||||
pve)
|
||||
REPOSITORY='https://mirrors.lierfang.com/pxcloud/pxvirt/dists/bookworm/main/binary-arm64/'
|
||||
COMPONENT='bookworm-pve'
|
||||
proxmox-virtual-environment
|
||||
;;
|
||||
pve-ceph)
|
||||
REPOSITORY='https://mirrors.lierfang.com/pxcloud/pxvirt/dists/bookworm/ceph-squid/binary-arm64/'
|
||||
COMPONENT='bookworm-ceph'
|
||||
proxmox-virtual-environment
|
||||
;;
|
||||
pbs)
|
||||
REPOSITORY="https://api.github.com/repos/wofferl/proxmox-backup-arm64/releases/tags/3.4.6-1"
|
||||
COMPONENT='bookworm-pbs'
|
||||
proxmox-backup-server
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help update
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
trixie)
|
||||
case "${PROJECT}" in
|
||||
pve)
|
||||
REPOSITORY='https://mirrors.lierfang.com/pxcloud/pxvirt/dists/trixie/main/binary-arm64/'
|
||||
COMPONENT='trixie-pve'
|
||||
proxmox-virtual-environment
|
||||
;;
|
||||
pve-ceph)
|
||||
REPOSITORY='https://mirrors.lierfang.com/pxcloud/pxvirt/dists/trixie/ceph-squid/binary-arm64/'
|
||||
COMPONENT='trixie-ceph'
|
||||
proxmox-virtual-environment
|
||||
;;
|
||||
pbs)
|
||||
REPOSITORY="https://api.github.com/repos/wofferl/proxmox-backup-arm64/releases/latest"
|
||||
COMPONENT='trixie-pbs'
|
||||
proxmox-backup-server
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'update'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'update'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
-*|*)
|
||||
set +e
|
||||
help 'general'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
set +e
|
||||
help 'general'
|
||||
shift $((OPTIND-1))
|
||||
Reference in New Issue
Block a user