Procházet zdrojové kódy

Oops, forgot to add scripts/dpkg-safefilelist.{1,pl}
debian/control: remove double empty line

Wichert Akkerman před 26 roky
rodič
revize
4af84cdc4f
4 změnil soubory, kde provedl 77 přidání a 1 odebrání
  1. 5 0
      ChangeLog
  2. 0 1
      debian/control
  3. 37 0
      scripts/dpkg-safefilelist.1
  4. 35 0
      scripts/dpkg-safefilelist.pl

+ 5 - 0
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

+ 0 - 1
debian/control

@@ -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

+ 37 - 0
scripts/dpkg-safefilelist.1

@@ -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.

+ 35 - 0
scripts/dpkg-safefilelist.pl

@@ -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";
+			}
+		}
+	}
+}