File: listsources

package info (click to toggle)
xbuilder 1.0.1%2Bnmu2
  • links: PTS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 224 kB
  • sloc: sh: 331; perl: 300; makefile: 7; awk: 3
file content (26 lines) | stat: -rwxr-xr-x 637 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
here=`pwd`

usage()
{
echo "usage: $@ <inputfile> <outputfile>"
echo "inputfile contains a list of packages, binaries, or source"
echo "output file will contain a sorted, de-duped list of corresponding source packages"
exit 1
}

if [ -z "$1" ] || [ -z "$2" ]; then usage; fi

rm -f $2

for package in `cat $1`
do
  echo -n "finding source for $package:"
  sourcepackage=`grep-aptavail -X -FSource -FPackage $package -s Source:Package | awk '{ print $2 }' | sort | uniq`
  if [ -z "${sourcepackage}" ]; then 
    echo "No source found for $package"; 
  else
    echo ${sourcepackage} >> $2
    echo " ${sourcepackage}"
  fi
done