You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.3 KiB
32 lines
1.3 KiB
#!/bin/bash
|
|
|
|
cat <<EOF
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ Displaying content of generated Debian packages. │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
EOF
|
|
|
|
if ! command -v debc >/dev/null 2>&1 ; then
|
|
echo "Error: debc executable not available, please install the devscripts Debian package." >&2
|
|
exit 1
|
|
fi
|
|
|
|
declare -a debc_opts
|
|
|
|
CHANGES=$(find . -maxdepth 1 -name \*.changes ! -name \*_source.changes)
|
|
|
|
HOST_ARCH="$(dpkg-architecture -qDEB_HOST_ARCH)"
|
|
if [ -n "${HOST_ARCH}" ] && [ -n "${architecture}" ] && [ "${architecture}" != "${HOST_ARCH}" ] ; then
|
|
debc_opts+=(-a "${architecture}")
|
|
fi
|
|
|
|
if [ -n "$CHANGES" ] >/dev/null 2>&1 ; then
|
|
for file in $CHANGES ; do
|
|
debc "${debc_opts[@]}" "$file"
|
|
done
|
|
elif ls ./*.deb >/dev/null 2>&1 ; then
|
|
debc "${debc_opts[@]}" ./*.deb
|
|
else
|
|
echo "No changes and deb files found in $(pwd), ignoring."
|
|
fi
|