From mboxrd@z Thu Jan 1 00:00:00 1970 From: Quiliro Ordonez Baca Subject: bug#29365: openmolar looking in /usr/share/openmolar Date: Wed, 20 Dec 2017 15:11:32 -0500 Message-ID: <87po79rwgb.fsf@portkomputilo.i-did-not-set--mail-host-address--so-tickle-me> References: <878tf0x3bq.fsf@riseup.net> <87tvxmfyf4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRkil-0000CX-B7 for bug-guix@gnu.org; Wed, 20 Dec 2017 15:12:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRkig-0003IV-PH for bug-guix@gnu.org; Wed, 20 Dec 2017 15:12:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRkig-0003ID-JQ for bug-guix@gnu.org; Wed, 20 Dec 2017 15:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eRkig-0005eE-Cj for bug-guix@gnu.org; Wed, 20 Dec 2017 15:12:02 -0500 In-Reply-To: <878tf0x3bq.fsf@riseup.net> Sender: "Debbugs-submit" Resent-Message-ID: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Chris Marusich Cc: 29365@debbugs.gnu.org Chris Marusich writes: > Quiliro Ordonez Baca writes: > >> When starting OpenMolar for the first time, it has an error when it >> creates the application database: >> >> ERROR - error creating database tables >> Traceback (most recent call last): >> File "/gnu/store/smx5rayf45ylqn59czjkvx2hcrl95p5x-openmolar-1.0.15-gd81f9e5/lib/python3.5/site-packages/openmolar/create_db.py", line 145, in create_tables >> f = open(fp, "r") >> FileNotFoundError: [Errno 2] No existe el fichero o el directorio: '/usr/share/openmolar/resources/schema.sql' >> >> when it should look for the following file: >> /gnu/store/smx5rayf45ylqn59czjkvx2hcrl95p5x-openmolar-1.0.15-gd81f9e5/share/openmolar/resources/schema.sql >> >> The flaw in the definition is in: >> /gnu/store/smx5rayf45ylqn59czjkvx2hcrl95p5x-openmolar-1.0.15-gd81f9e5/lib/python3.5/site-packages/openmolar/settings/localsettings.py: SHARE_DIR = os.path.join("/usr", "share", "openmolar") >> >> I do not know haw to fix it. Please instruct how to do it. > > Based on your assessment, it looks like the problem is that the > application hard-codes the "/usr" directory path. Yes. > One solution for this problem is to replace that line of code in the > source with the correct path. You can do this in the package definition > by using the substitute* macro provided by the (guix build utils) > module. In fact, it looks like the current package definition for > openmolar already attempts to do this. Run "guix edit openmolar" to > view the current package definition. Exactly. It already attempts to do that in: (arguments `(#:use-setuptools? #f #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-/usr (lambda* (#:key outputs #:allow-other-keys) (substitute* "setup.py" (("/usr") (assoc-ref outputs "out"))) #t))))) > Perhaps you could modify the package definition to also replace the path > in localsettings.py? You might also want to look around in the source > for other paths that need to be fixed (a command such as "grep -r /usr" > might be helpful). $ grep -R /usr lib/python3.5/site-packages/openmolar/dbtools/records_in_use.py:#! /usr/bin/env p lib/python3.5/site-packages/openmolar/settings/localsettings.py: SHARE_DIR = os.path.join("/usr", "share", "openmolar") Coincidencia en el fichero binario lib/python3.5/site-packages/openmolar/settings/__pycache__/localsettings.cpython-35.pyc openmolar has three dependencies: python-pyqt+sqcintilla python-mysqlclient qscintilla But only python-pyqt+sqcintilla files have /usr on them (besides openmolar's). Perhaps the problem is that package definition. But I cannot figure how to do it yet. > For information on how to use substitute*, please refer to > guix/build/utils.scm in the Guix source tree. For general information > on hacking on Guix, check the section titled "Contributing" in the > manual (e.g., run info '(guix) Contributing' in a terminal). I find that it is needed to download the source. But I do not have a connection to the web. I have to travel 1 hour every time I need to connect. Is there any way i can use Emacs to have all necesary files for hacking on Guix?