]> err.no Git - dpkg/commitdiff
Oops, forgot to add scripts/dpkg-safefilelist.{1,pl}
authorWichert Akkerman <wakkerma@debian.org>
Sat, 25 Dec 1999 01:52:20 +0000 (01:52 +0000)
committerWichert Akkerman <wakkerma@debian.org>
Sat, 25 Dec 1999 01:52:20 +0000 (01:52 +0000)
debian/control: remove double empty line

ChangeLog
debian/control
scripts/dpkg-safefilelist.1 [new file with mode: 0644]
scripts/dpkg-safefilelist.pl [new file with mode: 0644]

index d4cdffbedf667cb0f75519d426d0f7db8ad94c93..956dd7c9f8fd15a3dfebd870c2aa5b923a5cd5e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index 1eac54b7da328037e352853a74f81a2176782305..4688375b3425891acaecfea86a1f20fc63724453 100644 (file)
@@ -5,7 +5,6 @@ Maintainer: Wichert Akkerman <wakkerma@debian.org>
 Standards-Version: 3.1.0
 Build-Depends: debiandoc-sgml, ncurses-dev
 
-
 Package: dpkg
 Architecture: any
 Essential: yes
diff --git a/scripts/dpkg-safefilelist.1 b/scripts/dpkg-safefilelist.1
new file mode 100644 (file)
index 0000000..7a5b8bb
--- /dev/null
@@ -0,0 +1,37 @@
+.\" 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.
diff --git a/scripts/dpkg-safefilelist.pl b/scripts/dpkg-safefilelist.pl
new file mode 100644 (file)
index 0000000..6521015
--- /dev/null
@@ -0,0 +1,35 @@
+#!/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";
+                       }
+               }
+       }
+}