diff tests/ports.t @ 791:1ffb4e15151d

ports.subr: Determine the existence of a local index file (from INDEXDIR or PORTSDIR). The algorithm follows the behaviour of pkg-version(8) with regard to SOURCE_VERSION.
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 29 Oct 2024 22:44:49 +0100
parents 56ab5c012d5f
children 954d3607e87d
line wrap: on
line diff
--- a/tests/ports.t	Tue Oct 29 21:00:28 2024 +0100
+++ b/tests/ports.t	Tue Oct 29 22:44:49 2024 +0100
@@ -59,6 +59,34 @@
   [1]
 
 
+Local Index File
+================
+
+Assumes fag's standard: PORTSDIR=/home/fag/ports
+
+  $ is_local_index_file_available
+  $ PORTSDIR=/nonexisting is_local_index_file_available
+  [1]
+  $ export VERSION_SOURCE=I
+  $ is_local_index_file_available
+  [1]
+  $ export VERSION_SOURCE=P
+  $ is_local_index_file_available
+  $ unset VERSION_SOURCE
+
+  $ get_local_index_file
+  /home/fag/ports/INDEX-[0-9]+ \(no-eol\) (re)
+  $ PORTSDIR=/nonexisting get_local_index_file
+  [1]
+  $ export VERSION_SOURCE=I
+  $ get_local_index_file
+  [1]
+  $ export VERSION_SOURCE=P
+  $ get_local_index_file
+  /home/fag/ports/INDEX-[0-9]+ \(no-eol\) (re)
+  $ unset VERSION_SOURCE
+
+
 Repositories
 ============