blob: 577831ca42e6e4381934d00b601550bdc81017df (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!/bin/bash
########################################################################################################################
# apt-list-bin-packages-from-src.sh
########################################################################################################################
#
# All rights reserved Ⓒ 2017-2023 sdxlive.com
#
# Written by Jean-Christophe Manciot <jcmanciot@sdxlive.com>
#
# Licensed under a GPLv3 License.
# You may not use this file except in compliance with the License. You may obtain a copy of the License at
#
# https://www.gnu.org/licenses/gpl-3.0.md
#
# The licensor cannot revoke these freedoms as long as you follow the license terms.
#
# Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
# You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
#
########################################################################################################################
########################################################################################################################
#
# Listing all apt binary packages from a source package, excluding all udebs.
#
########################################################################################################################
#
# Requirements:
# ------------
#
# - We assume that apt is already installed.
#
########################################################################################################################
#
# Parameters:
# ----------
#
#######################################################################################################################
#
# Usage: example
# -----
#
# readarray -t bin_packages < <(apt-list-bin-packages-from-src.sh mount)
#
########################################################################################################################
# set -x
src_package=$1
PARAMETERS_NUMBER=1
case "$#" in
${PARAMETERS_NUMBER})
;;
*)
echo -e ''$_{1..180}'\b-'
echo Wrong number of parameters: $(basename $0) $@
echo -e ''$_{1..180}'\b-'
exit 1
;;
esac
apt-cache showsrc "$src_package" | awk "/^Package-List:/{flag=1; next} /^Files:/{flag=0} flag" | awk '{print $1}' | grep -v -- -udeb
exit $?
|