You are not logged in.

#1 2016-04-19 11:16

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

solving the double dialog issue with updater

I thought I would post how to resolve this issue for anyone who would like to resolve this before an update is issued (it may take some time as it is a trivial bug)
Fist you need to download the source file from HERE You could try another version, but this one is for the package we are currently using.
Second you will need to download some extra packages that will be used to compile the code, this might not be an exhaustive list but you will be told by the compiling process which package you are missing.

  • build-essential

  • gnome-common

  • gtk-doc-tools

  • libglib2.0-dev

  • libpackagekit-glib2-dev

  • libgtk-3-dev

  • libcanberra-gtk3-dev

  • libnotify-dev

These can be installed using synaptic, or on the command line with

 sudo apt-get install packagenamefromlist

where packagenamefromlist is the name in the above list.
Next open the downloaded source file using ark (right click using file manager) and unpack somewhere, the location is unimportant as it can be removed after installation.
Now go to the directory you just unpacked to and navigate to the src folder, here you will find a lot of files, there is only one that we need to edit, find the file gpk-update-viewer.c and open it with a text editor (kate or kwrite both work fine for this).
Now the important part, you need to go to line 3009 in the code, you can turn on line numbering in the options for most editing software.
Below is the section from line 3000 to 3011

static void
gpk_update_viewer_updates_changed_cb (PkControl *_control, gpointer user_data)
{
	/* now try to get newest update array */
	g_debug ("updates changed");
	if (ignore_updates_changed) {
		g_debug ("ignoring");
		return;
	}
	gpk_update_viewer_get_new_update_array ();
}

You want to change it to be like this:

static void
gpk_update_viewer_updates_changed_cb (PkControl *_control, gpointer user_data)
{
	/* now try to get newest update array */
	g_debug ("updates changed");
	if (ignore_updates_changed) {
		g_debug ("ignoring");
		return;
	}
	ignore_updates_changed = TRUE;
	gpk_update_viewer_get_new_update_array ();
}

You will notice that ONLY 1 LINE HAS CHANGED and that is th inserted line "ignore_updates_changed = TRUE;" which will now be at line 3009
Next save the file.
Now to the terminal, open a terminal (konsole) and go to the "gnome-packagekit-gnome-3-14" directory, I installed it to my home folder so if i type

cd /home/dai/gnome-packagekit-gnome-3-14

I will get there directly.
now if you are in the correct directory you can type

./autogen.sh

this will output a lot of text into the terminal, when this has finished there will either be a message saying you should now run make or an error saying which package you are missing. Hopefully it will be the the first one.
Now simply type

make

again a lot of text will be output to the terminal (this is normal)
Now type

sudo make install

And when finished you will have an updater that will not give you the double boxes.
If you want the q4os updater to use this new updater, you must remove or rename the old updater

sudo mv /usr/bin/gpk-update-viewer /usr/bin/gpk-update-viewer.old

now create a link to your new package with

sudo ln -s /usr/local/bin/gpk-update-viewer /usr/bin/gpk-update-viewer

et-voila!
I hope someone finds this useful smile

If you follow this guide and for whatever reason the updater fails to work or fails to work correctly you can type into the terminal

sudo mv /usr/bin/gpk-update-viewer.old /usr/bin/gpk-update-viewer

and this will give you back the original updater.

Offline

#2 2016-04-21 09:10

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 2,643
Website

Re: solving the double dialog issue with updater

Thanks Dai_trying, for these excellent directions. We have tested the procedure, works perfectly, we can recommend it, before the official fix will be available.

We have created a script to build fixed 'gnome-packagekit' package from Debian sources. You will have to enable 'deb-src' entries in '/etc/apt/sources.list.d/20_debian.list' first. Download files attached below and run the 'build_gpk.sh' script.
$ sh build_gpk.sh

EDIT: We have deleted the files as we would more likely recommend Dai_trying's solution.

Offline

#3 2016-04-21 09:58

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

Thanks team, and great work on the script, it makes it a lot easier for users who prefer not to use the command line so much smile

