Hello community,
here is the log from the commit of package yast2-storage for openSUSE:Factory
checked in at Fri Apr 16 18:43:20 CEST 2010.
--------
--- yast2-storage/yast2-storage.changes 2010-04-06 12:26:32.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-storage/yast2-storage.changes 2010-04-16 14:29:36.000000000 +0200
@@ -1,0 +2,11 @@
+Thu Apr 15 12:04:37 CEST 2010 - aschnell@suse.de
+
+- improved layout of dialog for importing mount points
+- 2.19.11
+
+-------------------------------------------------------------------
+Fri Apr 09 10:08:21 CEST 2010 - aschnell@suse.de
+
+- added requires for Perl (bnc #595024)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-storage-2.19.10.tar.bz2
New:
----
yast2-storage-2.19.11.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-storage.spec ++++++
--- /var/tmp/diff_new_pack.Zboose/_old 2010-04-16 18:42:43.000000000 +0200
+++ /var/tmp/diff_new_pack.Zboose/_new 2010-04-16 18:42:43.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-storage (Version 2.19.10)
+# spec file for package yast2-storage (Version 2.19.11)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,11 +19,11 @@
Name: yast2-storage
-Version: 2.19.10
-Release: 2
+Version: 2.19.11
+Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-storage-2.19.10.tar.bz2
+Source0: yast2-storage-2.19.11.tar.bz2
Prefix: /usr
@@ -31,10 +31,11 @@
License: GPLv2+
BuildRequires: blocxx-devel boost-devel gcc-c++ libxcrypt-devel openssl-devel sablot swig
BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files
-BuildRequires: libstorage-devel >= 2.19.13 yast2 >= 2.19.4 yast2-core-devel >= 2.18.1 yast2-devtools
+BuildRequires: libstorage-devel >= 2.19.14 yast2 >= 2.19.4 yast2-core-devel >= 2.18.1 yast2-devtools
BuildRequires: yast2-perl-bindings yast2-testsuite >= 2.19.0
Requires: libstorage = %(echo `rpm -q --queryformat '%{VERSION}' libstorage`)
-Requires: yast2-perl-bindings yast2-core >= 2.18.3 yast2 >= 2.19.4 yast2-libyui >= 2.18.7
+Requires: yast2-perl-bindings perl = %{perl_version}
+Requires: yast2-core >= 2.18.3 yast2 >= 2.19.4 yast2-libyui >= 2.18.7
Requires: yast2-dbus-client
%ifarch s390 s390x
Requires: yast2-s390
@@ -55,7 +56,7 @@
devices during installation and on an installed system.
%prep
-%setup -n yast2-storage-2.19.10
+%setup -n yast2-storage-2.19.11
%build
%{prefix}/bin/y2tool y2autoconf
@@ -149,5 +150,4 @@
%defattr(-,root,root)
%doc %{prefix}/share/doc/packages/yast2-storage/autodocs
%doc %{prefix}/share/doc/packages/yast2-storage/config.xml.description
-
%changelog
++++++ yast2-storage-2.19.10.tar.bz2 -> yast2-storage-2.19.11.tar.bz2 ++++++
++++ 1642 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/VERSION new/yast2-storage-2.19.11/VERSION
--- old/yast2-storage-2.19.10/VERSION 2010-04-01 14:09:01.000000000 +0200
+++ new/yast2-storage-2.19.11/VERSION 2010-04-09 15:35:12.000000000 +0200
@@ -1 +1 @@
-2.19.10
+2.19.11
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/configure.in new/yast2-storage-2.19.11/configure.in
--- old/yast2-storage-2.19.10/configure.in 2010-04-05 16:07:20.000000000 +0200
+++ new/yast2-storage-2.19.11/configure.in 2010-04-16 15:59:20.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-storage, 2.19.10, http://bugs.opensuse.org/, yast2-storage)
+AC_INIT(yast2-storage, 2.19.11, http://bugs.opensuse.org/, yast2-storage)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.19.10"
+VERSION="2.19.11"
RPMNAME="yast2-storage"
MAINTAINER="Arvin Schnell "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/include/custom_part_dialogs.ycp new/yast2-storage-2.19.11/storage/src/include/custom_part_dialogs.ycp
--- old/yast2-storage-2.19.10/storage/src/include/custom_part_dialogs.ycp 2010-03-19 10:23:23.000000000 +0100
+++ new/yast2-storage-2.19.11/storage/src/include/custom_part_dialogs.ycp 2010-04-16 10:34:50.000000000 +0200
@@ -16,7 +16,7 @@
*
*************************************************************
- $Id: custom_part_dialogs.ycp 61391 2010-03-18 17:56:35Z fehr $
+ $Id: custom_part_dialogs.ycp 61723 2010-04-16 08:33:56Z aschnell $
*/
{
@@ -1149,119 +1149,6 @@
}
-/**
- * Scan exiting partitions for fstab files and if one found read the mountpoints
- * from the fstab file and build a new targetMap.
- * Ask the user if he like to use the new or old targetMap
- * (with or without found mountpoints)
- *------------------------------------
- * @parm targetMap all targets
- * @parm installation !!
- * @parm file_systems filesystems definition map
- * @return targetMap new or unmodified targetMap
- *---------------------------------------------------------------------
- */
-define integer FstabAddDialog( list table_input )
- ``{
- y2milestone( "FstabAddDialog start %1", table_input );
- if( table_input == [] || table_input == nil )
- {
- // popup text
- Popup::Message(_("No previous system with mount points was detected."));
- return -1;
- }
-
- // heading text
- term header = `header( _("Device "), _("Mount "));
-
- // help text, richtext format
- string help_text = _("<P><B><BIG>Attention:</BIG></B><BR>YaST2 has scanned your hard disks and found an old Linux system
-with mount points. On the right, see a list with the mount points found. </P>
-")+
- // help text, richtext format
-_("<P>To use these mount points, <BR>press <B>Yes</B>.</P>")+
- // help text, richtext format
-_("<P>To ignore these mount points, <BR> press <B>No</B>.</P>");
-
- UI::OpenDialog(
- `opt(`decorated ),
- `HBox(
- `VBox( `HSpacing(20), `RichText(help_text)),
- `VBox( `VSpacing(1),
- `ReplacePoint( `id(`heading), `Empty() ),
- `HBox(
- `HSpacing(3.0),
- `VSpacing(8),
- `VBox( `VSpacing(1),
- `Table(`id(`table), header, [] )
- ),
- `HSpacing(3.0)
- ),
-
- `VSpacing(1),
- // popup text
- `Heading(_("Would you like to use these mount points
-for your new installation?")),
- `VSpacing(1),
- `ReplacePoint( `id(`bbox), `Empty() )
- ))
- );
-
- symbol userinput = `none;
- integer idx = 0;
- repeat
- {
- // popup text %1 is replaced by a device name (e.g. /dev/hda1)
- string tmp = sformat(
-_("A previous system with the following mount points was detected:
-/etc/fstab found on %1"), table_input[idx,"root"]:"/dev/emil" );
- UI::ReplaceWidget( `id(`heading), `Heading( tmp ) );
-
- UI::ChangeWidget( `id(`table), `Items, table_input[idx,"tbl"]:[] );
-
- term bbox = `HBox( `PushButton( `id(`ok), `opt(`default),
- Label::YesButton() ),
- `PushButton(`id(`cancel), Label::NoButton())
- );
- if( size(table_input)>0 )
- {
- bbox = add( bbox, `HSpacing(5) );
- if( idx>0 )
- {
- bbox = add( bbox,
- `PushButton( `id(`show_p), _("Show &Previous") ));
- }
- if( idx targetMap )
- ``{
- string ret = "";
- boolean mount_success = false;
- y2milestone( "mountVar rdev:%1 mp:%2 var:%3 root:%4", rdev, mp, var, root );
- if( var["size_k"]:0>0 )
- {
- ret = var["device"]:"";
- }
- else
- {
- list<string> ds = maplist( string d, map disk, targetMap, ``(d));
- y2milestone( "mountVar ds:%1", ds );
- ds = filter( string d, ds, ``(targetMap[d,"type"]:`CT_UNKNOWN==`CT_DISK));
- y2milestone( "mountVar ds:%1", ds );
- map rootm = Storage::GetDiskPartition( rdev );
- map rootf = Storage::GetDiskPartition( root["device"]:"" );
- map varf = Storage::GetDiskPartition( var["device"]:"" );
- if( rootf["disk"]:""==varf["disk"]:"" )
- {
- ret = Storage::GetDeviceName( rootm["disk"]:"", varf["nr"]:(any)0 );
- }
- else if( size(ds)==1 )
- {
- ret = Storage::GetDeviceName( ds[0]:"", varf["nr"]:(any)0 );
- }
- else if( size(ds)>1 )
- {
- integer i = 0;
- while( i0 &&
- Storage::Mount( ret, mp ) )
- {
- map d = (map)SCR::Read( .target.stat, mp+"/lib/hardware" );
- y2milestone( "mountVar d:%1", d );
- if( !d["isdir"]:false )
- ret = "";
- Storage::Umount( ret );
- }
- else
- ret = "";
- i = i+1;
- }
- }
- }
- if( size(ret)>0 && !Storage::Mount( ret, mp ))
- ret = "";
- y2milestone( "mountVar ret:%1", ret );
- return( ret );
- }
-
-
- /**
- * Find and read fstab by installation. Scan existing partitions.
- * @parm targetMap all targets
- * @parm search_point mount point where partitions can be mounted
- * @return list list with fstab data found
- */
-define list<list> findExistingFstab( map targetMap, string search_point )
- ``{
- /////////////////////////////////////////////////////////////////
- // foreach partition on each target
- list<list> fstab = [];
- list skip_fs = [ `unknown, `swap, `vfat, `ntfs ];
-
- foreach( string dev, map disk, targetMap,
- ``{
- foreach( map part,
- filter( map p, disk["partitions"]:[],
- ``(!contains( skip_fs,
- p["detected_fs"]:`unknown) )),
- ``{
- /////////////////////////////////////////////////////
- // try to mount
- boolean mount_success = Storage::Mount( part["device"]:"",
- search_point );
-
- if( mount_success &&
- SCR::Read(.target.size, search_point+"/etc/fstab") > 0 )
- {
- list<map> tmp =
- (list<map>)Storage::ReadFstab( search_point+"/etc" );
- y2milestone( "findExistingFstab fstab %1", tmp );
- if( size(tmp)>0 )
- {
- if( find( map p, tmp, ``(p["size_k"]:0==0 ))!=nil )
- {
- string vardev = "";
- map var = find( map p, tmp, ``(p["mount"]:""=="/var"));
- map root = find( map p, tmp, ``(p["mount"]:""=="/"));
- y2milestone( "findExistingFstab var %1", var );
- if( var != nil )
- {
- vardev = mountVar( var, root, part["device"]:"",
- search_point+"/var", targetMap );
- y2milestone( "findExistingFstab vardev %1",
- vardev );
- }
- map dmap = Storage::BuildDiskmap( $[] );
- if( size(dmap)>0 )
- {
- y2milestone( "findExistingFstab dmap %1", dmap );
- y2milestone( "findExistingFstab tmp %1", tmp );
- tmp = maplist( map p, tmp,
- ``{
- if( p["size_k"]:0 == 0 )
- p["device"] = Storage::HdDiskMap( p["device"]:"", dmap );
- return( p );
- });
- y2milestone( "findExistingFstab tmp %1", tmp );
- }
- integer s = size(tmp);
- tmp = filter( map p, tmp, ``(Storage::CanEdit(p,false)));
- if( s!=size(tmp) )
- y2milestone( "findExistingFstab tmp %1", tmp );
- if( size(vardev)>0 )
- Storage::Umount( vardev );
- }
- fstab = add( fstab, tmp );
- }
- }
-
- /////////////////////////////////////////////////////
- // unmount
- if( mount_success )
- Storage::Umount( part["device"]:"" );
- });
- });
- y2milestone( "findExistingFstab count_fstab_found %1", size(fstab) );
- y2milestone( "findExistingFstab fstab %1", fstab );
- return fstab;
- };
-
-
-/**
- * Scan and Read and return fstab.
- * @parm targetMap all targets
- * @parm file_systems filesystem map
- * @return list list with fstab
- */
-define list<list> scanAndReadExistingFstab( map targetMap )
- ``{
- string search_point = "/mnt";
-
- /////////////////////////////////////////////////////////////////
- // make search dir
-
- if( SCR::Execute(.target.bash, "/usr/bin/test -d " + search_point ) != 0)
- {
- SCR::Execute(.target.mkdir, search_point );
- }
-
- list<list> fstab = findExistingFstab( targetMap, search_point );
-
- return fstab;
- };
-
/**
* Check lvm mount points
@@ -901,81 +741,6 @@
return( new );
};
-/**
- * Merge readed list fstab with targetMap
- * @parm targetMap all targets
- * @parm fstab readed fstab list
- * @return return ( [ targetMap, table_input ]
- *
- */
-list AddFstabToData(map targetMap, list<map> fstab)
-{
- if( fstab == nil )
- return [ targetMap ];
-
- y2milestone( "AddFstabToData fstab:%1", fstab );
-
- map new_targetMap = targetMap;
- map table_input = $["tbl":[]];
-
- foreach( string dev, map disk, targetMap,
- ``{
- list new_partitions = [];
- map target = disk;
- foreach( map partition, disk["partitions"]:[],
- ``{
- map new_partition = partition;
-
- foreach( map fstab_entry, fstab,
- ``{
- string dev_fstab = fstab_entry["device"]:"";
- string mount_fstab = fstab_entry["mount"]:"";
-
- if (dev_fstab == partition["device"]:"" &&
- !Storage::IsInstallationSource(partition["device"]:""))
- {
- new_partition["mount"] = mount_fstab;
- if( !isempty(fstab_entry["fstopt"]:"") &&
- fstab_entry["fstopt"]:"" != "default" )
- {
- new_partition["fstopt"] = fstab_entry["fstopt"]:"";
- }
- if( fstab_entry["mountby"]:`device != `device )
- new_partition["mountby"] = fstab_entry["mountby"]:`device;
- if( fstab_entry["enc_type"]:`none != `none )
- new_partition["enc_type"] = fstab_entry["enc_type"]:`none;
-
- /////////////////////////////////////////////
- // entries for table
- term a = `item(`id(dev_fstab));
- a = add( a, dev_fstab );
- a = add( a, mount_fstab );
- if( mount_fstab=="/" )
- {
- table_input["root"] = dev_fstab;
- }
- table_input["tbl"] = add( table_input["tbl"]:[], a );
- }
- });
- new_partitions = add( new_partitions, new_partition);
- });
- target["partitions"] = new_partitions;
- new_targetMap[dev] = target;
- });
-
- y2milestone( "AddFstabToData table_input:%1", table_input );
- y2milestone( "AddFstabToData tbl:%1", table_input["tbl"]:[] );
-
- if( size( table_input["tbl"]:[] )>1 )
- {
- table_input["tbl"] = sort( term a, term b, table_input["tbl"]:[],
- ``(a[2]:""
+ * Johannes Buchhold
+ * Arvin Schnell
+ *
+ * This file must only be included in other Expert Partitioner files ("ep-*.ycp").
+ */
+{
+ textdomain "storage";
+
+
+ string MountVar(map var, map root, string rdev, string mp, map target_map)
+ {
+ string ret = "";
+ boolean mount_success = false;
+ y2milestone("MountVar rdev:%1 mp:%2 var:%3 root:%4", rdev, mp, var, root);
+ if( var["size_k"]:0>0 )
+ {
+ ret = var["device"]:"";
+ }
+ else
+ {
+ list<string> ds = maplist( string d, map disk, target_map, ``(d));
+ y2milestone("MountVar ds:%1", ds);
+ ds = filter( string d, ds, ``(target_map[d,"type"]:`CT_UNKNOWN==`CT_DISK));
+ y2milestone("MountVar ds:%1", ds);
+ map rootm = Storage::GetDiskPartition( rdev );
+ map rootf = Storage::GetDiskPartition( root["device"]:"" );
+ map varf = Storage::GetDiskPartition( var["device"]:"" );
+ if( rootf["disk"]:""==varf["disk"]:"" )
+ {
+ ret = Storage::GetDeviceName( rootm["disk"]:"", varf["nr"]:(any)0 );
+ }
+ else if( size(ds)==1 )
+ {
+ ret = Storage::GetDeviceName( ds[0]:"", varf["nr"]:(any)0 );
+ }
+ else if( size(ds)>1 )
+ {
+ integer i = 0;
+ while( i target_map, string search_point)
+ {
+ list<list> fstabs = [];
+ list<symbol> skip_fs = [ `none, `unknown, `swap, `vfat, `ntfs ];
+
+ foreach( string disk_device, map disk, target_map, {
+
+ list<map> partitions = filter(map part, disk["partitions"]:[], {
+ return !contains(skip_fs, part["detected_fs"]:`unknown);
+ });
+
+ foreach(map part, partitions, {
+
+ string part_device = part["device"]:"";
+
+ // try to mount
+ boolean mount_success = Storage::Mount(part_device, search_point);
+
+ if( mount_success &&
+ SCR::Read(.target.size, search_point+"/etc/fstab") > 0 )
+ {
+ list<map> fstab = Storage::ReadFstab( search_point+"/etc" );
+ y2milestone("FindExistingFstabs fstab:%1", fstab);
+ if (!isempty(fstab))
+ {
+ if( find( map p, fstab, ``(p["size_k"]:0==0 ))!=nil )
+ {
+ string vardev = "";
+ map var = find( map p, fstab, ``(p["mount"]:""=="/var"));
+ map root = find( map p, fstab, ``(p["mount"]:""=="/"));
+ y2milestone("FindExistingFstabs var:%1", var);
+ if( var != nil )
+ {
+ vardev = MountVar( var, root, part_device,
+ search_point+"/var", target_map );
+ y2milestone("FindExistingFstabs vardev:%1", vardev);
+ }
+ map dmap = Storage::BuildDiskmap( $[] );
+ if (!isempty(dmap))
+ {
+ y2milestone("FindExistingFstabs dmap:%1", dmap);
+ y2milestone("FindExistingFstabs fstab:%1", fstab);
+ fstab = maplist( map p, fstab, {
+ if( p["size_k"]:0 == 0 )
+ p["device"] = Storage::HdDiskMap( p["device"]:"", dmap );
+ return( p );
+ });
+ y2milestone("FindExistingFstabs fstab:%1", fstab);
+ }
+ integer s = size(fstab);
+ fstab = filter( map p, fstab, ``(Storage::CanEdit(p,false)));
+ if (s != size(fstab))
+ y2milestone("FindExistingFstabs fstab:%1", fstab);
+ if (!isempty(vardev))
+ Storage::Umount( vardev );
+ }
+
+ if (!isempty(fstab))
+ fstabs = add(fstabs, fstab);
+ }
+ }
+
+ // unmount
+ if( mount_success )
+ Storage::Umount(part_device);
+ });
+ });
+ y2milestone("FindExistingFstabs size(fstabs):%1", size(fstabs));
+ y2milestone("FindExistingFstabs fstabs:%1", fstabs);
+ return fstabs;
+ }
+
+
+ /**
+ * Scan and Read and return fstab.
+ * @parm target_map all targets
+ * @parm file_systems filesystem map
+ * @return list list with fstab
+ */
+ list<list> ScanAndReadExistingFstabs(map target_map)
+ {
+ string search_point = Directory::tmpdir + "/tmp-mp";
+
+ if (!((map) SCR::Read(.target.stat, search_point))["isdir"]:false)
+ SCR::Execute(.target.mkdir, search_point);
+
+ list<list> fstabs = FindExistingFstabs(target_map, search_point);
+
+ return fstabs;
+ }
+
+
+ /**
+ * Merge fstab with target_map.
+ */
+ map AddFstabToTargetMap(map target_map, list<map> fstab, boolean format_sys)
+ {
+ y2milestone("AddFstabToTargetMap fstab:%1", fstab);
+
+ string root = "";
+
+ map new_target_map = target_map;
+
+ foreach( string disk_device, map disk, target_map, {
+
+ list new_partitions = [];
+
+ foreach( map partition, disk["partitions"]:[], {
+
+ map new_partition = partition;
+
+ string part_device = partition["device"]:"";
+
+ foreach( map fstab_entry, fstab, {
+
+ string dev_fstab = fstab_entry["device"]:"";
+ string mount_fstab = fstab_entry["mount"]:"";
+
+ if (dev_fstab == part_device && !Storage::IsInstallationSource(part_device))
+ {
+ new_partition["mount"] = mount_fstab;
+ if (format_sys && FileSystems::IsSystemMp(mount_fstab, false))
+ new_partition["format"] = true;
+ if( !isempty(fstab_entry["fstopt"]:"") &&
+ fstab_entry["fstopt"]:"" != "default" )
+ {
+ new_partition["fstopt"] = fstab_entry["fstopt"]:"";
+ }
+ if( fstab_entry["mountby"]:`device != `device )
+ new_partition["mountby"] = fstab_entry["mountby"]:`device;
+ if( fstab_entry["enc_type"]:`none != `none )
+ new_partition["enc_type"] = fstab_entry["enc_type"]:`none;
+
+ if (mount_fstab == "/")
+ root = dev_fstab;
+ }
+ });
+ new_partitions = add( new_partitions, new_partition);
+ });
+ disk["partitions"] = new_partitions;
+ new_target_map[disk_device] = disk;
+ });
+
+ map ret = $[
+ "root" : root,
+ "new_target_map" : new_target_map
+ ];
+
+ y2milestone("AddFstabToTargetMap ret:%1", ret);
+ return ret;
+ }
+
+
+ /**
+ * Scan exiting partitions for fstab files and if one found read the mountpoints
+ * from the fstab file and build a new target_map.
+ * Ask the user if he like to use the new or old target_map
+ * (with or without found mountpoints)
+ */
+ integer FstabAddDialog(map target_map, list<list> fstabs, boolean& format_sys)
+ {
+ y2milestone("FstabAddDialog target_map:%1", target_map);
+ y2milestone("FstabAddDialog fstabs:%1", fstabs);
+
+ if (isempty(fstabs))
+ {
+ // popup text
+ Popup::Message(_("No previous system with mount points was detected."));
+ return -1;
+ }
+
+ list<symbol> fields = StorageSettings::FilterTable([ `device, `size, `type, `fs_type,
+ `label, `mount_point ]);
+
+ term table_header = StorageFields::TableHeader(fields);
+
+ // help text, richtext format
+ string help_text = _("<P><B><BIG>Attention:</BIG></B><BR>YaST2 has scanned your hard disks and found an old Linux system
+with mount points. On the right, see a list with the mount points found. </P>
+")+
+ // help text, richtext format
+_("<P>To use these mount points, <BR>press <B>Yes</B>.</P>")+
+ // help text, richtext format
+_("<P>To ignore these mount points, <BR> press <B>No</B>.</P>");
+
+ term navigate_buttons = `Empty();
+ if (size(fstabs) > 1)
+ {
+ navigate_buttons = `HBox(
+ `PushButton(`id(`show_prev), _("Show &Previous")),
+ `PushButton(`id(`show_next), _("Show &Next"))
+ );
+ }
+
+ UI::OpenDialog(
+ `opt(`decorated),
+ `VBox( `VSpacing(0.45),
+ `ReplacePoint( `id(`heading), `Empty() ),
+ `MarginBox(2, 1,
+ `VBox(
+ `MinSize(60, 8, `Table(`id(`table), `opt(`keepSorting), table_header, [])),
+ `VSpacing(0.45),
+ navigate_buttons,
+ `VSpacing(0.45),
+ `Left(`CheckBox(`id(`format_sys), _("Format system volumes"), true))
+ )
+ ),
+ // popup text
+ `Heading(_("Would you like to use these mount points
+for your new installation?")),
+ `VSpacing(0.45),
+ `ButtonBox(
+ `PushButton(`id(`help), `opt(`helpButton), Label::HelpButton()),
+ `PushButton(`id(`ok), `opt(`default), Label::YesButton()),
+ `PushButton(`id(`cancel), Label::NoButton())
+ )
+ )
+ );
+
+ UI::ChangeWidget(`help, `HelpText, help_text);
+
+ symbol userinput = `none;
+ integer idx = 0;
+
+ repeat
+ {
+ list<map> fstab = (list<map>) fstabs[idx]:[];
+
+ map tmp = AddFstabToTargetMap(target_map, fstab, format_sys);
+
+ // popup text %1 is replaced by a device name (e.g. /dev/hda1)
+ string str = sformat(
+_("A previous system with the following mount points was detected:
+/etc/fstab found on %1"), tmp["root"]:"error");
+ UI::ReplaceWidget( `id(`heading), `Heading( str ) );
+
+ list<term> table_contents = StorageFields::TableContents(fields, tmp["new_target_map"]:$[],
+ StorageFields::PredicateMountpoint);
+ UI::ChangeWidget(`id(`table), `Items, table_contents);
+ UI::ChangeWidget(`id(`table), `CurrentItem, nil);
+
+ if (size(fstabs) > 1)
+ {
+ UI::ChangeWidget(`id(`show_prev), `Enabled, idx > 0);
+ UI::ChangeWidget(`id(`show_next), `Enabled, idx < size(fstabs) - 1);
+ }
+
+ userinput = (symbol) UI::UserInput();
+ y2milestone("userinput %1", userinput);
+
+ switch (userinput)
+ {
+ case `show_next:
+ idx = idx + 1;
+ break;
+
+ case `show_prev:
+ idx = idx - 1;
+ break;
+ }
+ y2milestone( "idx %1", idx );
+ }
+ until( userinput == `ok || userinput == `cancel );
+
+ format_sys = (boolean) UI::QueryWidget(`id(`format_sys), `Value);
+
+ UI::CloseDialog();
+
+ integer ret = userinput == `ok ? idx : -1;
+ y2milestone("FstabAddDialog ret:%1", ret);
+ return ret;
+ }
+
+
+ void ImportMountPoints()
+ {
+ Storage::CreateTargetBackup("import");
+ Storage::ResetOndiskTarget();
+
+ map target_map = Storage::GetOndiskTarget();
+
+ list<list> fstabs = ScanAndReadExistingFstabs(target_map);
+ y2milestone("ImportMountPoints fstabs:%1", fstabs);
+
+ boolean format_sys = true;
+ integer idx = FstabAddDialog(target_map, fstabs, format_sys);
+ if( idx>=0 )
+ {
+ y2milestone("ImportMountPoints idx:%1", idx);
+ list<map> fstab = (list<map>) fstabs[idx]:[];
+
+ map tmp = AddFstabToTargetMap(target_map, fstab, format_sys);
+
+ map new_target_map = tmp["new_target_map"]:$[];
+
+ foreach(string d, map disk, new_target_map, {
+ foreach(map p, disk["partitions"]:[], {
+ if (!isempty(p["mount"]:"") && p["enc_type"]:`none!=`none &&
+ !p["tmpcrypt"]:false)
+ {
+ string pwd = DlgCreateCryptFs( p["device"]:"", 1, false, false );
+ if( pwd != nil && !isempty(pwd) )
+ Storage::SetCryptPwd( p["device"]:"", pwd );
+ }
+ });
+ });
+
+ Storage::SetTargetMap(new_target_map);
+ }
+ else
+ {
+ Storage::RestoreTargetBackup("import");
+ }
+
+ Storage::DisposeTargetBackup("import");
+ }
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/include/ep-lib.ycp new/yast2-storage-2.19.11/storage/src/include/ep-lib.ycp
--- old/yast2-storage-2.19.10/storage/src/include/ep-lib.ycp 2010-03-29 16:12:39.000000000 +0200
+++ new/yast2-storage-2.19.11/storage/src/include/ep-lib.ycp 2010-04-16 10:34:50.000000000 +0200
@@ -271,47 +271,6 @@
}
- void ImportMountPoints()
- {
- Storage::CreateTargetBackup("import");
- Storage::ResetOndiskTarget();
-
- map target_map = Storage::GetOndiskTarget();
- list<list> fstab = scanAndReadExistingFstab(target_map);
- y2milestone( "adapt_mp fstab %1", fstab );
- list ti = maplist( list e, fstab, ``(AddFstabToData( target_map, (list<map>)e)[1]:$[]));
- y2milestone( "adapt_mp ti %1", ti );
-
- integer idx = FstabAddDialog( ti );
- if( idx>=0 )
- {
- y2milestone( "adapt_mp use fstab idx %1", idx );
- ti = AddFstabToData( target_map, (list<map>)fstab[idx]:[] );
- foreach( string d, map disk, ti[0]:$[],
- ``{
- foreach( map p, disk["partitions"]:[],
- ``{
- if( size(p["mount"]:"")>0 && p["enc_type"]:`none!=`none &&
- !p["tmpcrypt"]:false )
- {
- string pwd = DlgCreateCryptFs( p["device"]:"", 1, false, false );
- if( pwd != nil && size(pwd)>0 )
- Storage::SetCryptPwd( p["device"]:"", pwd );
- }
- });
- });
-
- Storage::SetTargetMap(ti[0]:$[]);
- }
- else
- {
- Storage::RestoreTargetBackup("import");
- }
-
- Storage::DisposeTargetBackup("import");
- }
-
-
term DiskBarGraph(string device)
{
if (!UI::HasSpecialWidget(`BarGraph))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/include/ep-main.ycp new/yast2-storage-2.19.11/storage/src/include/ep-main.ycp
--- old/yast2-storage-2.19.10/storage/src/include/ep-main.ycp 2010-01-25 11:01:35.000000000 +0100
+++ new/yast2-storage-2.19.11/storage/src/include/ep-main.ycp 2010-04-16 10:34:50.000000000 +0200
@@ -63,6 +63,7 @@
include "partitioning/ep-lib.ycp";
include "partitioning/ep-dialogs.ycp";
+ include "partitioning/ep-import.ycp";
include "partitioning/ep-all.ycp";
include "partitioning/ep-hd.ycp";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/include/ep-raid.ycp new/yast2-storage-2.19.11/storage/src/include/ep-raid.ycp
--- old/yast2-storage-2.19.10/storage/src/include/ep-raid.ycp 2009-07-21 16:37:06.000000000 +0200
+++ new/yast2-storage-2.19.11/storage/src/include/ep-raid.ycp 2010-04-08 15:40:19.000000000 +0200
@@ -134,7 +134,7 @@
map target_map = Storage::GetTargetMap();
- list<symbol> fields = StorageSettings::FilterOverview([ `heading_device, `device, `size, `encrypted,
+ list<symbol> fields = StorageSettings::FilterOverview([ `heading_device, `device, `size, `encrypted, `udev_id,
`used_by, `heading_md, `raid_type, `chunk_size,
`parity_algorithm, `heading_filesystem,
`fs_type, `mount_point, `mount_by, `uuid,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/inst_prepdisk.ycp new/yast2-storage-2.19.11/storage/src/inst_prepdisk.ycp
--- old/yast2-storage-2.19.10/storage/src/inst_prepdisk.ycp 2010-02-09 13:03:26.000000000 +0100
+++ new/yast2-storage-2.19.11/storage/src/inst_prepdisk.ycp 2010-04-09 12:45:32.000000000 +0200
@@ -96,7 +96,6 @@
{
Storage::FinishInstall();
}
- Storage::UpdateTargetMap();
// close progress on running system
if( Mode::normal() )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/modules/Storage.ycp new/yast2-storage-2.19.11/storage/src/modules/Storage.ycp
--- old/yast2-storage-2.19.10/storage/src/modules/Storage.ycp 2010-03-29 16:12:39.000000000 +0200
+++ new/yast2-storage-2.19.11/storage/src/modules/Storage.ycp 2010-04-16 14:05:16.000000000 +0200
@@ -19,7 +19,7 @@
* wurde versucht "intelligent" zu gestallten und ist im einzelen bei den
* entspechenden Funktionen n�her erkl�rt.
*
- * $Id: Storage.ycp 61499 2010-03-25 17:26:38Z fehr $
+ * $Id: Storage.ycp 61729 2010-04-16 12:05:16Z aschnell $
*/
{
module "Storage";
@@ -1191,16 +1191,6 @@
d["dasdfmt"] = true;
else if( haskey( d, "dasdfmt" ))
d = remove( d, "dasdfmt" );
- string tmp = LibStorage::DiskInfo::swig_udevId_get(dinfo);
- if( size(tmp)>0 )
- d["udev_id"] = splitstring( tmp, " " );
- else if( haskey( d, "udev_id" ))
- d = remove( d, "udev_id" );
- tmp = LibStorage::DiskInfo::swig_udevPath_get(dinfo);
- if( size(tmp)>0 )
- d["udev_path"] = tmp;
- else if( haskey( d, "udev_path" ))
- d = remove( d, "udev_path" );
y2milestone( "diskMap ret:%1", d );
return( d );
}
@@ -1309,6 +1299,14 @@
tmp = LibStorage::VolumeInfo::swig_loop_get(vinfo);
if( size(tmp)>0 )
p["loop"] = tmp;
+
+ tmp = LibStorage::VolumeInfo::swig_udevPath_get(vinfo);
+ if (!isempty(tmp))
+ p["udev_path"] = tmp;
+ tmp = LibStorage::VolumeInfo::swig_udevId_get(vinfo);
+ if (!isempty(tmp))
+ p["udev_id"] = splitstring(tmp, " ");
+
return( p );
}
@@ -1324,12 +1322,6 @@
boolean boot = LibStorage::PartitionAddInfo::swig_boot_get(info);
if( boot )
p["boot"] = true;
- string tmp = LibStorage::PartitionAddInfo::swig_udevId_get(info);
- if( size(tmp)>0 )
- p["udev_id"] = splitstring( tmp, " " );
- tmp = LibStorage::PartitionAddInfo::swig_udevPath_get(info);
- if( size(tmp)>0 )
- p["udev_path"] = tmp;
y2milestone( "partAddMap ret:%1", p );
return( p );
}
@@ -1400,12 +1392,6 @@
boolean boot = LibStorage::PartitionInfo::swig_boot_get(info);
if( boot )
p["boot"] = true;
- tmp = LibStorage::PartitionInfo::swig_udevId_get(info);
- if( size(tmp)>0 )
- p["udev_id"] = splitstring( tmp, " " );
- tmp = LibStorage::PartitionInfo::swig_udevPath_get(info);
- if( size(tmp)>0 )
- p["udev_path"] = tmp;
c["partitions"] = add( c["partitions"]:[], p );
});
}
@@ -1680,6 +1666,14 @@
boolean b = LibStorage::ContainerInfo::swig_readonly_get(info);
if( b )
c["readonly"] = true;
+
+ string tmp = LibStorage::ContainerInfo::swig_udevPath_get(info);
+ if (!isempty(tmp))
+ c["udev_path"] = tmp;
+ tmp = LibStorage::ContainerInfo::swig_udevId_get(info);
+ if (!isempty(tmp))
+ c["udev_id"] = splitstring(tmp, " ");
+
ret = add( ret, c );
});
y2milestone( "getContainers ret:%1", ret );
@@ -1698,7 +1692,7 @@
*
* @see GetTargetMap()
*/
-global void UpdateTargetMap()
+void UpdateTargetMap()
{
conts = getContainers();
list<string> rem_keys = [];
@@ -3953,6 +3947,7 @@
integer ret = LibStorage::StorageInterface::commit( sint );
if( ret<0 )
y2error( "CommitChanges sint ret:%1", ret );
+ Storage::UpdateTargetMap();
return( ret );
}
@@ -4226,17 +4221,16 @@
* @param string directory
* @return list fstab?
*/
-global list ReadFstab( string dir )
+global list<map> ReadFstab(string dir)
{
- list ret = [];
+ list<map> ret = [];
list<any> vinfos = [];
boolean r = LibStorage::StorageInterface::readFstab( sint, dir, vinfos );
if( !r )
y2error( "ReadFstab sint dir %1 ret %2", dir, r );
else
{
- foreach( any info, vinfos,
- ``{
+ foreach( any info, vinfos, {
map p = $[];
p = volumeMap( info, p );
ret = add( ret, p );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.19.10/storage/src/modules/StorageFields.ycp new/yast2-storage-2.19.11/storage/src/modules/StorageFields.ycp
--- old/yast2-storage-2.19.10/storage/src/modules/StorageFields.ycp 2010-03-20 14:20:21.000000000 +0100
+++ new/yast2-storage-2.19.11/storage/src/modules/StorageFields.ycp 2010-04-16 13:50:59.000000000 +0200
@@ -1076,6 +1076,28 @@
/**
+ * Predicate function for Table and TableContents.
+ */
+ global symbol PredicateMountpoint(map disk, map partition)
+ {
+ if (partition == nil)
+ {
+ if (!isempty(disk["mount"]:""))
+ return `showandfollow;
+ else
+ return `follow;
+ }
+ else
+ {
+ if (!isempty(partition["mount"]:""))
+ return `show;
+ else
+ return `ignore;
+ }
+ }
+
+
+ /**
* The predicate function determines whether the disk/partition is
* included. The predicate function takes two arguments, disk and
* partition. For disks predicate is called with the partitions set to
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org