Explorar el Código

dpkg-name: Add support for Package-Type

Guillem Jover hace 18 años
padre
commit
8fd4c5df34
Se han modificado 5 ficheros con 26 adiciones y 8 borrados
  1. 5 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 4 0
      man/ChangeLog
  4. 6 5
      man/dpkg-name.1
  5. 8 3
      scripts/dpkg-name.sh

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-11-22  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-name.sh (getname): Get the package extension from the
+	Package-Type field, or fallback to deb if not present.
+
 2007-11-22  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/dpkg-shlibdeps.pl: Add more debug messages. Accept empty

+ 3 - 0
debian/changelog

@@ -15,6 +15,9 @@ dpkg (1.14.10) UNRELEASED; urgency=low
     orig.tar.{gz,bz2,lzma} file and won't unexpectedly create "Format: 2.0"
     .dsc files.
 
+  [ Guillem Jover ]
+  * Add support for Package-Type in dpkg-name.
+
   [ Updated man pages translations ]
   * Swedish (Peter Karlsson)
 

+ 4 - 0
man/ChangeLog

@@ -1,3 +1,7 @@
+2007-11-22  Guillem Jover  <guillem@debian.org>
+
+	* dpkg-name.1: Document that the Package-Type field is now supported.
+
 2007-11-02  Peter Karlsson  <peterk@debian.org>
 
 	* po/sv.po: Updated to 1344t.

+ 6 - 5
man/dpkg-name.1

@@ -3,7 +3,7 @@
 .\"
 .\" This is free software; see the GNU General Public Licence version 2
 .\" or later for copying conditions.  There is NO warranty.
-.TH dpkg\-name 1 "2007-07-18" "Debian Project" "dpkg utilities"
+.TH dpkg\-name 1 "2007-11-22" "Debian Project" "dpkg utilities"
 .SH NAME
 dpkg\-name \- rename Debian packages to full package names
 .
@@ -20,10 +20,11 @@ This manual page documents the
 program which provides an easy way to rename
 .B Debian
 packages into their full package names. A full package name consists
-of \fI<package>_<version>_<architecture>.deb\fP as specified in the control
-file of the package. The \fI<version>\fP part of the filename consists of
-the upstream version information optionally followed by a hyphen and
-the revision information.
+of \fI<package>_<version>_<architecture>.<package_type>\fP as specified in
+the control file of the package. The \fI<version>\fP part of the filename
+consists of the upstream version information optionally followed by a
+hyphen and the revision information. The \fI<package_type>\fP part comes
+from that field if present or fallbacks to \fBdeb\fP.
 .
 .SH OPTIONS
 .TP

+ 8 - 3
scripts/dpkg-name.sh

@@ -34,7 +34,7 @@ usage () {
 	echo "Usage: ${prog} <file>...
 
 ${purpose}
-file.deb changes to <package>_<version>_<architecture>.deb
+file.deb changes to <package>_<version>_<architecture>.<package_type>
 according to the ``underscores convention''.
 
 Options:
@@ -80,11 +80,16 @@ getname () {
 			a=`dpkg --print-architecture`;
 			stderr "assuming architecture \`"$a"' for \`"$1"'";
 		fi
+		t=`dpkg-deb -f -- "$1" package-type`
+		if [ -z "$t" ];
+		then
+			t=deb
+		fi
 		if [ -z "$noarchitecture" ];
 		then
-			tname=$p\_$v\_$a.deb;
+			tname=$p\_$v\_$a.$t;
 		else
-			tname=$p\_$v.deb
+			tname=$p\_$v.$t
 		fi
 	
 		name=`echo $tname|sed -e 's/ //g'`