From f54f2aa9df5047b348ca104f5145af50c1a482f6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 14 Mar 2022 18:20:31 +0100 Subject: packages: Add 'package-unique-version-prefix'. * gnu/packages.scm (package-unique-version-prefix): New procedure. * guix/scripts/package.scm (manifest-entry-version-prefix): Use it. * tests/packages.scm ("package-unique-version-prefix, gcc@8") ("package-unique-version-prefix, grep"): New tests. --- tests/packages.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/packages.scm') diff --git a/tests/packages.scm b/tests/packages.scm index 710eace6dc6..6cbc34ba0b6 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1923,6 +1923,19 @@ (package-location (specification->package "guile@2")) (specification->location "guile@2")) +(test-equal "package-unique-version-prefix, gcc@8" + "8" + (let ((gcc (specification->package "gcc-toolchain@8"))) + (package-unique-version-prefix (package-name gcc) + (package-version gcc)))) + +(test-equal "package-unique-version-prefix, grep" + "" + (let ((grep (specification->package "grep"))) + (package-unique-version-prefix (package-name grep) + (package-version grep)))) + + (test-eq "this-package-input, exists" hello (package-arguments -- cgit v1.2.3