From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: gnome-tweak-tool tweaks Date: Sun, 12 Jun 2016 21:42:44 +0200 Message-ID: <871t42kxcb.fsf@gnu.org> References: <87wpm23l2w.fsf@gnu.org> <87ziqt2pvo.fsf@gnu.org> <87y46cpeq4.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCBHl-00039X-F6 for guix-devel@gnu.org; Sun, 12 Jun 2016 15:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCBHi-0007gd-8Q for guix-devel@gnu.org; Sun, 12 Jun 2016 15:43:05 -0400 In-Reply-To: <87y46cpeq4.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Sat, 11 Jun 2016 11:49:07 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> [...] >> >>> I/O error : Permission denied >>> I/O error : Permission denied >>> Failed to write XML file; For permission problems, try rerunning as root >> >> I found that string comes from =E2=80=98shared-mime-info=E2=80=99, which= is itself used >> by the =E2=80=98xdg-mime-database=E2=80=99 hook in (guix profiles) (a ho= ok that runs >> when the profile is created to update the MIME database): >> >> static gboolean save_xml_file(xmlDocPtr doc, const gchar *filename, GErr= or **error) >> { >> #if LIBXML_VERSION > 20400 >> if (xmlSaveFormatFileEnc(filename, doc, "utf-8", 1) < 0) >> { >> g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_FAILED, >> "Failed to write XML file; For permission problems, try rerunning= as root"); >> return FALSE; >> } >> #else >> >> =E5=AE=8B=E6=96=87=E6=AD=A6: any idea what the problem might be? Perhaps >> =E2=80=98update-mime-database=E2=80=99 is trying to write to /gnu/store/= =E2=80=A6-something? > Yep, it happends when '$out/share/mime/application' is not writable. > The xml files under 'application' are going to be generated by > update-mime-database, and the shared-mime-info package has it > pre-generated, so after union "share/mime", an un-writable 'application' > directory point to the store will cause the problem. > > Commit 359f06aa fix this by union the "share/mime/packages" directory. OK, thanks for the quick (brown?) fix! >> Also, it=E2=80=99s a problem that =E2=80=98update-mime-database=E2=80=99= returns 0 here, as >> seems to be the case. > It returns 256 here for the problem, but the derivation still built and > profile got updated, I have no idea about this :- > > Does a failing hook (returns #f) supposed to top the profile update? I thought it did, but it doesn=E2=80=99t: (gexp->derivation "foo" #~(begin (mkdir #$output) #f)) leads a derivation that succeeds, contrary to =E2=80=98build-expression->derivation=E2=80=99. To avoid that, we need an explicit (exit #f). For now I prefer to address it at every call site (patch below) instead of adding some magic to =E2=80=98gexp->derivation=E2=80=99, which would be = hard to do in a hygienic way. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -510,9 +510,9 @@ MANIFEST." info (string-append #$output "/share/info/dir")))) (mkdir-p (string-append #$output "/share/info")) - (every install-info + (exit (every install-info (append-map info-files - '#$(manifest-inputs manifest))))) + '#$(manifest-inputs manifest)))))) (gexp->derivation "info-dir" build #:modules '((guix build utils)) @@ -562,7 +562,7 @@ entries of MANIFEST, or #f if MANIFEST does not have any GHC packages." (system* (string-append #+ghc "/bin/ghc-pkg") "recache" (string-append "--package-db=" db-dir))))) (for-each delete-file (find-files db-dir "\\.conf$")) - success))) + (exit success)))) (with-monad %store-monad ;; Don't depend on GHC when there's nothing to do. @@ -710,7 +710,7 @@ MIME type." (mkdir-p (string-append #$output "/share")) (union-build destdir appdirs #:log-port (%make-void-port "w")) - (zero? (system* update-desktop-database destdir))))) + (exit (zero? (system* update-desktop-database destdir)))))) ;; Don't run the hook when 'desktop-file-utils' is not referenced. (if desktop-file-utils @@ -745,7 +745,7 @@ entries. It's used to query the MIME type of a given file." (union-build (string-append destdir "/packages") pkgdirs #:log-port (%make-void-port "w")) (setenv "XDG_DATA_HOME" datadir) - (zero? (system* update-mime-database destdir))))) + (exit (zero? (system* update-mime-database destdir)))))) ;; Don't run the hook when 'shared-mime-info' is referenced. (if shared-mime-info --=-=-=--