Selaa lähdekoodia

dpkg-name: Add support for Package-Type

Guillem Jover 18 vuotta sitten
vanhempi
commit
8fd4c5df34
5 muutettua tiedostoa jossa 26 lisäystä ja 8 poistoa
  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>
 2007-11-22  Raphael Hertzog  <hertzog@debian.org>
 
 
 	* scripts/dpkg-shlibdeps.pl: Add more debug messages. Accept empty
 	* 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"
     orig.tar.{gz,bz2,lzma} file and won't unexpectedly create "Format: 2.0"
     .dsc files.
     .dsc files.
 
 
+  [ Guillem Jover ]
+  * Add support for Package-Type in dpkg-name.
+
   [ Updated man pages translations ]
   [ Updated man pages translations ]
   * Swedish (Peter Karlsson)
   * 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>
 2007-11-02  Peter Karlsson  <peterk@debian.org>
 
 
 	* po/sv.po: Updated to 1344t.
 	* 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
 .\" This is free software; see the GNU General Public Licence version 2
 .\" or later for copying conditions.  There is NO warranty.
 .\" 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
 .SH NAME
 dpkg\-name \- rename Debian packages to full package names
 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
 program which provides an easy way to rename
 .B Debian
 .B Debian
 packages into their full package names. A full package name consists
 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
 .SH OPTIONS
 .TP
 .TP

+ 8 - 3
scripts/dpkg-name.sh

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