diff options
author | Nat Lasseter <user@4574.co.uk> | 2024-03-12 11:17:02 +0000 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2024-03-12 11:17:02 +0000 |
commit | 4583098c1e98a49091bed36fb7f31ad828bd3d16 (patch) | |
tree | 0ee7337d85a11b0312ab5a62834b2358f6943f2c /demeta | |
parent | a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 (diff) |
add demeta
Diffstat (limited to 'demeta')
-rwxr-xr-x | demeta | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +#!/bin/bash + +PKG=$1 + +if [ -z $PKG ]; then + echo "Specify package" >&2 + exit 1 +fi + +WDIR=$(mktemp --tmpdir -d demeta.XXXXXXXXXX) +pushd $WDIR >/dev/null + +FILE=$(apt-get download $PKG --print-uris | cut -d\ -f2) +apt-get -qq download $PKG + +CNTRL=$(ar p $FILE control.tar.xz | unxz | tar -x ./control) +DEPS=$(cat control | grep ^Depends | cut -d: -f2 | tr -d ,) + +echo Will set as manually installed: +echo $DEPS +echo +echo Will remove: +echo $PKG + +echo +echo -n 'Type y to continue: ' +read LINE +if [ "z$LINE" == "zy" ]; then + sudo apt-mark manual $DEPS + sudo apt-get purge $PKG +else + echo Abandoned. +fi + +popd >/dev/null +rm -rf $WDIR |