Add 'PackageManagement/debDependencies.sh'

This commit is contained in:
Jack Hadrill 2021-03-29 17:56:17 +00:00
parent 71a1928ca4
commit d9bac44b95
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/bin/bash
PACKAGE=$1
apt-get update
DEPENDENCIES=$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances ${PACKAGE} | grep "^\w" | sort -u)
TMP="/tmp/${PACKAGE}-$(date +%s)"
mkdir -p ${TMP}
pushd ${TMP}
echo ${DEPENDENCIES} | xargs apt-get download
apt-get download ${PACKAGE}
popd
tar -cvf "${PACKAGE}.tar" -C ${TMP} .