22514272 Move GParted from desktop to userland
authorjulian.yuen@oracle.com <julian.yuen@oracle.com>
Mon, 25 Jan 2016 15:32:12 -0800
changeset 5330 c36e3195e3e9
parent 5328 34fe0d5ec7b7
child 5331 9c955076ffe3
22514272 Move GParted from desktop to userland
components/gparted/Makefile
components/gparted/gparted.p5m
components/gparted/patches/1.Makefile_am.patch
components/gparted/patches/gparted-01-solaris.patch
components/gparted/patches/gparted-02-bug-20239134.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gparted/Makefile	Mon Jan 25 15:32:12 2016 -0800
@@ -0,0 +1,88 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		gparted
+COMPONENT_VERSION=	0.4.5
+COMPONENT_PROJECT_URL=	http://gparted.sourceforge.net/
+COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.bz2
+COMPONENT_ARCHIVE_HASH=	\
+    sha256:a0a102ee51c1d70fa1c786c77a613111179ce81efccb637bd04aef525199b93f
+COMPONENT_ARCHIVE_URL=	http://prdownloads.sourceforge.net/gparted/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	utility/gparted
+
+TPNO=			7497
+
+# we're i386-only
+ifeq ($(MACH), sparc)
+PUBLISH_STAMP=
+endif
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv)
+
+CC += $(CC_BITS)
+CXX += $(CC_BITS)
+
+# needed to find xgettext
+PATH=/usr/gnu/bin:/usr/bin
+CONFIGURE_OPTIONS +=    CFLAGS="$(CFLAGS)"
+CONFIGURE_OPTIONS +=	CXX="$(CXX) -norunpath"
+
+ASLR_MODE =	$(ASLR_ENABLE)
+
+# common targets, we're i386-only
+
+build_sparc:
+	@echo "Not available."
+
+configure:	$(CONFIGURE_32)
+
+build_i386:	$(BUILD_32)
+
+build:		build_$(MACH)
+
+install:	$(INSTALL_32) 
+
+test:           $(NO_TESTS)
+
+system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+
+REQUIRED_PACKAGES += library/c++/glibmm
+REQUIRED_PACKAGES += library/c++/sigcpp
+REQUIRED_PACKAGES += library/desktop/c++/cairomm
+REQUIRED_PACKAGES += library/desktop/c++/gtkmm
+REQUIRED_PACKAGES += library/desktop/c++/pangomm
+REQUIRED_PACKAGES += library/desktop/gtk2
+REQUIRED_PACKAGES += library/glib2
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/c++-runtime
+REQUIRED_PACKAGES += system/storage/parted
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gparted/gparted.p5m	Mon Jan 25 15:32:12 2016 -0800
@@ -0,0 +1,114 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+<transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
+set name=pkg.fmri \
+    value=pkg:/desktop/administration/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="GNome GParted Editor tool"
+set name=com.oracle.info.description value="GNOME Partition Editor"
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:System/Administration and Configuration"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=LSARC/2009/651
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+file path=usr/sbin/gparted
+file path=usr/sbin/gpartedbin
+file path=usr/share/applications/gparted.desktop
+file path=usr/share/gnome/help/gparted/C/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/C/gparted.xml
+file path=usr/share/gnome/help/gparted/de/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/de/gparted.xml
+file path=usr/share/gnome/help/gparted/es/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/es/gparted.xml
+file path=usr/share/gnome/help/gparted/it/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/it/gparted.xml
+file path=usr/share/gnome/help/gparted/pt_BR/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/pt_BR/gparted.xml
+file path=usr/share/gnome/help/gparted/sv/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/sv/gparted.xml
+file path=usr/share/gnome/help/gparted/th/figures/gparted_window.png
+file path=usr/share/gnome/help/gparted/th/gparted.xml
+file path=usr/share/icons/hicolor/16x16/apps/gparted.png
+file path=usr/share/icons/hicolor/22x22/apps/gparted.png
+file path=usr/share/icons/hicolor/24x24/apps/gparted.png
+file path=usr/share/icons/hicolor/32x32/apps/gparted.png
+file path=usr/share/icons/hicolor/48x48/apps/gparted.png
+file path=usr/share/icons/hicolor/scalable/apps/gparted.svg
+file path=usr/share/locale/ar/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/bg/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/ca/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/cs/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/da/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/de/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/dz/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/el/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/en_CA/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/en_GB/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/es/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/eu/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/fi/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/fr/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/gl/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/gu/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/he/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/hu/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/it/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/ja/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/kk/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/ko/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/lt/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/lv/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/mk/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/nb/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/ne/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/nl/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/oc/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/pa/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/pl/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/pt/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/pt_BR/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/ru/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/rw/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/si/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/sk/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/sl/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/sv/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/th/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/tr/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/uk/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/vi/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/zh_CN/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/zh_HK/LC_MESSAGES/gparted.mo
+file path=usr/share/locale/zh_TW/LC_MESSAGES/gparted.mo
+file path=usr/share/man/man8/gparted.8
+file path=usr/share/omf/gparted/gparted-C.omf
+file path=usr/share/omf/gparted/gparted-de.omf
+file path=usr/share/omf/gparted/gparted-es.omf
+file path=usr/share/omf/gparted/gparted-it.omf
+file path=usr/share/omf/gparted/gparted-pt_BR.omf
+file path=usr/share/omf/gparted/gparted-sv.omf
+file path=usr/share/omf/gparted/gparted-th.omf
+license COPYING license=GPLv2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gparted/patches/1.Makefile_am.patch	Mon Jan 25 15:32:12 2016 -0800
@@ -0,0 +1,16 @@
+# Written internally- removing -Wall flags because Solaris Studio does not know of them
+# Since this is for our build, probably not something we can get upstream.
+
+--- ORIGINAL/src/Makefile.am	2016-01-12 08:43:52.928382761 -0800
++++ gparted-0.4.5/src/Makefile.am	2016-01-12 08:46:21.389297831 -0800
[email protected]@ -3,10 +3,6 @@
+ 	-DGPARTED_DATADIR=\""$(datadir)"\"			\
+ 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
+ 
+-AM_CFLAGS = -Wall	
+-
+-AM_CXXFLAGS = -Wall	
+-
+ sbin_PROGRAMS = gpartedbin
+ 
+ gpartedbin_SOURCES = \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gparted/patches/gparted-01-solaris.patch	Mon Jan 25 15:32:12 2016 -0800
@@ -0,0 +1,394 @@
+# Copied over from the desktop consolidation, not for upstream
+
+diff -ru /home/ml40262/gparted/gparted-0.4.5/compose/ucompose.hpp ./compose/ucompose.hpp
+--- /home/ml40262/gparted/gparted-0.4.5/compose/ucompose.hpp	2009-04-18 13:38:05.000000000 -0700
++++ ./compose/ucompose.hpp	2009-10-16 15:33:54.265337000 -0700
[email protected]@ -127,7 +127,11 @@
+    
+     return Glib::convert(std::string(reinterpret_cast<const char *>(str.data()),
+ 				     str.size() * sizeof(wchar_t)),
++#ifdef __sun
++			 "UTF-8", "UCS-4LE");
++#else
+ 			 "UTF-8", "WCHAR_T");
++#endif
+   }
+ 
+   // specialisations for the common string types
+diff -ru /home/ml40262/gparted/gparted-0.4.5/configure ./configure
+--- /home/ml40262/gparted/gparted-0.4.5/configure	2009-05-08 09:05:43.000000000 -0700
++++ ./configure	2009-10-16 15:33:54.304150000 -0700
[email protected]@ -22031,6 +22031,10 @@
+ #include <stdio.h>
+ #include <parted/parted.h>
+ 
++#ifdef __sun
++char *program_name = "test";
++#endif
++
+ int main ()
+ {
+ 	int min_major ;
+diff -ru /home/ml40262/gparted/gparted-0.4.5/configure.in ./configure.in
+--- /home/ml40262/gparted/gparted-0.4.5/configure.in	2009-05-08 08:50:41.000000000 -0700
++++ ./configure.in	2009-10-16 15:33:54.313587000 -0700
[email protected]@ -49,6 +49,10 @@
+ #include <stdio.h>
+ #include <parted/parted.h>
+ 
++#ifdef __sun
++char *program_name = "test";
++#endif
++
+ int main ()
+ {
+ 	int min_major ;
+diff -ru /home/ml40262/gparted/gparted-0.4.5/gparted.desktop.in.in ./gparted.desktop.in.in
+--- /home/ml40262/gparted/gparted-0.4.5/gparted.desktop.in.in	2009-05-08 09:05:53.000000000 -0700
++++ ./gparted.desktop.in.in	2009-10-16 15:36:22.402991000 -0700
[email protected]@ -1,7 +1,7 @@
+ [Desktop Entry]
+ _Name=GParted Partition Editor
+ _Comment=Create, reorganize, and delete partitions
[email protected]@ @[email protected]/gparted %f
++Exec=/usr/sbin/gparted %f
+ Icon=gparted
+ Terminal=false
+ Type=Application
+diff -ru /home/ml40262/gparted/gparted-0.4.5/include/Utils.h ./include/Utils.h
+--- /home/ml40262/gparted/gparted-0.4.5/include/Utils.h	2009-04-19 11:05:13.000000000 -0700
++++ ./include/Utils.h	2009-10-21 13:40:34.747259000 -0700
[email protected]@ -71,7 +71,8 @@
+ 
+ 	FS_BTRFS	= 20,  /* FIXME: Move this higher up list when full support added */
+ 	FS_LVM2		= 21,
+-	FS_LUKS		= 22
++	FS_LUKS		= 22,
++	FS_SOLARIS	= 23
+ } ;
+ 
+ enum SIZE_UNIT
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/GParted_Core.cc ./src/GParted_Core.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/GParted_Core.cc	2009-05-02 09:59:49.000000000 -0700
++++ ./src/GParted_Core.cc	2009-10-21 15:10:07.784757000 -0700
[email protected]@ -847,7 +847,11 @@
+ 	strncpy(magic, buf+0, 6) ;  magic[6] = '\0' ; //set and terminate string
+ 	ped_device_close( lp_device );
+ 
++#ifdef __sun
++	if (strncmp("LUKS\xBA\xBE", magic, 6) == 0)
++#else
+ 	if ( Glib::ustring( magic ) == "LUKS\xBA\xBE" )
++#endif
+ 	{
+ 		temp = _( "Linux Unified Key Setup encryption is not yet supported." ) ;
+ 		temp += "\n" ;
[email protected]@ -900,6 +904,8 @@
+ 			return GParted::FS_HFSPLUS ;
+ 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ufs" )
+ 			return GParted::FS_UFS ;
++		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "solaris" )
++			return GParted::FS_SOLARIS ;
+ 	}
+ 	
+ 	
[email protected]@ -911,7 +917,16 @@
+ 	ped_geometry_read( & lp_partition ->geom, buf, 128, 1 ) ;
+ 	ped_device_close( lp_device );
+ 	
++#ifdef __sun
++	/*
++	 * On Solaris, the Glib::ustring causes this message:
++	 * GLib-CRITICAL **: file gconvert.c:
++	 *    line 734: assertion `str != NULL' failed
++	 */
++	if (strncmp("ReIsEr4", buf, 7) == 0)
++#else
+ 	if ( Glib::ustring( buf ) == "ReIsEr4" )
++#endif
+ 		return GParted::FS_REISER4 ;
+ 
+ 	//lvm2
[email protected]@ -925,8 +940,13 @@
+ 	strncpy(magic2, buf+24, 4) ; magic2[4] = '\0' ; //set and terminate string
+ 	ped_device_close( lp_device );
+ 
++#ifdef __sun
++	if (strncmp("LABELONE", magic1, 8) == 0
++	    && strncmp("LVM2", magic2, 4) == 0)
++#else
+ 	if (    Glib::ustring( magic1 ) == "LABELONE"
+ 		 && Glib::ustring( magic2 ) == "LVM2" )
++#endif
+ 	{
+ 		temp = _( "Logical Volume Management is not yet supported." ) ;
+ 		temp += "\n" ;
[email protected]@ -949,7 +969,11 @@
+ 	strncpy(magic, buf_btrfs+64, BTRFS_SIGNATURE .size()) ;  magic[BTRFS_SIGNATURE .size()] = '\0' ; //set and terminate string
+ 	ped_device_close( lp_device ) ;
+ 
++#ifdef __sun
++	if (strncmp("_BHRfS_M", magic, 8) == 0)
++#else
+ 	if ( magic == BTRFS_SIGNATURE )
++#endif
+ 	{
+ 		temp = _( "BTRFS is not yet supported." ) ;
+ 		temp += "\n" ;
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/Utils.cc ./src/Utils.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/Utils.cc	2009-04-19 11:05:13.000000000 -0700
++++ ./src/Utils.cc	2009-10-21 14:20:52.259713000 -0700
[email protected]@ -19,6 +19,7 @@
+ 
+ #include <sstream>
+ #include <iomanip>
++#include <unistd.h>
+ #include <regex.h>
+ #include <locale.h>
+ 
[email protected]@ -87,6 +88,7 @@
+ 		case FS_HFS			: return "#E0B6AF" ;	//red hilight
+ 		case FS_HFSPLUS		: return "#C0A39E" ;	// ~ serene red
+ 		case FS_UFS			: return "#D1940C" ;	//accent yellow dark
++		case FS_SOLARIS			: return "#9933FF" ;	//sun purple
+ 		case FS_USED		: return "#F8F8BA" ;	// ~ light tan yellow
+ 		case FS_UNUSED		: return "#FFFFFF" ;	//white
+ 		case FS_LVM2		: return "#CC9966" ;	// ~ medium brown
[email protected]@ -135,6 +137,7 @@
+ 		case FS_HFS		: return "hfs" ;
+ 		case FS_HFSPLUS		: return "hfs+" ;
+ 		case FS_UFS		: return "ufs" ;
++		case FS_SOLARIS		: return "solaris" ;
+ 		case FS_USED		: return _("used") ;
+ 		case FS_UNUSED		: return _("unused") ;
+ 		case FS_LVM2		: return "lvm2" ;
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/Win_GParted.cc ./src/Win_GParted.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/Win_GParted.cc	2009-04-19 11:05:13.000000000 -0700
++++ ./src/Win_GParted.cc	2009-10-16 15:33:54.349055000 -0700
[email protected]@ -1690,9 +1690,14 @@
+ 
+ 	*succes = true ; 
+ 	for ( unsigned int t = 0 ; t < selected_partition .get_mountpoints() .size() ; t++ )
+-		if ( std::count( mountpoints .begin(),
++	{
++		size_t n = 0;
++
++		std::count( mountpoints .begin(),
+ 				 mountpoints .end(),
+-				 selected_partition .get_mountpoints()[ t ] ) <= 1 ) 
++				 selected_partition .get_mountpoints()[ t ],
++				 n );
++		if ( n <= 1 ) 
+ 		{
+ 			if ( Utils::execute_command( "umount -v \"" + selected_partition .get_mountpoints()[ t ] + "\"",
+ 						     dummy,
[email protected]@ -1704,6 +1709,7 @@
+ 		}
+ 		else
+ 			failed_mountpoints .push_back( selected_partition .get_mountpoints()[ t ] ) ;
++	}
+ 
+ 	
+ 	if ( *succes && failed_mountpoints .size() )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext2.cc ./src/ext2.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/ext2.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/ext2.cc	2009-10-16 15:33:54.360072000 -0700
[email protected]@ -62,12 +62,12 @@
+ 	{
+ 		index = output .find( "Free blocks:" ) ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 )   
++		     sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 )   
+ 			N = -1 ;
+ 	
+ 		index = output .find( "Block size:" ) ;
+ 		if ( index >= output.length() || 
+-		     sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 )  
++		     sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 )  
+ 			S = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext3.cc ./src/ext3.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/ext3.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/ext3.cc	2009-10-16 15:33:54.368076000 -0700
[email protected]@ -63,12 +63,12 @@
+ 	{
+ 		index = output .find( "Free blocks:" ) ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 )   
++		     sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 )   
+ 			N = -1 ;
+ 	
+ 		index = output .find( "Block size:" ) ;
+ 		if ( index >= output.length() || 
+-		     sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 )  
++		     sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 )  
+ 			S = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ext4.cc ./src/ext4.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/ext4.cc	2009-04-19 11:05:13.000000000 -0700
++++ ./src/ext4.cc	2009-10-16 15:33:54.375586000 -0700
[email protected]@ -67,12 +67,12 @@
+ 	{
+ 		index = output .find( "Free blocks:" ) ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output.substr( index ) .c_str(), "Free blocks: %Ld", &N ) != 1 )   
++		     sscanf( output.substr( index ) .c_str(), "Free blocks: %lld", &N ) != 1 )   
+ 			N = -1 ;
+ 	
+ 		index = output .find( "Block size:" ) ;
+ 		if ( index >= output.length() || 
+-		     sscanf( output.substr( index ) .c_str(), "Block size: %Ld", &S ) != 1 )  
++		     sscanf( output.substr( index ) .c_str(), "Block size: %lld", &S ) != 1 )  
+ 			S = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/fat16.cc ./src/fat16.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/fat16.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/fat16.cc	2009-10-16 15:33:54.382437000 -0700
[email protected]@ -68,14 +68,14 @@
+ 	{
+ 		//free clusters
+ 		index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ;
+-		if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%Ld/%Ld", &S, &N ) == 2 ) 
++		if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%lld/%lld", &S, &N ) == 2 ) 
+ 			N -= S ;
+ 		else
+ 			N = -1 ;
+ 
+ 		//bytes per cluster
+ 		index = output .rfind( "\n", output .find( "bytes per cluster" ) ) +1 ;
+-		if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%Ld", &S ) != 1 )
++		if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%lld", &S ) != 1 )
+ 			S = -1 ;
+ 	
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/fat32.cc ./src/fat32.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/fat32.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/fat32.cc	2009-10-16 15:33:54.389232000 -0700
[email protected]@ -68,14 +68,14 @@
+ 	{
+ 		//free clusters
+ 		index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ;
+-		if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%Ld/%Ld", &S, &N ) == 2 ) 
++		if ( index < output .length() && sscanf( output .substr( index ) .c_str(), "%lld/%lld", &S, &N ) == 2 ) 
+ 			N -= S ;
+ 		else
+ 			N = -1 ;
+ 
+ 		//bytes per cluster
+ 		index = output .rfind( "\n", output .find( "bytes per cluster" ) ) +1 ;
+-		if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%Ld", &S ) != 1 )
++		if ( index >= output .length() || sscanf( output .substr( index ) .c_str(), "%lld", &S ) != 1 )
+ 			S = -1 ;
+ 	
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/jfs.cc ./src/jfs.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/jfs.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/jfs.cc	2009-10-16 15:33:54.396315000 -0700
[email protected]@ -82,13 +82,13 @@
+ 		//blocksize
+ 		index = output .find( "Block Size:" ) ;
+ 		if ( index >= output .length() || 
+-		     sscanf( output .substr( index ) .c_str(), "Block Size: %Ld", &S ) != 1 ) 
++		     sscanf( output .substr( index ) .c_str(), "Block Size: %lld", &S ) != 1 ) 
+ 			S = -1 ;
+ 		
+ 		//free blocks
+ 		index = output .find( "dn_nfree:" ) ;
+ 		if ( index >= output .length() || 
+-		     sscanf( output .substr( index ) .c_str(), "dn_nfree: %Lx", &N ) != 1 ) 
++		     sscanf( output .substr( index ) .c_str(), "dn_nfree: %llx", &N ) != 1 ) 
+ 			N = -1 ;
+ 
+ 		if ( S > -1 && N > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/main.cc ./src/main.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/main.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/main.cc	2009-10-16 15:33:54.403171000 -0700
[email protected]@ -20,8 +20,16 @@
+ #include <gtkmm/messagedialog.h>
+ #include <gtkmm/main.h>
+ 
++#ifdef __sun
++char *program_name;
++#endif
++
+ int main( int argc, char *argv[] )
+ {
++#ifdef __sun
++	program_name = argv[0];
++#endif
++
+ 	//initialize thread system
+ 	Glib::thread_init() ;
+ 	
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/ntfs.cc ./src/ntfs.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/ntfs.cc	2009-04-19 11:05:13.000000000 -0700
++++ ./src/ntfs.cc	2009-10-16 15:33:54.410077000 -0700
[email protected]@ -66,9 +66,8 @@
+ 	{
+ 		index = output .find( "resize at" ) ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output .substr( index ) .c_str(), "resize at %Ld", &N ) != 1 )
++		     sscanf( output .substr( index ) .c_str(), "resize at %lld", &N ) != 1 )
+ 			N = -1 ;
+-
+ 		if ( N > -1 )
+ 			partition .set_used( Utils::round( N / 512.0 ) ) ; 
+ 	}
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/reiser4.cc ./src/reiser4.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/reiser4.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/reiser4.cc	2009-10-16 15:33:54.416591000 -0700
[email protected]@ -59,12 +59,12 @@
+ 	{
+ 		index = output .find( "free blocks" ) ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output.substr( index ) .c_str(), "free blocks: %Ld", &N ) != 1 )   
++		     sscanf( output.substr( index ) .c_str(), "free blocks: %lld", &N ) != 1 )   
+ 			N = -1 ;
+ 	
+ 		index = output .find( "blksize" ) ;
+ 		if ( index >= output.length() ||
+-		     sscanf( output.substr( index ) .c_str(), "blksize: %Ld", &S ) != 1 )  
++		     sscanf( output.substr( index ) .c_str(), "blksize: %lld", &S ) != 1 )  
+ 			S = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/reiserfs.cc ./src/reiserfs.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/reiserfs.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/reiserfs.cc	2009-10-16 15:33:54.423380000 -0700
[email protected]@ -67,12 +67,12 @@
+ 	{
+ 		index = output .find( "Blocksize" ) ;
+ 		if ( index >= output .length() || 
+-		     sscanf( output .substr( index ) .c_str(), "Blocksize: %Ld", &S ) != 1 )
++		     sscanf( output .substr( index ) .c_str(), "Blocksize: %lld", &S ) != 1 )
+ 			S = -1 ;
+ 
+ 		index = output .find( ":", output .find( "Free blocks" ) ) +1 ;
+ 		if ( index >= output .length() ||
+-		     sscanf( output .substr( index ) .c_str(), "%Ld", &N ) != 1 )
++		     sscanf( output .substr( index ) .c_str(), "%lld", &N ) != 1 )
+ 			N = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
+diff -ru /home/ml40262/gparted/gparted-0.4.5/src/xfs.cc ./src/xfs.cc
+--- /home/ml40262/gparted/gparted-0.4.5/src/xfs.cc	2009-04-18 13:38:05.000000000 -0700
++++ ./src/xfs.cc	2009-10-16 15:33:54.431044000 -0700
[email protected]@ -85,13 +85,13 @@
+ 			true ) )
+ 	{
+ 		//blocksize
+-		if ( sscanf( output .c_str(), "blocksize = %Ld", &S ) != 1 )
++		if ( sscanf( output .c_str(), "blocksize = %lld", &S ) != 1 )
+ 			S = -1 ;
+ 
+ 		//free blocks
+ 		index = output .find( "fdblocks" ) ;
+ 		if ( index > output .length() ||
+-		     sscanf( output .substr( index ) .c_str(), "fdblocks = %Ld", &N ) != 1 )
++		     sscanf( output .substr( index ) .c_str(), "fdblocks = %lld", &N ) != 1 )
+ 			N = -1 ;
+ 
+ 		if ( N > -1 && S > -1 )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gparted/patches/gparted-02-bug-20239134.patch	Mon Jan 25 15:32:12 2016 -0800
@@ -0,0 +1,144 @@
+# Copied over from the desktop consolidation, not for upstream
+
+--- gparted-0.4.5/src/reiserfs.cc.foo	2015-01-06 09:41:45.012380140 -0800
++++ gparted-0.4.5/src/reiserfs.cc	2015-01-06 09:50:36.448780833 -0800
[email protected]@ -126,7 +126,7 @@
+ 				partition_new .get_length(), GParted::UNIT_BYTE ) ) -1, true ) ;
+ 	}
+ 
+-	exit_status = execute_command( str_temp, operationdetail ) ;
++	exit_status = execute_command( "sh -c '" + str_temp + "'", operationdetail );
+ 
+ 	return ( exit_status == 0 || exit_status == 256 ) ;
+ }
+--- gparted-0.4.5/src/xfs.cc.foo	2015-01-06 09:41:45.012736632 -0800
++++ gparted-0.4.5/src/xfs.cc	2015-01-06 09:50:36.449091112 -0800
[email protected]@ -275,7 +275,7 @@
+ 						operationdetail .add_child( OperationDetail( _("copy file system") ) ) ;
+ 						
+ 						if ( ! execute_command( 
+-							 "xfsdump -J - " + SRC + " | xfsrestore -J - " + DST,
++							 "sh -c 'xfsdump -J - " + SRC + " | xfsrestore -J - " + DST + "'",
+ 							 operationdetail .get_last_child() ) )
+ 						{
+ 							operationdetail .get_last_child() .set_status( STATUS_SUCCES ) ;
+--- gparted-0.4.5/src/fat16.cc.foo	2015-01-06 09:41:45.010543338 -0800
++++ gparted-0.4.5/src/fat16.cc	2015-01-06 09:50:36.447906092 -0800
[email protected]@ -101,7 +101,8 @@
+ 	if( err_msg.length() != 0 )
+ 		partition .messages .push_back( err_msg );
+ 
+-	Glib::ustring cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel -s %2:", fname, dletter ) ;
++	setenv( "MTOOLSRC", fname, 1 );
++	Glib::ustring cmd = String::ucompose( "mlabel -s %1:", dletter );
+ 
+ 	if ( ! Utils::execute_command( cmd, output, error, true ) )
+ 	{
[email protected]@ -128,11 +129,12 @@
+ 	Glib::ustring err_msg = "" ;
+ 	err_msg = Utils::create_mtoolsrc_file( fname, dletter, partition.get_path() ) ;
+ 
++	setenv( "MTOOLSRC", fname, 1 );
+ 	Glib::ustring cmd = "" ;
+ 	if( partition .label .empty() )
+-		cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel -c %2:", fname, dletter ) ;
++		cmd = String::ucompose( "mlabel -c %1:", dletter );
+ 	else
+-		cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel %2:\"%3\"", fname, dletter, Utils::fat_compliant_label( partition .label ) ) ;
++		cmd = String::ucompose( "mlabel %1:\"%2\"", dletter, Utils::fat_compliant_label( partition.label ) );
+ 	
+ 	operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ;
+ 	
+--- gparted-0.4.5/src/Utils.cc.foo	2015-01-06 09:41:45.008378779 -0800
++++ gparted-0.4.5/src/Utils.cc	2015-01-06 09:50:36.447526098 -0800
[email protected]@ -263,27 +263,38 @@
+ 
+ 	try
+ 	{
++		const Glib::ArrayHandle< std::string >& argv = Glib::shell_parse_argv( command );
++
+ 		if ( use_C_locale )
+ 		{
+-			std::vector<std::string> envp, argv;
++			//Spawn command using the C language environment
++			std::vector<std::string> envp ;
+ 			envp .push_back( "LC_ALL=C" ) ;
+ 			envp .push_back( "PATH=" + Glib::getenv( "PATH" ) ) ;
++			envp .push_back( "MTOOLSRC=" + Glib::getenv( "MTOOLSRC" ) );
+ 
+-			argv .push_back( "sh" ) ;
+-			argv .push_back( "-c" ) ;
+-			argv .push_back( command ) ;
+-
+-			Glib::spawn_sync( ".",
+-					  argv,
+-					  envp,
+-					  Glib::SPAWN_SEARCH_PATH,
+-					  sigc::slot<void>(),
+-					  &std_out,
+-					  &std_error,
+-					  &exit_status ) ;
++			Glib::spawn_sync( "."
++			                , argv
++			                , envp
++			                , Glib::SPAWN_SEARCH_PATH
++			                , sigc::slot<void>()
++			                , &std_out
++			                , &std_error
++			                , &exit_status
++			                ) ;
+ 		}
+ 		else
+-			Glib::spawn_command_line_sync( "sh -c '" + command + "'", &std_out, &std_error, &exit_status ) ;
++		{
++			//Spawn command inheriting the parent's environment
++			Glib::spawn_sync( "."
++			                , argv
++			                , Glib::SPAWN_SEARCH_PATH
++			                , sigc::slot<void>()
++			                , &std_out
++			                , &std_error
++			                , &exit_status
++			                ) ;
++		}
+ 	}
+ 	catch ( Glib::Exception & e )
+ 	{
+--- gparted-0.4.5/src/jfs.cc.foo	2015-01-06 09:41:45.011188044 -0800
++++ gparted-0.4.5/src/jfs.cc	2015-01-06 09:50:36.448516738 -0800
[email protected]@ -77,7 +77,7 @@
+ 
+ void jfs::set_used_sectors( Partition & partition ) 
+ {
+-	if ( ! Utils::execute_command( "echo dm | jfs_debugfs " + partition .get_path(), output, error, true ) )
++	if ( ! Utils::execute_command( "sh -c 'echo dm | jfs_debugfs " + partition.get_path() + "'", output, error, true ) )
+ 	{
+ 		//blocksize
+ 		index = output .find( "Block Size:" ) ;
+--- gparted-0.4.5/src/fat32.cc.foo	2015-01-06 09:41:45.010865773 -0800
++++ gparted-0.4.5/src/fat32.cc	2015-01-06 09:50:36.448219811 -0800
[email protected]@ -101,7 +101,8 @@
+ 	if( err_msg.length() != 0 )
+ 		partition .messages .push_back( err_msg );
+ 
+-	Glib::ustring cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel -s %2:", fname, dletter ) ;
++	setenv( "MTOOLSRC", fname, 1 );
++	Glib::ustring cmd = String::ucompose( "mlabel -s %1:", dletter );
+ 
+ 	if ( ! Utils::execute_command( cmd, output, error, true ) )
+ 	{
[email protected]@ -128,11 +129,12 @@
+ 	Glib::ustring err_msg = "" ;
+ 	err_msg = Utils::create_mtoolsrc_file( fname, dletter, partition.get_path() ) ;
+ 
++	setenv( "MTOOLSRC", fname, 1 );
+ 	Glib::ustring cmd = "" ;
+ 	if( partition .label .empty() )
+-		cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel -c %2:", fname, dletter ) ;
++		cmd = String::ucompose( "mlabel -c %1:", dletter );
+ 	else
+-		cmd = String::ucompose( "export MTOOLSRC=%1 && mlabel %2:\"%3\"", fname, dletter, Utils::fat_compliant_label( partition .label ) ) ;
++		cmd = String::ucompose( "mlabel %1:\"%2\"", dletter, Utils::fat_compliant_label( partition.label ) );
+ 	operationdetail .add_child( OperationDetail( cmd, STATUS_NONE, FONT_BOLD_ITALIC ) ) ;
+ 	
+ 	int exit_status = Utils::execute_command( cmd, output, error ) ;