Commit Graph

83 Commits

Author SHA1 Message Date
Mike Fleetwood 0ab2adb67f Increase minimum required gtkmm to 2.11.1 (#794253)
Increase the minimum required version of gtkmm to 2.11.1, thus allowing
removal of:
 *  HAVE_SET_DEFAULT_ICON_NAME autoconf definition and associated
    optional code.
 *  INSTALL_PIXMAPS_DIR automake conditional and associated make
    instructions.

This is reversing these 3 commits, except for the higher minimum gtkmm
version:
 1) a042107883
    Only use Gtk::Window::set_default_icon_name method when available (#695279)
 2) b09d6035cd
    Add fallback method for specifying GParted icon (#695279)
 3) d6baac2546
    Only install fallback icon when required (#695279)

Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required
             versions to glibmm 2.14.0 and gtkmm 2.16.0
2018-03-26 10:16:45 -06:00
Mike Fleetwood 07f58ed82b Raise minimum required glibmm version to 2.14.0 (#794253)
Increase the minimum required version of glibmm to 2.14.0, thus allowing
removal of the HAVE_GLIB_REGEX autoconf definition and associated
conditional code.  This is reversing commit, except for the new glibmm
minimum check:

    456932846b
    Implement fallback if Glib::Regex class is missing (#695279)

Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required
             versions to glibmm 2.14.0 and gtkmm 2.16.0
2018-03-26 10:16:45 -06:00
Curtis Gedak 295c649ace Append -git to version for continuing development 2018-03-19 10:29:11 -06:00
Curtis Gedak 62cd4a5d92 ========== gparted-0.31.0 ========== 2018-03-19 10:08:53 -06:00
Curtis Gedak 0eb9f1fcfb Reduce dependency on scrollkeeper (#743318)
Scrollkeeper and the associated OMF catalog files are used by the
GNOME 2 version of yelp to display the GParted help manual.  To see how
this works try the following command:

  yelp ghelp:gparted

GNOME version 3 and higher yelp do not require scrollkeeper or the OMF
catalog files to properly display the GParted help manual.  And in fact
GNOME 3 deprecated the GNOME 2 method of building and installing GNOME
help documents altogether; including use of GNOME_DOC_INIT autoconf
macro, the gnome-doc-utils package and use of scrollkeeper.

  [GNOME 3] GNOME Goal: Port To New Documentation Infrastructure
  https://wiki.gnome.org/Initiatives/GnomeGoals/NewDocumentationInfrastructure

Further, the next release of Debian, Debian 10 (Buster), will be
removing the scrollkeeper / rarian package.

  rarian: Don't release with Buster
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885657

GParted is still a GNOME 2 app using GNOME 2 documentation build system
using autoconf GNOME_DOC_INIT macro.

  [GNOME 2] Migrating your documentation to gnome-doc-utils
  https://wiki.gnome.org/Projects/GnomeDocUtils/MigrationHowTo

This is needed to build GParted documentation on still supported GNOME 2
distributions RHEL / CentOS 6.  So avoid requiring deprecated
scrollkeeper on GNOME 3 by automatically disabling scrollkeeper database
updates when the scrollkeeper-update command is not available.

  Executable          | Configure option used  | Use scrollkeeper
  scrollkeeper-update | on command line        | when building help
  exists?             |                        | for GParted?
  --------------------+------------------------+-------------------
  Yes                 | <none>                 | Yes
  Yes                 | --enable-scrollkeeper  | Yes
  Yes                 | --disable-scrollkeeper | No
                      |                        |
  No                  | <any>                  | No

Note that because GParted is still using the GNOME 2 documentation build
system it still builds and installs OMF files.  It is just that they are
not required with GNOME 3 yelp and this commit automatically disables
updating the scrollkeeper database when the scrollkeeper-update command
is not available.

Bug 743318 - configure script missing check for scrollkeeper dependency
2018-02-08 21:58:51 +00:00
Curtis Gedak 6045e5a147 Append -git to version for continuing development 2017-10-10 10:43:13 -06:00
Curtis Gedak 1db4c5ae83 ========== gparted-0.30.0 ========== 2017-10-10 10:20:25 -06:00
Mike Fleetwood f38ccd0284 Only when configured, grant root access to the X11 display (#776437)
GParted fails to display when run under Wayland [1][2][3].  This is
because by intentional design Wayland doesn't allow applications with
root privileges access to the display [4].

As an interim workaround make the gparted shell wrapper use xhost to
grant root access to the X11 server if root doesn't already have access,
but only when configured.  Granting root access must be explicitly
enabled when building GParted like this:
    ./configure --enable-xhost-root
It defaults to disabled.  When gpartedbin binary ends the shell wrapper
revokes root access only if it granted such access.

[1] GNOME Bug 776437 - GParted fails to run as root under Wayland
    https://bugzilla.gnome.org/show_bug.cgi?id=776437

[2] Ubuntu Bug 1652282 - GParted does not work in GNOME on Wayland
    https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/1652282

[3] Fedora Bug 1397103 - gparted not working under Wayland
    https://bugzilla.redhat.com/show_bug.cgi?id=1397103

[4] Common Fedora 25 bugs
    Running graphical apps with root privileges (e.g. gparted) does not
    work on Wayland
    https://fedoraproject.org/wiki/Common_F25_bugs#wayland-root-apps

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Mike Fleetwood 6f521c4d98 Remove unnecessary autoconf check for pkexec --disable-internal-agent option (#776437)
The pkexec --disable-internal-agent option was introduced by this commit
[1] in polkit 0.98 [2] which is before the minimum 0.102 version needed
to run X11 apps.  Therefore the option will always be available.  Remove
the unnecessary check.

[1] https://cgit.freedesktop.org/polkit/commit/?id=f071d4561dfe8dd9cfd4e29fddec7bc82fd658aa
    pkexec: add --disable-internal-agent option

[2] https://cgit.freedesktop.org/polkit/tree/NEWS?id=0.98#n25
    polkit NEWS entry for 0.98

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Mike Fleetwood 11c251293e Check for pkexec >= 0.102 which supports execution of X11 apps (#776437)
On CentOS 6 with polkit version 0.96 pkexec fails to execute gparted
shell wrapper as root like this:

    $ env | grep DISPLAY
    DISPLAY=:0.0
    $ sh -x /usr/local/bin/gparted
    ...
    + pkexec /usr/local/bin/gparted
    (gpartedbin:8011): Gtk-WARNING **: cannot open display:

This is because polkit didn't support setting the DISPLAY environment
variable to allow execution of X11 applications until the introduction
of the allow_gui annotation by this commit in polkit 0.102:

    https://cgit.freedesktop.org/polkit/commit/?id=7850d27017fed1834268a852350ae85381fbb110
    Bug 38769 - pkexec: Support running X11 apps

Make configure only use pkexec version 0.102 or higher as the privilege
escalation program.  Otherwise configure falls back to checking for the
other privilege escalation programs as it did before.

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Mike Fleetwood 2f559ec3b5 Only install polkit action file when pkexec is used (#776437)
Only install the GParted polkit action file when pkexec is being used as
the root privilege escalation program.

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Mike Fleetwood f35e734a0c Add required polkit action file (#776437)
An action file is always needed with polkit to describe the privileged
actions that are available to the subject (client program).  For GParted
the only available action is to run the gparted shell script as root.

Note that the polkit action file will be installed into location
$(prefix)/share/polkit-1/actions.  This is required by the GNU Coding
Standards [1] and to prevent 'make distcheck' from failing [2].  However
polkit only uses /usr/share/polkit-1/actions for it's action files [3].
This dilemma was discussed in this Bugzilla bug 776437 and on the
general Automake discussion email list [4].  The solution is to simply
document in the README file that a manual additional installation step
may be required.

The action file is marked as translatable with the underscore (_) of the
_description and _message tags identifying the string to be translated.

Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into
the polkit action file necessitates increasing the minimum version of
intltool to 0.36.0 where it was first introduced in intltool.m4.  This
will prevent GParted building on RedHat/CentOS 5 which only has intltool
0.35.0.  But that doesn't matter because RedHat/CentOS 5 reached end of
life on 31st March 2017.

[1] GNU Coding Standards, 7.2.5 Variables for Installation Directories
    https://www.gnu.org/prep/standards/standards.html#Directory-Variables

[2] Automake Manual, 27.10 Installing to Hard-Coded Locations
    https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths
    "My package needs to populate the installation directory of another
    package at install-time.  I can easily compute that installation
    directory in configure, but if I install files therein,
    'make distcheck' fails.  How else should I do?"

[3] polkit(8), Declaring Actions
    https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions

    "A mechanism need to declare a set of actions in order to use
    polkit.  Actions correspond to operations that clients can request
    the mechanism to carry out and are defined in XML files that the
    mechanism installs into the /usr/share/polkit-1/actions directory."

[4] Not installing to hard-coded locations vs polkit's fixed location
    http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Mike Fleetwood b47528b6f9 Add detection of pkexec root privilege escalation program (#776437)
Many of the distributions (confirmed for Arch Linux, Debian, Fedora,
OpenSUSE, RedHat/CentOS and Ubuntu but likely many others too) are now
using polkit as the mechanism to authorise privileged actions, including
using it to authorise GParted to run as root in their packages of
GParted.  Therefore make the GParted configure script check for the
pkexec command.

Use pkexec with the --disable-internal-agent option when available,
preventing pkexec using it's own textual authentication agent.  When
running GParted from a desktop icon or menu there is no terminal with
which to interact with the textual authentication agent to it can't be
used.  The desktop's graphical agent must be running.  This matches how
some distributions already use polkit in their own packages of GParted.

Required actions file will be added in the next commit.

    polkit(8)
    https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html

    pkexec(1)
    https://www.freedesktop.org/software/polkit/docs/latest/pkexec.1.html

Bug 776437 - GParted fails to run as root under Wayland
2017-09-01 10:14:20 -06:00
Curtis Gedak c237a37982 Append -git to version for continuing development 2017-08-07 10:18:13 -06:00
Curtis Gedak 5b831647a8 ========== gparted-0.29.0 ========== 2017-08-07 09:59:20 -06:00
Mike Fleetwood f31808989a Silence subdir-objects warning from automake 1.14 (#781978)
Configuring GParted on a machine with automake >= 1.14 produces this
warning:

    $ ./autogen.sh
    ...
    lib/gtest/Makefile.am:58: warning: source file 'src/gtest-all.cc' is in a subdirectory,
    lib/gtest/Makefile.am:58: but option 'subdir-objects' is disabled
    automake: warning: possible forward-incompatibility.
    automake: At least a source file is in a subdirectory, but the 'subdir-objects'
    automake: automake option hasn't been enabled.  For now, the corresponding output
    automake: object file(s) will be placed in the top-level directory.  However,
    automake: this behaviour will change in future Automake versions: they will
    automake: unconditionally cause object files to be placed in the same subdirectory
    automake: of the corresponding sources.
    automake: You are advised to start using 'subdir-objects' option throughout your
    automake: project, to avoid future incompatibilities.
    lib/gtest/Makefile.am:60: warning: source file 'src/gtest_main.cc' is in a subdirectory,
    lib/gtest/Makefile.am:60: but option 'subdir-objects' is disabled
    lib/gtest/Makefile.am: installing './depcomp'
    tests/Makefile.am:22: warning: source file '../src/BlockSpecial.cc' is in a subdirectory,
    tests/Makefile.am:22: but option 'subdir-objects' is disabled
    tests/Makefile.am:23: warning: source file '../src/PipeCapture.cc' is in a subdirectory,
    tests/Makefile.am:23: but option 'subdir-objects' is disabled
    ...

From the automake 1.14 NEWS file:
    http://git.savannah.gnu.org/cgit/automake.git/tree/NEWS?h=v1.14#n125

    "The next major Automake version (2.0) will unconditionally activate
    the 'subdir-objects' option.  In order to smooth out the transition,
    we now give a warning (in the category 'unsupported') whenever a
    source file is present in a subdirectory but the 'subdir-object' is
    not enabled.  For example, the following usage will trigger such a
    warning:

        bin_PROGRAMS = sub/foo
        sub_foo_SOURCES = sub/main.c sub/bar.c
    "

Set the subdir-objects automake option, silencing the warning.

Bug 781978 - Add Google Test C++ test framework
2017-06-22 09:27:01 -06:00
Mike Fleetwood c37be28148 Add unit tests for BlockSpecial constructors and internal caching (#781978)
So far only includes tests of the construction of BlockSpecial objects
and the interaction with the internal cache used to reduce the number of
stat(2) calls.  Tests have been designed to be runable by non-root users
and assume as little as possible about the environment by discovering
used block device names and symbolic link name.

Bug 781978 - Add Google Test C++ test framework
2017-06-02 10:47:30 -06:00
Mike Fleetwood dceb293f15 Add unit test suites with initial successful dummy test (#781978)
Now 'make check' will additionally build and run the test suites in the
./tests directory.  Add initial always successful dummy test suite.
This is done using Automake support for testing.

    Automake Manual, 15 Support for test suites
    https://www.gnu.org/software/automake/manual/automake.html#Tests

./tests/Makefile.am takes some influence from the same file in the
minimal-gtest-autotools template project.
    654848ec01/tests/Makefile.am

Bug 781978 - Add Google Test C++ test framework
2017-06-02 10:13:16 -06:00
Mike Fleetwood 81b104928b Add building of Google Test libraries (#781978)
This closely follows the minimal-gtest-autotools template project.
    https://github.com/octol/minimal-gtest-autotools

Now 'make check' will additionally build the Google Test C++ test
framework libraries.

Bug 781978 - Add Google Test C++ test framework
2017-06-02 10:13:16 -06:00
Curtis Gedak 883d7cf598 Append -git to version for continuing development 2017-02-17 15:55:27 -07:00
Curtis Gedak 7ac84119c0 ========== gparted-0.28.1 ========== 2017-02-17 15:42:22 -07:00
Curtis Gedak f537b720bb Append -git to version for continuing development 2017-02-14 10:34:04 -07:00
Curtis Gedak 10d3490e18 ========== gparted-0.28.0 ========== 2017-02-14 10:06:45 -07:00
Curtis Gedak 5e26e6e2e4 Append -git to version for continuing development 2016-10-19 09:43:05 -06:00
Curtis Gedak 4822831a32 ========== gparted-0.27.0 ========== 2016-10-19 09:23:39 -06:00
Curtis Gedak 74e0aad7a4 Append -git to version for continuing development 2016-06-13 11:04:38 -06:00
Curtis Gedak 9eb9f503db ========== gparted-0.26.1 ========== 2016-06-13 10:13:02 -06:00
Curtis Gedak 4761f2e7cb Append -git to version for continuing development 2016-04-26 09:20:15 -06:00
Curtis Gedak d66c544a45 ========== gparted-0.26.0 ========== 2016-04-26 09:02:57 -06:00
Mike Fleetwood 707bae6fed Enable C++11 compilation when using libsigc++ 2.5.1 and later (#758545)
As with glibmm [1] the latest versions of libsigc++ also uses ISO C++
2011 features.  The NEWS file [2] says:

    2.5.1 (unstable):

    * Use (and require) C++11
      (Kjell Ahlstedt)
    * Using C++11 lambda functions to create sigc::slots:
      Avoid the need for SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE.
      (Kjell Ahlstedt)

Without enabling C++11 compiler features, compilation of GParted with
libsigc++ 2.5.1 and later fails with errors such as theses:

    /usr/include/sigc++-2.0/sigc++/trackable.h:40:3: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++0x-compat]
       trackable_callback(void* data, func_destroy_notify func) noexcept
       ^

[1] d6d7cb2bbf
    Enable C++11 compilation when using glibmm 2.45.40 and later (#756035)

[2] libsigc++ 2.5.1 NEWS file
    https://git.gnome.org/browse/libsigcplusplus/tree/NEWS?h=2.5.1

Bug 758545 - gparted-0.24.0 fails to build with gnome 3.18 mm packages
             (on Gentoo)
2016-03-28 11:03:33 -06:00
Mike Fleetwood ff9aeb8092 Change to autoconf PKG_CHECK_EXISTS for set_default_icon_name() method (#762184)
Previously the autoconf check for Gtk::Window::set_default_icon_name()
method was a compile test because the documentation reported the method
was available in gtkmm from 2.6 [1], however it wasn't available on
RHEL / CentOS 5.x with gtkmm 2.10.

Then commit [2] added detection and enabling of C++11 compilation, but
after the above autoconf check.  So on Fedora 23 the compiler based
autoconf check for set_default_icon_name() method failed because C++11
compilation had not yet been enabled:

>   checking for Gtk::Window::set_default_icon_name method... no
    checking for gtk_show_uri function... yes
    checking for Gtk::MessageDialog::get_message_area() method... yes
>   checking for glibmm >= 2.45.40 which requires C++11 compilation... yes
>   checking whether g++ supports C++11 features by default... no
>   checking whether g++ supports C++11 features with -std=gnu++11... yes

The gtkmm source code reveals that set_default_icon_name() method was
only added in gtkmm 2.11.1 [3] so switch to a PKG_CHECK_EXISTS for this
version of gtkmm.

[1] gtkmm GTK::Window Class Reference
    https://developer.gnome.org/gtkmm/3.6/classGtk_1_1Window.html#a533d03e9b92d8ccd142ab3a44005cae4

[2] Enable C++11 compilation when using glibmm 2.45.40 and later (#756035)
    d6d7cb2bbf

[3] gtkmm NEWS file
    https://git.gnome.org/browse/gtkmm/tree/NEWS?h=gtkmm-2.14.0#n565

Bug 762184 - Autoconf check for C++11 comes after compile test for
             Gtk::Window::set_default_icon_name()
2016-02-18 14:13:36 -07:00
Curtis Gedak 15b2e9f9d0 Append -git to version for continuing development 2016-01-18 10:15:02 -07:00
Curtis Gedak 976eea771c ========== gparted-0.25.0 ========== 2016-01-18 09:29:50 -07:00
Curtis Gedak 2f6325d0ef Revert tarball compression to gzip (#760099)
Debian has deprecated the use of bzip2 for tarballs since dpkg-1.17.7,
released 2014-04-21.   See:
https://lintian.debian.org/tags/uses-deprecated-compression-for-data-tarball.html

The choices going forward were to use gzip for maximum compatibility and
speed, or to use xz for maximum compression.

Since we strive for backwards compatibility, gzip was chosen.

Bug 760099 - Revert tarball compression to gzip
2016-01-05 09:06:14 +00:00
Curtis Gedak 69cc508be2 Append -git to version for continuing development 2015-10-27 10:12:43 -06:00
Curtis Gedak 87053adae1 ========== gparted-0.24.0 ========== 2015-10-27 09:36:24 -06:00
Mike Fleetwood d6d7cb2bbf Enable C++11 compilation when using glibmm 2.45.40 and later (#756035)
Glibmm 2.45.40 and later uses features in the ISO C++ 2011 standard.
The NEWS file [1] says:

    Changes in 2.46 compared to 2.44:

    General:
    * Use, and require C++11, using features such as move operations,
      noexcept auto, = delete, nulltpr, override.
      (Murray Cumming, Kjell Ahlstedt)

Also found this by Murray Cumming [2]:

    glibmm 2.45.40 requires C++11, both for its own build and by any
    apps that use it.  gtkmm also now requires C++11.

    I think you are seeing a symptom of building the application without
    C++11 support.  For instance, using CXXFLAGS="--std=c++11", though
    you'd be better of using an m4 macro such as
    AX_CXX_COMPILE_STDCXX_11().

Without enabling C++11 compiler features, compilation of GParted with
the latest glibmm library fails with errors such as these:

    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: error: expected ';' at end of member declaration
       ~ustring() noexcept;
                ^
    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: error: 'noexcept' does not name a type
       ~ustring() noexcept;
                  ^
    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: note: C++11 'noexcept' only available with -std=c++11 or -std=gnu++11

[1] glibmm NEWS file
    https://git.gnome.org/browse/glibmm/tree/NEWS?id=934e8290ce913b12e251ea617d0fc8ac53c385c6

[2] https://bugs.launchpad.net/ubuntu/+source/glibmm2.4/+bug/1478367

Bug 756035 - GParted does not compile with newer gtkmm libraries in
             Fedora 23
2015-10-05 10:14:35 -06:00
Mike Fleetwood bdbb6729f8 Fix configuration version compare issue affecting libparted from GIT (#753525)
When configuring GParted build with libparted from GIT it may perform
the version compares incorrectly and think the version of libparted is
higher that it actually is.  Libparted uses the number of commits from
the last git tag as the third part of the version number.

For example install libparted from one commit before release 3.1, 142
commits after release 3.0.
    $ git checkout v3.1^
    $ describe
    v3.0-142-g82327a3
    $ ./bootstrap
    $ ./configure --prefix=/tmp/parted-3.0-git
    $ make && make install

Configure GParted:
    $ export CPPFLAGS=-I/tmp/parted-3.0-git/include
    $ export LDFLAGS=-L/tmp/parted-3.0-git/lib
    $ export LD_RUN_PATH=/tmp/parted-3.0-git/lib
    $ export PKG_CONFIG_PATH=/tmp/parted-3.0-git/lib/pkgconfig
    $ ./configure
    ...
    checking for libparted >= 1.7.1 (querying pkg-config)... 3.0.142-8232
    checking for 2.0 <= libparted <= 3.0 (loop table creation doesn't delete old partitions)... (cached) no
    checking for libparted >= 2.2 (improved pt re-read)... (cached) yes
    checking for ped_file_system_resize in -lparted... no
    checking for ped_file_system_resize in -lparted-fs-resize... yes
    checking for libparted >= 3.2 (online resize)... (cached) no
    ...
Libparted is reported as version 3.0.142, but checking of the version
between 2.0 and 3.0 inclusive fails.

The configure script is multiplying components of the version by 100
when adding them together.
    $ echo 3.0.142-8232 | awk -F. '{print $1 * 10000 + $2 * 100 + $3}'
    30142

So it is only allowing up to 99 commits before it is equivalent to the
second minor number increasing by one.  Increase the multiplication
factor to 10000, allowing up to 9999 commits between releases.  An order
of magnitude more commits than so far seen between parted releases.

Bug 753525 - Configuration issues when using non-system location or
             non-released versions of libparted
2015-08-18 10:30:08 -06:00
Curtis Gedak e1ba16e167 Append -git to version for continuing development 2015-08-03 10:29:37 -06:00
Curtis Gedak a10057d837 ========== gparted-0.23.0 ========== 2015-08-03 10:05:57 -06:00
Curtis Gedak 9f6110ce4c Append -git to version for continuing development 2015-03-23 09:44:54 -06:00
Curtis Gedak 0d4ea36d41 ========== gparted-0.22.0 ========== 2015-03-23 09:29:03 -06:00
Mike Fleetwood 9c1a833a0d Fix failure to recognise whole disk file systems in certain cases (#743181)
When the following conditions were met GParted would fail to recognise a
newly created whole disk device file system, and instead show an unknown
file system filling the disk:

1) Disk was previously partitioned and contained at least one partition.

2) Using libparted version 2.0 to 3.0 inclusive.

Initial status:
    # blkid | fgrep sdc
    # fgrep sdc /proc/partitions
       8       32  976762584 sdc
       8       33  104857600 sdc1
    # parted /dev/sdc
    GNU Parted 2.4
    Using /dev/sdc
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print
    Model: ATA ST1000LM024 HN-M (scsi)
    Disk /dev/sdc: 1000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: msdos

    Number  Start   End    Size   Type     File system  Flags
     1      1049kB  107GB  107GB  primary

When creating the loop partition table libparted would not inform the
kernel to delete the old partitions.  /proc/partitions still contained
the details of the old partitions.
    (parted) mktable loop
    Warning: The existing disk label on /dev/sdc will be destroyed and
    all data on this disk will be lost. Do you want to continue?
    Yes/No? Yes
    (parted) print
    Model: ATA ST1000LM024 HN-M (scsi)
    Disk /dev/sdc: 1000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: loop

    Number  Start  End  Size  File system  Flags

    (parted) quit
    # fgrep sdc /proc/partitions
       8       32  976762584 sdc
       8       33  104857600 sdc1

Creation of the whole disk device file system goes unnoticed by blkid
because the kernel and therefore blkid's cache have stale partition
information.
    # mkfs.xfs -f /dev/sdc
    # blkid | fgrep sdc

NOTE:
On a Linux Software RAID array, as opposed to a hard disk, blkid does
notice creation of the whole disk device file system.  However the
kernel still has old partition details.

This was fixed in libparted 3.1 by commit:

    http://git.savannah.gnu.org/cgit/parted.git/commit/?id=f5c909c0cd50ed52a48dae6d35907dc08b137e88
    libparted: remove has_partitions check to allow loopback partitions

Fix by deleting old partitions before creating the loop table when
compiled with a broken version of libparted.  The GParted UI provides
no feedback while a new partition table is created, and with some
versions of GTK the UI become unresponsive too, so it is important to be
as fast as possible.  Evaluated three different methods, deleting 15 and
22 MSDOS partitions on a physical 5400 RPM hard drive using libparted
2.4:

M1) Delete and commit one partition at a time.
    Takes up to 24 seconds to delete 15 partitions.  With 22 partitions
    libparted always reports finding some of the partitions busy and
    unable to inform the kernel about the modifications.
    Too slow and doesn't work.

M2) Delete all partitions in one go and commit once.
    Takes up to 1.4 seconds to delete either 15 or 22 partitions.  Never
    removes partitions 17 and higher from the kernel.
    Doesn't work.

M3) Write GPT table (letting libparted delete any old partitions).
    Takes up to 0.8 seconds to delete either 15 or 22 partitions.
    Fast and works.

Use method 3 - write a GPT table thus using libparted code to inform the
kernel of the old partition deletions.

Bug 743181 - Add unpartitioned drive read-write support
2015-03-09 11:04:13 -06:00
Curtis Gedak d916cee115 Append -git to version for continuing development 2015-01-26 10:35:31 -07:00
Curtis Gedak 23091fbee7 ========== gparted-0.21.0 ========== 2015-01-26 10:01:46 -07:00
Mike Fleetwood 6304377811 Correctly capitalise GNOME in the Manual and man page (#739805)
The GNOME Logo & Trademarks page
(http://www.gnome.org/logo-and-trademarks/) says:
    * All the letters in "GNOME" should be capitalized.

Also correctly capitalise the program name as GNOME Partition Editor in
the Manual, and gparted.doap file (used in web git browser).

Bug 739805 - GNOME is incorrectly capitalised on the website and else
             where
2014-12-20 10:02:55 -07:00
Mike Fleetwood 5a93a9c432 Avoid splitting Autoconf check message for libparted version (#740004)
First use of PKG_CHECK_EXISTS causes additional checking messages to be
reported which splits the libparted version check message from it's
result, like this:

    checking for libparted >= 1.7.1 (querying pkg-config)... checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    2.3

Call PKG_CHECK_EXISTS early, before first use to avoid this.  Output
now looks like:

    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    :
    checking for libparted >= 1.7.1 (querying pkg-config)... 2.3

Bug 740004 - use pkg-config to check for version of libparted
2014-11-20 14:59:56 -07:00
Mike Fleetwood 9c7cb6f496 Use pkg-config Autoconf check for libparted version first (#740004)
Currently ./configure links and runs a program to query the libparted
library version, which is used to determine the availability of some
features.  This makes cross-compiling harder because the compile host
has to fake a virtual installation target in which to run the check.
Because of this, pkg-config based Autoconf checks are preferred.

Switch to using a pkg-config based Autoconf check first to determine the
version of libparted, falling back to the previous method for older
distributions which don't provide a pkg-config file for libparted.

Also small comment tidy-up elsewhere.

Bug 740004 - use pkg-config to check for version of libparted
2014-11-20 14:59:56 -07:00
Curtis Gedak ad6f73a5f6 Append -git to version for continuing development 2014-10-20 10:02:21 -06:00
Curtis Gedak ce77fff15d ========== gparted-0.20.0 ========== 2014-10-20 09:27:51 -06:00