aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/cpt-alternatives3
-rwxr-xr-xsrc/cpt-build3
-rwxr-xr-xsrc/cpt-checksum3
-rwxr-xr-xsrc/cpt-download3
-rwxr-xr-xsrc/cpt-fetch3
-rwxr-xr-xsrc/cpt-install1
-rw-r--r--src/cpt-lib7
-rwxr-xr-xsrc/cpt-list3
-rwxr-xr-xsrc/cpt-remove3
-rwxr-xr-xsrc/cpt-search3
-rwxr-xr-xsrc/cpt-update3
11 files changed, 15 insertions, 20 deletions
diff --git a/src/cpt-alternatives b/src/cpt-alternatives
index f0d2be0..e516730 100755
--- a/src/cpt-alternatives
+++ b/src/cpt-alternatives
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# List and swap to alternatives
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
case "$1" in --version|--help|-v|-h|'') ;; *)
[ -w "$CPT_ROOT/" ] || [ "$uid" = 0 ] || {
diff --git a/src/cpt-build b/src/cpt-build
index 5f73de8..edf59bb 100755
--- a/src/cpt-build
+++ b/src/cpt-build
@@ -1,8 +1,7 @@
#!/bin/sh
# Build a package
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
parser_definition() {
setup REST -- "usage: ${0##*/} [pkg...]"
diff --git a/src/cpt-checksum b/src/cpt-checksum
index 63a567b..0a83ae0 100755
--- a/src/cpt-checksum
+++ b/src/cpt-checksum
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Generate checksums
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
case "$1" in
--help|-h) out "usage: ${0##*/} [pkg...]"; exit 1 ;;
diff --git a/src/cpt-download b/src/cpt-download
index 19c4732..f558b86 100755
--- a/src/cpt-download
+++ b/src/cpt-download
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Download sources for the given package
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
case "$1" in
--help|-h)
diff --git a/src/cpt-fetch b/src/cpt-fetch
index 7d5be95..d75edd5 100755
--- a/src/cpt-fetch
+++ b/src/cpt-fetch
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Fetch repositories
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
case "$1" in
--help|-h) out "usage: ${0##*/}"; exit 1 ;;
diff --git a/src/cpt-install b/src/cpt-install
index 92d8eee..94058d8 100755
--- a/src/cpt-install
+++ b/src/cpt-install
@@ -1,7 +1,6 @@
#!/bin/sh
# Install a package
-# shellcheck disable=1091
if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
parser_definition() {
diff --git a/src/cpt-lib b/src/cpt-lib
index 8ef82c5..0460fcb 100644
--- a/src/cpt-lib
+++ b/src/cpt-lib
@@ -582,7 +582,7 @@ pkg_extract() {
# Comment or blank line.
\#*|'') continue ;;
- # Only 'tar' an 'zip' archives are currently supported for
+ # Only 'tar', 'cpio', and 'zip' archives are currently supported for
# extraction. Other filetypes are simply copied to '$mak_dir'
# which allows for manual extraction.
*://*.tar|*://*.tar.??|*://*.tar.???|*://*.tar.????|*://*.tgz|*://*.txz)
@@ -639,6 +639,11 @@ pkg_extract() {
rm -f .ktar
;;
+ *://*.cpio|*://*.cpio.??|*://*.cpio.???|*://*.cpio.????)
+ decompress "$src_dir/$1/${src##*/}" | cpio -i
+
+ ;;
+
*://*.zip)
unzip "$src_dir/$1/${src##*/}" ||
die "$1" "Couldn't extract ${src##*/}"
diff --git a/src/cpt-list b/src/cpt-list
index b808e74..5179dc5 100755
--- a/src/cpt-list
+++ b/src/cpt-list
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# List installed packages
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
case "$1" in
--help|-h) out "usage: ${0##*/} [pkg...]"; exit 1 ;;
diff --git a/src/cpt-remove b/src/cpt-remove
index 5462b4b..53f0a1f 100755
--- a/src/cpt-remove
+++ b/src/cpt-remove
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Remove a package
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
parser_definition() {
setup REST -- "usage: ${0##*/} [pkg...]"
diff --git a/src/cpt-search b/src/cpt-search
index cc37d9a..dbb4eff 100755
--- a/src/cpt-search
+++ b/src/cpt-search
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Search for a package
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
parser_definition() {
setup REST -- "usage: ${0##*/} [pkg...]"
diff --git a/src/cpt-update b/src/cpt-update
index bbda066..39399c9 100755
--- a/src/cpt-update
+++ b/src/cpt-update
@@ -1,8 +1,7 @@
#!/bin/sh -ef
# Check for updates
-# shellcheck disable=1091
-if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi
+if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi
parser_definition() {
setup REST -- "usage: ${0##*/} [options]"