You've already forked Reprepro-Wrapper
46 lines
1005 B
Bash
46 lines
1005 B
Bash
#!/usr/bin/bash
|
|
|
|
|
|
###
|
|
#
|
|
# Options Section
|
|
#
|
|
###
|
|
|
|
set -e
|
|
set -o pipefail
|
|
|
|
|
|
###
|
|
#
|
|
# Variable Section
|
|
#
|
|
###
|
|
|
|
OUTDIR=$(/usr/bin/grep 'outdir' '/etc/reprepro/options' | /usr/bin/sed --expression='s/outdir //')
|
|
|
|
|
|
###
|
|
#
|
|
# Runtime Environment
|
|
#
|
|
###
|
|
|
|
if [[ ! -d "${OUTDIR}" ]]; then
|
|
/usr/bin/install --directory --group='nogroup' --owner='nobody' "${OUTDIR}"
|
|
exit 0
|
|
fi
|
|
|
|
for DEBINFO in "${OUTDIR}/import"/*.rep; do
|
|
source "${DEBINFO}"
|
|
if [[ -f "${OUTDIR}/pool/${COMPONENT}/${DEB:0:1}/${PACKAGE}/${DEB}" ]]; then
|
|
for VERSION_CODENAME in ${CODENAME}; do
|
|
/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" remove "${VERSION_CODENAME}" "${PACKAGE}" &> '/dev/null'
|
|
done
|
|
fi
|
|
for VERSION_CODENAME in ${CODENAME}; do
|
|
/usr/bin/reprepro --confdir '/etc/reprepro' --silent --component "${COMPONENT}" includedeb "${VERSION_CODENAME}" "${OUTDIR}/import/${DEB}" &> '/dev/null'
|
|
done
|
|
/usr/bin/rm --force "${OUTDIR}/import/${DEB}"
|
|
/usr/bin/rm --force "${DEBINFO}"
|
|
done |