+Sat Dec 25 02:50:31 CET 1999 Wichert Akkerman <wakkerma@debian.org>
+
+ * Oops, forgot to add scripts/dpkg-safefilelist.{1,pl}
+ * debian/control: remove double empty line
+
Fri Dec 24 17:34:30 CET 1999 Wichert Akkerman <wakkerma@debian.org>
* version-nr: update to 1.6.5
--- /dev/null
+.\" This is an -*- nroff -*- source file.
+.\" dpkg-safefilelist and this manpage are Copyright 1999 by Adam Heath.
+.\"
+.\" This is free software; see the GNU General Public Licence version 2
+.\" or later for copying conditions. There is NO warranty.
+.\" Time-stamp: <Fri, 24 Dec 1999 05:36:51 -0600>
+.TH dpkg-safefilelist 1 "December 1999" "Debian Project" "Debian GNU/Linux"
+.SH NAME
+dpkg\-safefilelist \- List files with symlinks after their targets
+.SH SYNOPSIS
+.B dpkg\-safefilelist
+.SH DESCRIPTION
+.PP
+This manual page documents the
+.B dpkg\-safefilelist
+.sh script which provides an easy way to list files with the targets
+coming before the symlinks that point to them.
+
+.SH EXAMPLES
+.TP
+.B dpkg-safefilelist
+This will find all files in the current directory, and sort them,
+printing symlinks after their targets.
+.SH BUGS?
+Successfully tested on
+.B Debian Linux
+systems only.
+.SH SEE ALSO
+.BR dpkg-deb (8),
+.BR find (1),
+.SH COPYRIGHT
+Copyright 1999 Adam Heath.
+.B dpkg-safefilelist
+is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is
+.B no
+warranty.
--- /dev/null
+#!/usr/bin/perl
+open(FILES, "find -mindepth 1|");
+sub myprint {
+ print "@_\n";
+}
+while (<FILES>) {
+ chomp;
+ $file = $_;
+ if( ! -l $file ) {
+ print "$file\n" if(!$targets{$file});
+ }
+ $newfile = $file;
+ $oldfile = $newfile;
+
+ while (-l $newfile) {
+ push @symlinks, $newfile;
+ $oldfile = $newfile;
+ $link = readlink($newfile);
+ $newfile = $_;
+ $newfile =~ s,.*/,,;
+ $path = $_;
+ $path =~ s,[^/]*$,,;
+ $newfile = $path . $link;
+ break if("$oldfile" == "$newfile");
+ }
+ if(-e $newfile) {
+ push @symlinks, $newfile;
+ while($file = pop @symlinks) {
+ if(!$targets{$file}) {
+ $targets{$file} = 1;
+ print "$file\n";
+ }
+ }
+ }
+}