if guix build -e +;
then false; else true; fi
-# Should fail because this is a source-less package.
-if guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
-then false; else true; fi
+# Source-less packages are accepted; they just return nothing.
+guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
+test "`guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S`" = ""
# Should pass.
guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \
cat > "$module_dir/foo.scm"<<EOF
(define-module (foo)
+ #:use-module (guix tests)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system trivial))
(synopsis "Dummy package")
(description "bar is a dummy package for testing.")
(license #f)))
+
+(define-public baz
+ (dummy-package "baz" (replacement foo)))
+
+(define-public superseded
+ (deprecated-package "superseded" bar))
+
EOF
GUIX_PACKAGE_PATH="$module_dir"
guix build -d -S foo
guix build -d -S foo | grep -e 'foo\.tar\.gz'
+# 'baz' has a replacement so we should be getting the replacement's source.
+(unset GUIX_BUILD_OPTIONS;
+ test "`guix build -d -S baz`" = "`guix build -d -S foo`")
+
guix build -d --sources=package foo
guix build -d --sources=package foo | grep -e 'foo\.tar\.gz'
if guix build guile --with-input=libunistring=something-really-silly
then false; else true; fi
+# Deprecated/superseded packages.
+test "`guix build superseded -d`" = "`guix build bar -d`"
+
# Parsing package names and versions.
guix build -n time # PASS
guix build -n time@1.7 # PASS, version found
+guix build -n time-1.7 # PASS, deprecated version syntax
if guix build -n time@3.2; # FAIL, version not found
then false; else true; fi
if guix build -n something-that-will-never-exist; # FAIL