aboutsummaryrefslogtreecommitdiff
path: root/aptmeta/enmeta
blob: 14fdfdb5497fb85b0ee112837794344e6b2161d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 install:
echo $PKG
echo
echo Will set as automatically installed:
echo $DEPS

echo
echo -n 'Type y to continue: '
read LINE
if [ "z$LINE" == "zy" ]; then
  sudo apt-get install $PKG
  sudo apt-mark auto $DEPS
else
  echo Abandoned.
fi

popd >/dev/null
rm -rf $WDIR