Просмотр исходного кода

dselect: Properly parse fdisk output in disk setup method

util-linux's fdisk has not emitted the Begin column since 1998-06-10
version 2.8. Change the parsing code accordingly to make it actually
work.
Guillem Jover лет назад: 17
Родитель
Сommit
5ccdc88f40
2 измененных файлов с 5 добавлено и 3 удалено
  1. 2 0
      debian/changelog
  2. 3 3
      dselect/methods/disk/setup

+ 2 - 0
debian/changelog

@@ -1,10 +1,12 @@
 dpkg (1.15.2) UNRELEASED; urgency=low
 
+  [ Guillem Jover ]
   * Fix FTBFS on GNU/Hurd due to a missmatched define usage in
     start-stop-daemon.
   * Remove obsolete priorities support from dselect.
     Thanks to Sven Joachim <svenjoac@gmx.de>.
   * Fix bashism (“echo -e”) in dselect disk setup method. Closes: #530071
+  * Properly parse fdisk output in dselect disk setup method.
 
   [ Updated dpkg translations ]
   * Asturian (Marcos Alvarez Costales). Closes: #529889

+ 3 - 3
dselect/methods/disk/setup

@@ -82,9 +82,9 @@ getblockdev () {
 			print_partition_table "$blockbase" >$tp.f
 			set -e
 			proposeddevice="$tryblockdevice" perl -ne '
-next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/;
+next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/;
 next unless s:^/\S+:: && $& eq $ENV{"proposeddevice"};
-next unless s/^ +(\* +)?\d+ +\d+ +\d+ +\d+\+? +//;
+next unless s/^ +(\* +)?\d+ +\d+ +\d+\+? +//;
 next unless m/^([0-9a-f]{1,2}) /i;
 %types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix",
           "81","minix", "83","ext2" );
@@ -299,7 +299,7 @@ then
 	fi
 	set -e
 	perl -ne '
-next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/;
+next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/;
 next unless / [146] +DOS \d+-bit \S+$/;
 next unless m:^/\S+:;
 print $&;		' <$tp.f >$tp.d