From 089211013d2f52e7c2f0a84878cf153e7337011f Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 24 Dec 2000 12:34:20 +0000 Subject: [PATCH] Add -k|--symlink option. --- ChangeLog | 4 ++++ debian/changelog | 1 + scripts/dpkg-name.1 | 5 ++++- scripts/dpkg-name.sh | 10 +++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6645a0f0..7d06c39b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Dec 24 06:31:55 CST 2000 Adam Heath + + * scripts/dpkg-name.sh: Add -k|--symlink option. + Sun Dec 24 05:58:48 CST 2000 Adam Heath * dselect/main.cc: Made the accelerator keys in dselect's main diff --git a/debian/changelog b/debian/changelog index f9bd9c11..03acb693 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ dpkg (1.8.0) unstable; urgency=low + * Add -k|--symlink option to dpkg-name. Closes: #35040 * Made the accelerator keys in dselect's main menu separate options, so that they can be translated separately. Closes: #50955. * Added depends on sysvinit (>= 2.72), so that we can make sure that diff --git a/scripts/dpkg-name.1 b/scripts/dpkg-name.1 index 3742cde9..68449972 100644 --- a/scripts/dpkg-name.1 +++ b/scripts/dpkg-name.1 @@ -11,7 +11,7 @@ dpkg\-name \- rename Debian packages to full package names .B dpkg\-name [\-a|\-\-no\-architecture] [\-o|\-\-overwrite] [\-s|\-\-subdir [dir]] [\-c|\-\-create\-dir] [\-h|\-\-help] [\-v|\-\-version] -[\-l|\-\-license] [\-[--] [files] +[\-l|\-\-license] [\-k|\-\-symlink] [\-[--] [files] .SH DESCRIPTION .PP This manual page documents the @@ -47,6 +47,9 @@ This can be used when building new packages. .TP .B "\-a, \-\-no\-architecture" The destination filename will not have the architecture information. +.TP +.B "\-k, \-\-symlink" +Create a symlink, instead of moving. .TP .B "\-o, \-\-overwrite" Existing files will be overwritten if they have the same name as the diff --git a/scripts/dpkg-name.sh b/scripts/dpkg-name.sh index 67c4894b..c67289f6 100755 --- a/scripts/dpkg-name.sh +++ b/scripts/dpkg-name.sh @@ -37,6 +37,7 @@ usage () { according to the ``underscores convention''. -a|--no-architecture No architecture part in filename -o|--overwrite Overwrite if file exists + -k|--symlink Don't create a new file, but a symlink -s|--subdir [dir] Move file into subdir (Use with care) -c|--create-dir Create target dir if not there (Use with care) -h|--help|-v|--version|-l|--license Show help/version/license" @@ -137,13 +138,19 @@ move () { fi fi newname=`echo $dir/$name`; + if [ x$symlink = x1 ]; + then + command="ln -s --" + else + command="mv --" + fi if [ $newname -ef "$1" ]; # same device and inode numbers then stderr "skipping \`"$1"'"; elif [ -f $newname -a -z "$overwrite" ]; then stderr "can't move \`"$1"' to existing file"; - elif `mv -- "$1" $newname`; + elif `$command "$1" $newname`; then echo "moved \``basename "$1"`' to \`$newname'"; else @@ -173,6 +180,7 @@ do --create-dir|-c) createdir=1;; --subdir|-s) subdirset=1;; --overwrite|-o) overwrite=1 ;; + --symlink|-k) symlink=1 ;; --no-architecture|-a) noarchitecture=1 ;; --) shift; for arg -- 2.39.5