File: dpkg2folder

package info (click to toggle)
dpkg-iasearch 0.9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 88 kB
  • ctags: 9
  • sloc: sh: 160; makefile: 45; perl: 28
file content (26 lines) | stat: -rwxr-xr-x 830 bytes parent folder | download
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
#!/usr/bin/perl
# Passes a Package file to several files, one per package,
# with the information of each package
# (c) Javier Fernandez-Sanguino Pea 2000
# Distributed under the GNU GPL License
use Getopt::Std;
getopts ('d');
open (PACK,">/dev/null");
while (<STDIN>)
#  The package file (for example /var/lib/dpkb/available)
# must be given as input
{
	if (/^Package: (.*)$/)
	{
	  print "Found description of package $package\n" if $opt_d;
	  $package=$1; 
	  close PACK;
	  mkdir  $package,0700 || die ("Could not create the directory for $package: $!\n");
	  # Here we store the description of the control file but we could
	  # also (in the future) use it to link to /usr/share/doc/$package files
	  open (PACK,">$package/$package") || die "Could not open file $package for writing :$!\n"; 
	 }
	 print PACK;
}
exit 0;