[PATCH 0/3] gnu: Add pass-import.

  • Open
  • quality assurance status badge
Details
4 participants
  • Abhishek Cherath
  • Jelle Licht
  • Jonathan Brielmaier
  • Tobias Kortkamp
Owner
unassigned
Submitted by
Tobias Kortkamp
Severity
normal
T
T
Tobias Kortkamp wrote on 12 Dec 2022 12:46
(address . guix-patches@gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
cover.1670844319.git.tobias.kortkamp@gmail.com
Hi,

this add pass-import which was useful for migrating from keepassxc to
pass. python-pykeepass needed to be updated which in turn required a newer
python-construct.

Best regards,

Tobias Kortkamp (3):
gnu: python-construct: Update to 2.10.68.
gnu: python-pykeepass: Update to 4.0.3.
gnu: Add pass-import.

gnu/packages/password-utils.scm | 71 +++++++++++++++++++++++++++++++++
gnu/packages/python-crypto.scm | 6 +--
gnu/packages/python-xyz.scm | 4 +-
3 files changed, 76 insertions(+), 5 deletions(-)


base-commit: 2d989ad59793e10c6fef94d9eaa51be91469318a
--
2.38.1
T
T
Tobias Kortkamp wrote on 12 Dec 2022 12:49
[PATCH 1/3] gnu: python-construct: Update to 2.10.68.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
3077dc45b27442b028e4a4fc42a3c685b12c2e58.1670844319.git.tobias.kortkamp@gmail.com
* gnu/packages/python-xyz.scm (python-construct): Update to 2.10.68.
---
gnu/packages/python-xyz.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a9b123d4c2..3af1dbb70d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24304,14 +24304,14 @@ (define-public python-attr
(define-public python-construct
(package
(name "python-construct")
- (version "2.10.56")
+ (version "2.10.68")
(source
(origin
(method url-fetch)
(uri (pypi-uri "construct" version))
(sha256
(base32
- "0q86jjzsvy835h3c8pjj4619vbp7ihfg8njmyw86ym4qrpni7flp"))))
+ "0icb7pr6xv5fz8g2miq42yq5s1ps2vaknk313nmab5zmwpc3yakv"))))
(build-system python-build-system)
(arguments
`(#:tests? #f)) ; No tests exist.
--
2.38.1
T
T
Tobias Kortkamp wrote on 12 Dec 2022 12:49
[PATCH 2/3] gnu: python-pykeepass: Update to 4.0.3.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
cb30f1d8c6815f8384ebf3e877a4b8fc6b106e01.1670844319.git.tobias.kortkamp@gmail.com
* gnu/packages/python-crypto.scm (python-pykeepass): Update to 4.0.3.
---
gnu/packages/python-crypto.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index c9071c4cf6..c356bdfea6 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -1134,17 +1134,17 @@ (define-public python-m2crypto
(define-public python-pykeepass
(package
(name "python-pykeepass")
- (version "3.2.1")
+ (version "4.0.3")
(source
(origin
(method git-fetch)
;; Source tarball on PyPI doesn't include tests.
(uri (git-reference
(url "https://github.com/libkeepass/pykeepass")
- (commit version)))
+ (commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1symxf4ahylynihnp9z4z3lh2vy65ipvg8s4hjrnn936hcaaxghk"))))
+ (base32 "1zkdzsm1fi0c8h7zy5k0rj3c24i9kam85kwdl5bf3m0x3c2dwaqz"))))
(build-system python-build-system)
(arguments
`(#:phases
--
2.38.1
T
T
Tobias Kortkamp wrote on 12 Dec 2022 12:49
[PATCH 3/3] gnu: Add pass-import.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
fd7915fd85f98a5c55d8099f92122e6ce8f5c0c0.1670844319.git.tobias.kortkamp@gmail.com
* gnu/packages/password-utils.scm (pass-import): New variable.
---
gnu/packages/password-utils.scm | 71 +++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)

Toggle diff (95 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index aab0a3f2a4..79781ed9e6 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -38,6 +38,7 @@
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -101,6 +102,7 @@ (define-module (gnu packages password-utils)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages readline)
@@ -1492,3 +1494,72 @@ (define-public xkcdpass
license:lgpl2.0 ;finnish word list
license:lgpl2.1 ;portuguese word list
license:mpl1.1)))) ;portuguese word list
+
+(define-public pass-import
+ (package
+ (name "pass-import")
+ (version "3.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/roddhjav/pass-import"
+ "/releases/download/" version "/pass-import-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "18vh97h3bmspwqhb9xjkapk3p8hy4rxhazrcc06f6pdz8rb6rxxp"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("import.bash")
+ (("python3")
+ #$(file-append python-wrapper "/bin/python")))
+ (substitute* '("setup.py")
+ (("base = '/usr'")
+ (string-append "base = '" #$output "'"))
+ (("sys\\.prefix")
+ (string-append "'" #$output "'")))
+ (substitute* '("tests/imports/test_parse.py")
+ ;; requires running D-Bus session
+ (("test_import_gnome_keyring") "disabled_test_import_gnome_keyring")
+ ;; requires lastpass
+ (("test_import_lastpass") "disabled_test_import_lastpass"))
+ (substitute* '("tests/exports/test_lastpass.py")
+ (("test_import_lastpass") "disabled_test_import_lastpass")
+ (("test_lastpass_exist") "disabled_test_lastpass_exist")
+ (("test_lastpass_insert") "disabled_test_lastpass_insert")
+ (("test_lastpass_show") "disabled_test_lastpass_show")
+ (("test_lastpass_list") "disabled_test_lastpass_list")
+ (("test_lastpass_isvalid") "disabled_test_lastpass_isvalid"))))
+ (add-after 'install 'wrap-extension
+ (lambda _
+ (let ((pylib (string-append #$output "/lib/python"
+ #$(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (extension (string-append #$output
+ "/lib/password-store/extensions/import.bash")))
+ (wrap-program extension
+ (list "GUIX_PYTHONPATH" ":"
+ 'prefix
+ (list (getenv "GUIX_PYTHONPATH")
+ pylib)))))))))
+ (inputs (list gnupg
+ password-store
+ python-cryptography
+ python-defusedxml
+ python-magic
+ python-pyaml
+ python-pykeepass
+ python-requests
+ python-secretstorage
+ python-zxcvbn))
+ (home-page "https://github.com/roddhjav/pass-import")
+ (synopsis
+ "Pass extension for importing data from many password managers")
+ (description
+ "This package provides a pass extension for importing data from many password
+managers. @command{pimport} can be used to export data to other password managers
+like gopass or keepassxc too.")
+ (license license:gpl3+)))
--
2.38.1
J
J
Jelle Licht wrote on 5 Jan 2023 16:21
878rih2eje.fsf@fsfe.org
Hello Tobias,

Tobias Kortkamp <tobias.kortkamp@gmail.com> writes:

Toggle quote (38 lines)
> * gnu/packages/password-utils.scm (pass-import): New variable.
> ---
> gnu/packages/password-utils.scm | 71 +++++++++++++++++++++++++++++++++
> 1 file changed, 71 insertions(+)
>
> diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
> index aab0a3f2a4..79781ed9e6 100644
> --- a/gnu/packages/password-utils.scm
> +++ b/gnu/packages/password-utils.scm
> @@ -38,6 +38,7 @@
> ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
> ;;; Copyright © 2022 ( <paren@disroot.org>
> ;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
> +;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -101,6 +102,7 @@ (define-module (gnu packages password-utils)
> #:use-module (gnu packages perl)
> #:use-module (gnu packages pkg-config)
> #:use-module (gnu packages python)
> + #:use-module (gnu packages python-crypto)
> #:use-module (gnu packages python-web)
> #:use-module (gnu packages python-xyz)
> #:use-module (gnu packages readline)
> @@ -1492,3 +1494,72 @@ (define-public xkcdpass
> license:lgpl2.0 ;finnish word list
> license:lgpl2.1 ;portuguese word list
> license:mpl1.1)))) ;portuguese word list
> +
> +(define-public pass-import
> + (package
> + (name "pass-import")
> + (version "3.4")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/roddhjav/pass-import"
> + "/releases/download/" version "/pass-import-"
You missed a "v" here; could you make it "download/v" instead? That works for
me, with the provided base32 hash.

Toggle quote (13 lines)
> + version ".tar.gz"))
> + (sha256
> + (base32 "18vh97h3bmspwqhb9xjkapk3p8hy4rxhazrcc06f6pdz8rb6rxxp"))))
> + (build-system python-build-system)
> + (arguments
> + (list #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'patch-paths
> + (lambda* (#:key inputs #:allow-other-keys)
> + (substitute* '("import.bash")
> + (("python3")
> + #$(file-append python-wrapper "/bin/python")))

Perhaps someone more experienced with our python-packages can still
weigh in, but wouldn't the following work here as well?

Toggle snippet (4 lines)
(("python3")
(search-input-file inputs "/bin/python3")))

Toggle quote (18 lines)
> + (substitute* '("setup.py")
> + (("base = '/usr'")
> + (string-append "base = '" #$output "'"))
> + (("sys\\.prefix")
> + (string-append "'" #$output "'")))
> + (substitute* '("tests/imports/test_parse.py")
> + ;; requires running D-Bus session
> + (("test_import_gnome_keyring") "disabled_test_import_gnome_keyring")
> + ;; requires lastpass
> + (("test_import_lastpass") "disabled_test_import_lastpass"))
> + (substitute* '("tests/exports/test_lastpass.py")
> + (("test_import_lastpass") "disabled_test_import_lastpass")
> + (("test_lastpass_exist") "disabled_test_lastpass_exist")
> + (("test_lastpass_insert") "disabled_test_lastpass_insert")
> + (("test_lastpass_show") "disabled_test_lastpass_show")
> + (("test_lastpass_list") "disabled_test_lastpass_list")
> + (("test_lastpass_isvalid") "disabled_test_lastpass_isvalid"))))

Nit: in this phase you seem to patch paths and disable tests. Consider splitting
it up into two phases.

I still run into some test failures:
Toggle snippet (14 lines)
Ran 135 tests in 12.145s

FAILED (failures=6, errors=1, skipped=10)
Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
error: Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
Password-pwned-1
Password-pwned-2
Password-pwned-3
Password-pwned-4
Password-pwned-5
Password-pwned-6
Password-pwned-7

Toggle quote (9 lines)
> + (add-after 'install 'wrap-extension
> + (lambda _
> + (let ((pylib (string-append #$output "/lib/python"
> + #$(version-major+minor
> + (package-version python))
> + "/site-packages"))
> + (extension (string-append #$output
> + "/lib/password-store/extensions/import.bash")))

This line seems to make `./pre-inst-env guix lint pass-import' unhappy,
as it is too wide.

Toggle quote (23 lines)
> + (wrap-program extension
> + (list "GUIX_PYTHONPATH" ":"
> + 'prefix
> + (list (getenv "GUIX_PYTHONPATH")
> + pylib)))))))))
> + (inputs (list gnupg
> + password-store
> + python-cryptography
> + python-defusedxml
> + python-magic
> + python-pyaml
> + python-pykeepass
> + python-requests
> + python-secretstorage
> + python-zxcvbn))
> + (home-page "https://github.com/roddhjav/pass-import")
> + (synopsis
> + "Pass extension for importing data from many password managers")
> + (description
> + "This package provides a pass extension for importing data from many password
> +managers. @command{pimport} can be used to export data to other password managers
> +like gopass or keepassxc too.")

Consider removing superfluous 'too'.

Thanks again!
- Jelle
T
T
Tobias Kortkamp wrote on 11 Jan 2023 12:55
(name . Jelle Licht)(address . jlicht@fsfe.org)(address . 60003@debbugs.gnu.org)
87r0w1452a.fsf@gmail.com
Hi Jelle,

thanks for the review. I addressed most of the problems.

Jelle Licht <jlicht@fsfe.org> writes:

Toggle quote (18 lines)
> I still run into some test failures:
>
> --8<---------------cut here---------------start------------->8---
> Ran 135 tests in 12.145s
>
> FAILED (failures=6, errors=1, skipped=10)
> Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
> error: Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
> Password-pwned-1
> Password-pwned-2
> Password-pwned-3
> Password-pwned-4
> Password-pwned-5
> Password-pwned-6
> Password-pwned-7
> --8<---------------cut here---------------end--------------->8---
>

Hmm, I can't reproduce this on a8b2decf287498eeb51ef23712c5bd01b60cb18b

Not sure what's going on here.
T
T
Tobias Kortkamp wrote on 11 Jan 2023 13:44
[PATCH 3/3] gnu: Add pass-import.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
da8c6ad0bb8acddc1126d09adb562f5ac676c8e3.1673440963.git.tobias.kortkamp@gmail.com
* gnu/packages/password-utils.scm (pass-import): New variable.
---
gnu/packages/password-utils.scm | 72 +++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)

Toggle diff (96 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 9fc41d9b0a..f84e80e9cb 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -38,6 +38,7 @@
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -101,6 +102,7 @@ (define-module (gnu packages password-utils)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages readline)
@@ -1493,3 +1495,73 @@ (define-public xkcdpass
license:lgpl2.0 ;finnish word list
license:lgpl2.1 ;portuguese word list
license:mpl1.1)))) ;portuguese word list
+
+(define-public pass-import
+ (package
+ (name "pass-import")
+ (version "3.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/roddhjav/pass-import"
+ "/releases/download/v" version "/pass-import-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "18vh97h3bmspwqhb9xjkapk3p8hy4rxhazrcc06f6pdz8rb6rxxp"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("import.bash")
+ (("python3")
+ (search-input-file inputs "/bin/python3")))
+ (substitute* '("setup.py")
+ (("base = '/usr'")
+ (string-append "base = '" #$output "'"))
+ (("sys\\.prefix")
+ (string-append "'" #$output "'")))))
+ (add-after 'install 'wrap-extension
+ (lambda _
+ (let ((pylib (string-append #$output "/lib/python"
+ #$(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (extension "/lib/password-store/extensions/import.bash"))
+ (wrap-program (string-append #$output extension)
+ (list "GUIX_PYTHONPATH" ":"
+ 'prefix
+ (list (getenv "GUIX_PYTHONPATH")
+ pylib))))))
+ (add-before 'check 'disable-lastpass-and-dbus-tests
+ (lambda _
+ (substitute* '("tests/imports/test_parse.py")
+ ;; requires running D-Bus session
+ (("test_import_gnome_keyring") "disabled_test_import_gnome_keyring")
+ ;; requires lastpass
+ (("test_import_lastpass") "disabled_test_import_lastpass"))
+ (substitute* '("tests/exports/test_lastpass.py")
+ (("test_import_lastpass") "disabled_test_import_lastpass")
+ (("test_lastpass_exist") "disabled_test_lastpass_exist")
+ (("test_lastpass_insert") "disabled_test_lastpass_insert")
+ (("test_lastpass_show") "disabled_test_lastpass_show")
+ (("test_lastpass_list") "disabled_test_lastpass_list")
+ (("test_lastpass_isvalid") "disabled_test_lastpass_isvalid")))))))
+ (inputs (list gnupg
+ password-store
+ python-cryptography
+ python-defusedxml
+ python-magic
+ python-pyaml
+ python-pykeepass
+ python-requests
+ python-secretstorage
+ python-zxcvbn))
+ (home-page "https://github.com/roddhjav/pass-import")
+ (synopsis
+ "Pass extension for importing data from many password managers")
+ (description
+ "This package provides a pass extension for importing data from many password
+managers. @command{pimport} can be used to export data to other password managers
+like gopass or keepassxc.")
+ (license license:gpl3+)))
--
2.38.1
J
J
Jelle Licht wrote on 2 Feb 2023 14:13
(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)(address . 60003@debbugs.gnu.org)
87fsboi524.fsf@fsfe.org
Hi Tobias,

Tobias Kortkamp <tobias.kortkamp@gmail.com> writes:

Toggle quote (4 lines)
> Hi Jelle,
>
> thanks for the review. I addressed most of the problems.

Great to hear! Any chance you could share it ;-)?

Toggle quote (23 lines)
>
> Jelle Licht <jlicht@fsfe.org> writes:
>
>> I still run into some test failures:
>>
>> --8<---------------cut here---------------start------------->8---
>> Ran 135 tests in 12.145s
>>
>> FAILED (failures=6, errors=1, skipped=10)
>> Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
>> error: Test failed: <unittest.runner.TextTestResult run=135 errors=1 failures=6>
>> Password-pwned-1
>> Password-pwned-2
>> Password-pwned-3
>> Password-pwned-4
>> Password-pwned-5
>> Password-pwned-6
>> Password-pwned-7
>> --8<---------------cut here---------------end--------------->8---
>>
>
> Hmm, I can't reproduce this on a8b2decf287498eeb51ef23712c5bd01b60cb18b

This should be picked up by our QA system if you send a revised patch
series, I think, so we'll be able to tell if the problem is just on my
end or not.

Kind regards,
- Jelle
J
J
Jonathan Brielmaier wrote on 3 Feb 2023 18:25
[PATCH 0/3] gnu: Add pass-import.
(address . 60003@debbugs.gnu.org)
c0c4a768-0110-44da-2906-63382050df96@web.de
I see this test failure(s) as well. Additionaly I required this diff to
get it start building:

Toggle diff (20 lines)
diff --git a/gnu/packages/password-utils.scm
b/gnu/packages/password-utils.scm
index 0fdfccaa5b..f8a0b6a40c 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -1535,7 +1535,7 @@ (define-public pass-import
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/roddhjav/pass-import"
- "/releases/download/" version
"/pass-import-"
+ "/releases/download/v" version
"/pass-import-"
version ".tar.gz"))
(sha256
(base32
"18vh97h3bmspwqhb9xjkapk3p8hy4rxhazrcc06f6pdz8rb6rxxp"))))

I further recommend to use the `git-fetch` method in this case...
T
T
Tobias Kortkamp wrote on 22 May 2023 11:45
[PATCH v2 1/2] gnu: python-pykeepass: Update to 4.0.4.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
88ef10732de65df4d429462766c443603960571e.1684748692.git.tobias.kortkamp@gmail.com
* gnu/packages/python-crypto.scm (python-pykeepass): Update to 4.0.4.
---
gnu/packages/python-crypto.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (29 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index b1d94e85b8..16cfb440cb 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -1025,17 +1025,17 @@ (define-public python-m2crypto
(define-public python-pykeepass
(package
(name "python-pykeepass")
- (version "3.2.1")
+ (version "4.0.4")
(source
(origin
(method git-fetch)
;; Source tarball on PyPI doesn't include tests.
(uri (git-reference
(url "https://github.com/libkeepass/pykeepass")
- (commit version)))
+ (commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1symxf4ahylynihnp9z4z3lh2vy65ipvg8s4hjrnn936hcaaxghk"))))
+ (base32 "0s5n519vxnx06kj9g6clfpfzgprhg71p1jswskajd7n9zwixlqxk"))))
(build-system python-build-system)
(arguments
`(#:phases

base-commit: 849286ba66c96534bddc04df1a47d5692cbc977e
--
2.40.1
T
T
Tobias Kortkamp wrote on 22 May 2023 11:45
[PATCH v2 2/2] gnu: Add pass-import.
(address . 60003@debbugs.gnu.org)(name . Tobias Kortkamp)(address . tobias.kortkamp@gmail.com)
d77bed491567d42c02f312d8916ff22489e6a243.1684748692.git.tobias.kortkamp@gmail.com
* gnu/packages/password-utils.scm (pass-import): New variable.
---
gnu/packages/password-utils.scm | 72 +++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)

Toggle diff (96 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index f5f301308a..7805af6ffe 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -39,6 +39,7 @@
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 Tobias Kortkamp <tobias.kortkamp@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -103,6 +104,7 @@ (define-module (gnu packages password-utils)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages rdesktop)
@@ -1523,3 +1525,73 @@ (define-public xkcdpass
license:lgpl2.0 ;finnish word list
license:lgpl2.1 ;portuguese word list
license:mpl1.1)))) ;portuguese word list
+
+(define-public pass-import
+ (package
+ (name "pass-import")
+ (version "3.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/roddhjav/pass-import"
+ "/releases/download/v" version "/pass-import-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "18vh97h3bmspwqhb9xjkapk3p8hy4rxhazrcc06f6pdz8rb6rxxp"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("import.bash")
+ (("python3")
+ (search-input-file inputs "/bin/python3")))
+ (substitute* '("setup.py")
+ (("base = '/usr'")
+ (string-append "base = '" #$output "'"))
+ (("sys\\.prefix")
+ (string-append "'" #$output "'")))))
+ (add-after 'install 'wrap-extension
+ (lambda _
+ (let ((pylib (string-append #$output "/lib/python"
+ #$(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (extension "/lib/password-store/extensions/import.bash"))
+ (wrap-program (string-append #$output extension)
+ (list "GUIX_PYTHONPATH" ":"
+ 'prefix
+ (list (getenv "GUIX_PYTHONPATH")
+ pylib))))))
+ (add-before 'check 'disable-lastpass-and-dbus-tests
+ (lambda _
+ (substitute* '("tests/imports/test_parse.py")
+ ;; requires running D-Bus session
+ (("test_import_gnome_keyring") "disabled_test_import_gnome_keyring")
+ ;; requires lastpass
+ (("test_import_lastpass") "disabled_test_import_lastpass"))
+ (substitute* '("tests/exports/test_lastpass.py")
+ (("test_import_lastpass") "disabled_test_import_lastpass")
+ (("test_lastpass_exist") "disabled_test_lastpass_exist")
+ (("test_lastpass_insert") "disabled_test_lastpass_insert")
+ (("test_lastpass_show") "disabled_test_lastpass_show")
+ (("test_lastpass_list") "disabled_test_lastpass_list")
+ (("test_lastpass_isvalid") "disabled_test_lastpass_isvalid")))))))
+ (inputs (list gnupg
+ password-store
+ python-cryptography
+ python-defusedxml
+ python-magic
+ python-pyaml
+ python-pykeepass
+ python-requests
+ python-secretstorage
+ python-zxcvbn))
+ (home-page "https://github.com/roddhjav/pass-import")
+ (synopsis
+ "Pass extension for importing data from many password managers")
+ (description
+ "This package provides a pass extension for importing data from many password
+managers. @command{pimport} can be used to export data to other password managers
+like gopass or keepassxc.")
+ (license license:gpl3+)))
--
2.40.1
T
T
Tobias Kortkamp wrote on 22 May 2023 11:48
Re: [bug#60003] [PATCH 0/3] gnu: Add pass-import.
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
87zg5witd4.fsf@gmail.com
I rebased the patch. python-construct was already updated to 2.10.68 in
the mean time. Maybe QA will catch the test failures.

Though if either of you happen to try to build this again can you send
me the full build log?

Toggle quote (2 lines)
> I further recommend to use the `git-fetch` method in this case...

Maybe after we can fix the test failures because that would mean pulling
in pandoc to build the manuals etc.
A
A
Abhishek Cherath wrote on 18 Apr 20:52 +0200
Built docs using pandoc
(address . 60003@debbugs.gnu.org)
87h6fy8pvy.fsf@quic.us
Hello!

So I somehow missed this patch, and wrote my own here:

I've used git-fetch, and built the man pages etc

There's a bunch of tests that don't pass though, as I recall most were
some serialization thing.

I've not seen any impact on operation yet, however.

Sincerely,
Abhishek Cherath.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 60003@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 60003
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch