BunsenLabs / bunsen-os-release

Controls OS and vendor identification on BunsenLabs systems
https://pkg.bunsenlabs.org/debian/pool/main/b/bunsen-os-release/
19 stars 3 forks source link

software-properties-gtk not working #3

Closed ghost closed 9 years ago

ghost commented 9 years ago

@johnraff

johnraff commented 9 years ago

My personal opinion is only one of many, but I also like the basic idea of making the BunsenLabs identity more clear.

However is this not a fairly major step? The relationship of BunsenLabs with Debian is perhaps something that needs to be discussed among all involved, and, in particular, needs the agreement of the project leader @pvsage . ( I have just been re-reading the Debian Wiki: https://wiki.debian.org/Derivatives/Guidelines ) Is BunsenLabs to be a Debian Derivative, or simply Debian with some configurations? How are bug reports to be dealt with? How will our users expect to be treated if they raise questions on the Debian Forums? What resources and manpower can we reasonably expect to have in relation to the tasks and responsibilities we will be expected to take on? And probably other questions...


Actually, there are also some possible technical issues. I remember problems when CrunchBang set a lsb-release file and the package software-properties-gtk misbehaved. SPG is not a standard #! or BL package but it is a useful GUI for adjusting repositories and finding a fast mirror which integrates into Synaptic and which some users might want to install.

I have just done a test on a virtual BL system - installing SPG, which worked correctly. After also installing bunsen-os-release, gksu software-properties-gtk after receiving the password returns immediately, displaying no error messages. After purging bunsen-os-release, SPG works again.

To try to get round the lack of error messages I installed strace and ran these commands:

strace gksu /usr/bin/software-properties-gtk > strace_spg_without_bor 2>&1
sudo apt-get install bunsen-os-release
strace gksu /usr/bin/software-properties-gtk > strace_spg_with_bor 2>&1

The files are here: https://dl.dropboxusercontent.com/u/10808732/strace_spg_without_bor https://dl.dropboxusercontent.com/u/10808732/strace_spg_with_bor They are long (over 7000 lines) but if you search for mypassword you'll see the section after inputting the gksu p/w, which is quite short, especially in the case with BOR. I don't know if you'll spot the problem there. It seems to be in this section, right at the end:

nanosleep({0, 100000000}, NULL)         = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19484, si_uid=0, si_status=1, si_utime=2, si_stime=0} ---
restart_syscall(<... resuming interrupted call ...>) = 0
waitpid(19484, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 19484
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLIN|POLLOUT}])
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\34\0r\0168\0\340\3(\0\0\0\216\33\3\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 896
writev(3, [{"\1\30\n\0\257\0\340\3p\1\0\0\234\377\234\377\1\0\1\0\0\0\0\0!\0\0\0\0\n\0\0"..., 224}], 1) = 224
unlink("/tmp/libgksu-Wy5AJs/.Xauthority") = 0
rmdir("/tmp/libgksu-Wy5AJs")            = 0
exit_group(1)                           = ?
+++ exited with 1 +++

If there are any other tests I can try on this system please let me know.

So if there is a resolution for this problem then all is fine on the tech front - otherwise we are faced with a tradeoff between enhancing users' perception of BunsenLabs along with easy access to the correct support and bug report links, vs possible breakage of some other packages.

ghost commented 9 years ago

8<

Investigating, seems like problems like this is are years old... #!§$%@ GNOME.

ghost commented 9 years ago

John, could you confirm:

  1. Install bunsen-os-release
  2. Does it work or not with either of os-release and lsb-release manually removed?
  3. Does it work when you edit DISTRIB_ID in lsb-relesae to just read 'Debian'?
ghost commented 9 years ago

Just to check, we're talking about this: https://packages.debian.org/jessie/software-properties-gtk not working right?

ghost commented 9 years ago

Synaptics does work?

ghost commented 9 years ago

@johnraff I've figured things out. The problem is not the properties dialouge per se but the python3-apt package which it uses (as such, softwar-properties-kde, which is built from the same source package, should suffer from the same problem). The aptsources module has code as follows:

        if not dist:
            try:
                dist = Popen(["lsb_release", "-i", "-s"],
                             stdout=PIPE).communicate()[0].strip()
            except OSError as exc:
                if exc.errno != errno.ENOENT:
                    logging.warning(
                        'lsb_release failed, using defaults:' % exc)
                dist = "Debian"

        self.dist = dist

Based on $dist and, in other parts of the code, the release name (squeeze, wheezy, jessie) deb and deb-src APT source lines are being constructed which leads to errors in the case of $dist=BunsenLabs and $release=Hydrogen.

The code overall is a Pythonian mess, and considering there are no problems with Debian itself, I doubt a patch would be accepted into Jessie.

IMHO we shouldn't care about this bug/defienciency since the program is not a standard tool, not a Debian tool (it comes from Ubuntu) and the current bunsen-os-release files follow the specification.

Should the team however decide to minimize even the risk of breaking other software because of wrong or short-sighted assumption the respective authors have made, we could keep lsb-release as /etc/bunsenlabs-lsb-release: Code in screenfetch indicates that crunchbang was doing the same:

if [[ -f /etc/crunchbang-lsb-release || -f /etc/lsb-release-crunchbang ]]; then
                        distro="CrunchBang"
                        distro_release=$(awk -F'=' '/^DISTRIB_RELEASE=/ {print $2}' /etc/lsb-release-crunchbang)
                        distro_codename=$(awk -F'=' '/^DISTRIB_DESCRIPTION=/ {print $2}' /etc/lsb-release-crunchbang)

(although the code is crap).

I would keep os-release since its spec already addresses the current problem:

ID=bunsenlabs
ID_LIKE="debian"

That basicaly defines a hierarchy debian->bunsenlabs. Every program handling os-release should implement its spec; if it doesn't it's broken.

johnraff commented 9 years ago

OK did some more testing - to answer some of your questions:

Synaptics works.

The presence of a custom /etc/os-release is no problem.


In /etc/lsb-release: Man lsb_release says

If the installation is LSB compliant, the "/etc/lsb-release" file should contain the LSB_VERSION field

but installing lsb-core and adding such a line has no effect either way.


DISTRIB_ID="Debian" DISTRIB_CODENAME="jessie" These lines may be absent, but, if present, must contain the accepted values you mentioned.


DISTRIB_DESCRIPTION="BunsenLabs GNU/Linux 8 (Hydrogen)" DISTRIB_RELEASE="8" LSB_VERSION="security-4.0-ia32:security-4.0-noarch:security-4.1-ia32:security-4.1-noarch" These lines are ignored and may contain any value.


So, if all lines are removed from /etc/lsb-version except: DISTRIB_DESCRIPTION="BunsenLabs GNU/Linux 8 (Hydrogen)" then sotware -properties-gtk will work, and lsb_version -a will output:

john@bunsen:~$ lsb_release -a
LSB Version:    security-4.0-ia32:security-4.0-noarch:security-4.1-ia32:security-4.1-noarch
Distributor ID: Debian
Description:    BunsenLabs GNU/Linux 8 (Hydrogen)
Release:    8
Codename:   jessie

(The LSB Version output is a relic of installing, then purging, lsb-core.) So the Description field has been successfully changed, but not the Distributor ID.


A bit more research found /usr/share/python-apt/templates/debian.info which comes with python-apt-common. ( http://forums.linuxmint.com/viewtopic.php?f=46&t=31976 ) cp debian.info BunsenLabs.info (no editing needed) and now we can have DISTRIB_ID="BunsenLabs" and lsb_version -a outputs:

Distributor ID: BunsenLabs
Description:    BunsenLabs GNU/Linux 8 (Hydrogen)
Release:    8.0
Codename:   jessie

I haven't been able to find any way of editing the DISTRIB_CODENAME field without breaking software-properties-gtk, so the lsb-release file could be:

DISTRIB_ID="BunsenLabs"
DISTRIB_DESCRIPTION="BunsenLabs GNU/Linux 8 (Hydrogen)"

I don't know if that would be an acceptable compromise? It would mean adding the extra file /usr/share/python-apt/templates/BunsenLabs.info. If that extra file is felt to be overkill then the single DISTRIB_DESCRIPTION line would at least output some useful information with lsb_release.

It would be possible (from the point of view of this bug, anyway) to add DISTRIB_RELEASE="Hydrogen" but substituting a string for a number might break something else...

johnraff commented 9 years ago

Another solution is to install the full files, and post instructions on the BunsenLabs forums, and perhaps with this package too, on how to deal with problems with software-properties-gtk.

I have added this package to the bunsen-netinstall script's install list.

ghost commented 9 years ago

Thank you for going forward with this; I've been pretty undecided about the issue. But I'll have another look at the .info file thing again, maybe it should get bunsenfied, too.

ghost commented 9 years ago

Since it appears that the current state is OK, I'm closing this.

johnraff commented 9 years ago

Sorry, I've been away, but I don't think the current state is really OK, in that the /etc/lsb-release file installed by this package continues to break software-properties-gtk.

Regardless of who is in the wrong here, the users are presented with a reduction in usablility. Do they gain anything in return by having the customized lsb-release file? If modern programs are referring to os-release instead is there in fact any need for lsb-release?

Or, as I suggested above, maybe this package could ship a truncated lsb-release containing only DISTRIB_DESCRIPTION="BunsenLabs GNU/Linux 8.1 (Hydrogen)" ?

ghost commented 9 years ago

In my opinion software-properties-{gtk,kde} breaking should be disregarded as their faulty repository handling code is the sole problem here, their python library is simply broken. synaptic continues to work just fine (even the repository editor) and shows that, as it should, lsb-release information is no reason to stop working on/with apt repositories. Surely it's no solution to work around broken software somebody just happens to use, even more so given the fact that software-properties-gtk is Ubuntu software.

2015-07-02-143001_1920x1080_scrot

johnraff commented 9 years ago

@2ion I do appreciate your point of view here. It's infuriating to feel obliged to do extra work, or compromise functionality, just because someone else has failed to implement standards properly.

Surely it's no solution to work around broken software somebody just happens to use

Ah... around 15 years ago I was working on a website and discovering the joys of writing css code that would work with Internet Explorer 6 ( forgetting the horrific Netscape 4 ) Not only were some css properties that worked in Firefox or Opera simply not supported in IE6, but code that IE6 was supposed to support was interpreted wrongly.

Just dismissing IE6 as broken software that some people "happened to use" was not an option. A big percentage of my visitors were using IE6, and would simply decide that my page was broken and not that there was a problem with their browser. The only choice was to grit your teeth, avoid code that wouldn't work in IE6, and implement workarounds (like "conditional comments") that would get the page displaying OK in all browsers without sacrificing standards compliance. It was a lot of extra work, thanks to Microsoft's (possibly deliberate) failure to support web standards. (Microsoft was universally loathed by web developers in those days.)

My point is that some users might want to use software-properties-gtk. It's not a totally useless app. I have used it myself in the past.

software-properties-gtk is Ubuntu software.

Sorry, I don't understand this point. It's in the Debian repositories. There's no warning noticed attached. ( Is synaptics also "Ubuntu software"? )

synaptic continues to work just fine (even the repository editor)

With the customized lsb-release file, synaptics works but if software-properties-gtk is installed then the repository editor does not work.

OK so my question is, given that the custom os-release file is causing no problems, what advantages does the user get from installing the fully customized BunsenLabs lsb-release file?

The workaround I suggest is omitting three lines from the file, so it's not really a question of having to do a lot of extra work, so much as what functionality would be lost from bunsen-os-release by dropping those lines.

johnraff commented 9 years ago

To answer my own question:

what advantages does the user get from installing the fully customized BunsenLabs lsb-release file?

From Jessie, /etc/default/grub has this line by default:

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

So "BunsenLabs" appears in the Grub menu. I suppose this could be considered an advantage, so let's close this issue. We can post a howto for users who want to install software-properties-gtk.