[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: netpbm vs. pbmplus



Some people have been arguing about the merits of /usr/bin/<package>/*,
bringing forward arguments as convincing that only this allows for easy
identification of files from <package>.

Chris summed that up by saying:
  Chris> Didn't you see my example of the Slackware sysadmin who would rather
  Chris> ftp /usr/bin/netpbm.tar from a Debian box rather than recompile from
  Chris> source?  Organized subdirectories make many things easier, add
  Chris> flexibility, and make the system easier to explore.

I couldn't resist and replied that we could simply use the output of dpkg -L
<package> because, after all, we have package management, haven't we?

Chris answered:
  Craig> There's no certain way of distinguising a directory from a file.
  Craig> Without certainty you're risking either missing some files or
  Craig> incorrectly including an entire directory.
[...]
  Craig> Which lines are the directories?  What algorithm do you use to
  Craig> identify them?

Nothing that a little perl couldn't do:
---------------------------------------------------------------------------
#!/usr/bin/perl --	# hey Emacs, this is -*-Perl-*-
# 
foreach	$i (0 .. $#ARGV) {
    $package = `dpkg -L $ARGV[$i]` || die ("Can't call dpkg, quitting");
    @files = split(/\n/,$package);
    for $file (@files) {
	print "$file\n" unless -d $file;
    }
} 
---------------------------------------------------------------------------
Save this as 'debfiles' or whatever in your local path, chmod u+x and you're
all set. The dedicated, and aforementioned, slackware sysadmin (to whom I
hereby dedicate this script), simply calls on his friendly Debian box:

	tar cfz slack-pack.tar.gz 'debfiles <package>'

Hope this helps. 

--
Dirk Eddelb"uttel                              http://qed.econ.queensu.ca/~edd



Reply to: