Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Guix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ogs
inf
Guix
Commits
d1c11608
Commit
d1c11608
authored
9 years ago
by
Ricardo Wurmus
Browse files
Options
Downloads
Patches
Plain Diff
import: Add package->upstream-name procedure.
* guix/import/cran.scm (package->upstream-name): New procedure.
parent
fe9451c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
guix/import/cran.scm
+23
-17
23 additions, 17 deletions
guix/import/cran.scm
with
23 additions
and
17 deletions
guix/import/cran.scm
+
23
−
17
View file @
d1c11608
...
@@ -204,27 +204,33 @@ (define (cran->guix-package package-name)
...
@@ -204,27 +204,33 @@ (define (cran->guix-package package-name)
;;; Updater.
;;; Updater.
;;;
;;;
(
define
(
package->upstream-name
package
)
"Return the upstream name of the PACKAGE."
(
let*
((
properties
(
package-properties
package
))
(
upstream-name
(
and=>
properties
(
cut
assoc-ref
<>
'upstream-name
))))
(
if
upstream-name
upstream-name
(
match
(
package-source
package
)
((
?
origin?
origin
)
(
match
(
origin-uri
origin
)
((
url
rest
...
)
(
let
((
end
(
string-rindex
url
#\_
))
(
start
(
string-rindex
url
#\/
)))
;; The URL ends on
;; (string-append "/" name "_" version ".tar.gz")
(
substring
url
start
end
)))
(
_
#f
)))
(
_
#f
)))))
(
define
(
latest-release
package
)
(
define
(
latest-release
package
)
"Return an <upstream-source> for the latest release of PACKAGE."
"Return an <upstream-source> for the latest release of PACKAGE."
(
define
(
package->cran-name
package
)
(
define
upstream-name
(
match
(
package-source
package
)
(
package->upstream-name
(
specification->package
package
)))
((
?
origin?
origin
)
(
match
(
origin-uri
origin
)
((
url
rest
...
)
(
let
((
end
(
string-rindex
url
#\_
))
(
start
(
string-rindex
url
#\/
)))
;; The URL ends on
;; (string-append "/" name "_" version ".tar.gz")
(
substring
url
start
end
)))
(
_
#f
)))
(
_
#f
)))
(
define
cran-name
(
package->cran-name
(
specification->package
package
)))
(
define
meta
(
define
meta
(
cran-fetch
cran
-name
))
(
cran-fetch
upstream
-name
))
(
and
meta
(
and
meta
(
let
((
version
(
assoc-ref
meta
"Version"
)))
(
let
((
version
(
assoc-ref
meta
"Version"
)))
...
@@ -232,7 +238,7 @@ (define meta
...
@@ -232,7 +238,7 @@ (define meta
(
upstream-source
(
upstream-source
(
package
package
)
(
package
package
)
(
version
version
)
(
version
version
)
(
urls
(
cran-uri
cran
-name
version
))))))
(
urls
(
cran-uri
upstream
-name
version
))))))
(
define
(
cran-package?
package
)
(
define
(
cran-package?
package
)
"Return true if PACKAGE is an R package from CRAN."
"Return true if PACKAGE is an R package from CRAN."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment