version 1.8, 2021/10/16 19:31:13 |
version 1.10, 2021/10/17 03:05:29 |
|
|
echo "Uninstalling $installed" |
echo "Uninstalling $installed" |
cwd=${PKGDIR}/$installed |
cwd=${PKGDIR}/$installed |
|
|
remove="${cwd}/+CONTENTS ${cwd}" |
set -A _remove -- "${cwd}/+CONTENTS" "${cwd}" |
|
|
while read c g; do |
while read c g; do |
case $c in |
case $c in |
|
|
;; |
;; |
@*) continue |
@*) continue |
;; |
;; |
*) remove="$cwd/$c $remove" |
*) set -A _remove -- "$cwd/$c" "${_remove[@]}" |
;; |
;; |
esac |
esac |
done < "${PKGDIR}/$installed/+CONTENTS" |
done < "${PKGDIR}/$installed/+CONTENTS" |
|
|
for r in $remove ; do |
for _r in "${_remove[@]}"; do |
if [ -d "$r" ]; then |
if [ -d "$_r" ]; then |
# Try hard not to actually remove recursively |
# Try hard not to actually remove recursively |
# without rmdir on the install media. |
# without rmdir on the install media. |
[ "$r/*" = $( echo "$r"/* ) ] && rm -rf "$r" |
[ "$_r/*" = $( echo "$_r"/* ) ] && rm -rf "$_r" |
else |
else |
rm -f "$r" |
rm -f "$_r" |
fi |
fi |
done |
done |
fi |
fi |
|
|
# TODO: Or, maybe we save the firmware someplace and make pkg_add reinstall |
# TODO: Or, maybe we save the firmware someplace and make pkg_add reinstall |
echo "Installing $_f" |
echo "Installing $_f" |
tar -zxphf "$_f" -C /etc "firmware/*" |
tar -zxphf "$_f" -C /etc "firmware/*" |
mkdir -p ${PKGDIR}/${firmware%.tgz}/ |
mkdir -p ${PKGDIR}/${_f%.tgz}/ |
tar -zxphf "$_f" -C "${PKGDIR}/${firmware%.tgz}" "+*" |
tar -zxphf "$_f" -C "${PKGDIR}/${_f%.tgz}" "+*" |
ed -s "${PKGDIR}/${firmware%.tgz}/+CONTENTS" <<EOL |
ed -s "${PKGDIR}/${_f%.tgz}/+CONTENTS" <<EOL |
/^@comment pkgpath/ -1a |
/^@comment pkgpath/ -1a |
@option manual-installation |
@option manual-installation |
@option firmware |
@option firmware |