summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Heath <doogie@debian.org>2000-12-24 12:34:20 +0000
committerAdam Heath <doogie@debian.org>2000-12-24 12:34:20 +0000
commit089211013d2f52e7c2f0a84878cf153e7337011f (patch)
treec2cb2923c53b3d14216bb3a1273add16a2f2bf65
parent7d0fda8105375d37134f751310f4d67615e4adfd (diff)
downloaddpkg-089211013d2f52e7c2f0a84878cf153e7337011f.tar.gz
Add -k|--symlink option.
-rw-r--r--ChangeLog4
-rw-r--r--debian/changelog1
-rw-r--r--scripts/dpkg-name.15
-rwxr-xr-xscripts/dpkg-name.sh10
4 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6645a0f03..7d06c39b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Dec 24 06:31:55 CST 2000 Adam Heath <doogie@debian.org>
+
+ * scripts/dpkg-name.sh: Add -k|--symlink option.
+
Sun Dec 24 05:58:48 CST 2000 Adam Heath <doogie@debian.org>
* dselect/main.cc: Made the accelerator keys in dselect's main
diff --git a/debian/changelog b/debian/changelog
index f9bd9c111..03acb693d 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 3742cde98..68449972c 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 67c4894b5..c67289f6e 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