Offline

#4 2016-04-21 15:58

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

There is an error in your script, it refers to the patch file as doublebox.patch, and you have posted the file as gpk_doublebox.patch and also I have a build error (after renaming the file)
I will wipe this installation down, reinstall and try again to see if maybe I had something messed up which caused it and post back here with info.

Offline

#5 2016-04-21 16:29

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 2,643
Website

Re: solving the double dialog issue with updater

It was needed to run 'sudo apt-get update' after enabling 'deb-src' entries in '/etc/apt/sources.list.d/20_debian.list' . build_gpk.sh' script fixed and replaced, sorry for the errors.

Offline

#6 2016-04-21 17:36

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

I did do an update after changing the source.list file, and still have errors sad this time it says fakeroot not found, but i installed it and then everything seemed to work as intended, but when running the updater it still gave me double boxes, although on the second run (after installing fakeroot) I encountered a message which said " 1 hunk failed "
I will try again from a fresh directory and see what that does...

EDIT: third attempt failed as I do not have devscripts installed, so installing now and will post back with results

Last edited by Dai_trying (2016-04-21 17:41)

Offline

#7 2016-04-21 17:57

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

Sorry, but I cannot get this working, I have installed fakeroot and devscripts, ran the procedure after removing everything in the directory that had been downloaded/compiled previously and it seemed to work, but the result was still double boxes.

Offline

#8 2016-04-21 18:28

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 2,643
Website

Re: solving the double dialog issue with updater

Sorry for the inconvenience, please try the script again, download updated files to a newly created directory and run:
$ sh build_gpk.sh | tee testb.log
attach generated logfile 'testb.log' here or send via e-mail to analyze.

If you will see '1 out of 1 hunk ignored ..' message, the patch is not applied correctly.

The script will not install new packages, it will only create .deb files. They can be installed with the command:
$ sudo dpkg -i gnome-packagekit_3.14.0-1.1_amd64.deb

We have tested the script and it passed well. Thank you.

Offline

#9 2016-04-21 19:12

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

Ok I ran it again and this time installed the deb package, but I cannot tell if it has worked as it displays an update for gnome-package-kit, but shows "No update details available" in the details window but fails to update. And so there is always a package in the updater which with the previous updater would not show double dialog boxes.

Offline

#10 2016-04-21 22:00

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

I have created a simple bash script to do the whole process outlined in the first post, it will set everything up exactly as I outlined. I did not really like the solution offered by the team (sorry guys) as it leaves a pending update that will not get processed (in it's current state, I don't know if they are still working on it).
Hope it can be of some use to someone else smile
Just download it and run ./dai_updater_fix.sh
DO NOT run it as root!

Last edited by Dai_trying (2016-04-21 22:02)


Attachments:
sh dai_updater_fix.sh, Size: 2.27 KiB, Downloads: 581

Offline

#11 2016-04-21 23:31

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 2,643
Website

Re: solving the double dialog issue with updater

No problem Dai, we really appreciate your excellent work. We would like to track down the glitch you have encountered, we are working on. We prefer and recommend your solution for Q4OS users so far.

Offline

#12 2016-04-22 00:08

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

Thank you, I am happy to help where I can smile

Offline

#13 2016-04-22 08:57

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 2,643
Website

Re: solving the double dialog issue with updater

We have tested Dai_trying's solution and works pretty fine. The only suggestion is to install 'gksu' package before to run the script for users, they install 'Pure' desktop profile only.

We have no idea, why the build from Debian sources doesn't work well. The only explanation is some differences between Debian and vanilla 'gnome-packagekit' sources, as the patch is exactly the same. We will not research this issue more, as it's really complex and Dai_trying's script absolutely fixes it.

Dai_trying, thanks again

Offline

#14 2016-04-22 09:39

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,863
Website

Re: solving the double dialog issue with updater

You are welcome cool
I did test script on a basic installation and gksu was already there, otherwise I would have added it smile

Offline

Board footer

Powered by FluxBB