Commit 0020d1ac authored by Eric Timmons's avatar Eric Timmons
Browse files

Remove osicat

parent 4b99399b
......@@ -28,7 +28,6 @@
(:static-file "log4cl")
(:static-file "log4cl.NOTICE")
(:static-file "named-readtables")
(:static-file "osicat")
(:static-file "puri")
(:static-file "sbcl")
(:static-file "split-sequence")
......
Subproject commit 9cc248c09325c55ae05b3933b9292e8a14e69718
../ext/osicat/LICENSE
\ No newline at end of file
......@@ -11,8 +11,6 @@
#:getopt
#:remainder
#:help)
(:import-from #:osicat
#:environment)
(:export #:*bundle-arguments*
#:define-bundle-entry))
......@@ -72,7 +70,13 @@
(register-command "bundle" 'cli-bundle)
(defun merge-git-auth-config ()
(let* ((env (environment))
(let* ((env (mapcar (lambda (x)
(let* ((split (uiop:split-string (reverse x)
:max 2 :separator '(#\=)))
(name (reverse (second split)))
(value (reverse (first split))))
(cons name value)))
(sb-ext:posix-environ)))
(git-auth-vars (remove-if-not (curry #'starts-with-subseq "CLPM_BUNDLE_GIT_AUTH_")
env :key #'car))
(ht (make-hash-table :test 'equal
......
......@@ -2,8 +2,6 @@
(:use #:cl
#:alexandria
#:cffi)
(:import-from #:osicat
#:environment)
(:export #:execvpe))
(in-package #:clpm/execvpe)
......@@ -14,9 +12,12 @@
(envp :pointer))
(defun execvpe (file args env &optional augment-env-p)
(let ((env (append env (when augment-env-p (environment)))))
(let* ((env (mapcar (lambda (c)
(concatenate 'string (car c) "=" (cdr c)))
env))
(new-env (append env (when augment-env-p (sb-ext:posix-environ)))))
(with-foreign-objects ((foreign-args :pointer (+ 2 (length args)))
(foreign-env :pointer (+ 1 (length env))))
(foreign-env :pointer (+ 1 (length new-env))))
;; pack the args into foreign memory
(setf (mem-aref foreign-args :pointer 0) (foreign-string-alloc file))
......@@ -32,10 +33,10 @@
;; pack the environment variables into foreign memory
(loop
:for i :upfrom 0
:for (var-name . var-value) :in env
:for assignment :in new-env
:do
(setf (mem-aref foreign-env :pointer i)
(foreign-string-alloc (concatenate 'string var-name "=" var-value))))
(setf (mem-aref foreign-env :pointer (length env))
(foreign-string-alloc assignment)))
(setf (mem-aref foreign-env :pointer (length new-env))
(null-pointer))
(%execvpe file foreign-args foreign-env))))
......@@ -8,9 +8,6 @@
(:import-from #:uiop
#:read-file-form
#:with-safe-io-syntax)
#-os-windows
(:import-from #:osicat
#:file-permissions)
(:export #:ensure-file-fetched
#:fetch-url))
......@@ -23,8 +20,11 @@
#-os-windows
(defun pathname-executable-p (pathname)
(intersection '(:user-exec :group-exec :other-exec)
(file-permissions pathname)))
(let* ((stat (sb-posix:stat pathname))
(mode (sb-posix:stat-mode stat)))
(or (not (zerop (boole boole-and mode sb-posix:s-ixoth)))
(not (zerop (boole boole-and mode sb-posix:s-ixgrp)))
(not (zerop (boole boole-and mode sb-posix:s-ixusr))))))
#+os-windows
(defun pathname-executable-p (pathname)
......
(uiop:define-package #:clpm/utils
(:use #:cl)
(:import-from #:osicat)
(:export #:run-program-augment-env-args))
(in-package #:clpm/utils)
......@@ -9,9 +8,9 @@
"Given an alist of environment variables, return a list of arguments suitable
for uiop:{launch/run}-program to set the augmented environment for the child
process."
(let ((env (append new-env-alist
(osicat:environment))))
(let ((env (append (mapcar (lambda (c)
(concatenate 'string (car c) "=" (cdr c)))
new-env-alist)
(sb-ext:posix-environ))))
#-sbcl (error "not implemented")
(list :environment (mapcar (lambda (cons)
(concatenate 'string (car cons) "=" (cdr cons)))
env))))
(list :environment env)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment