Skip to content

Commit

Permalink
Assume #bin means it's not a git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed Apr 26, 2024
1 parent bac3a12 commit 89a83dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ upkg_add() {
# Autocalculate the checksum
processing "No checksum given for '%s', determining now" "$pkgurl"
# Check if the URL is a tar, if not, try getting the remote HEAD git commit sha. If that fails, assume it's a file of some sort
if [[ $pkgurl =~ (\.tar(\.[^.?#/]+)?)([?#]|$) ]] || ! checksum=$(git ls-remote -q "${pkgurl%%'#'*}" HEAD 2>/dev/null | grep $'\tHEAD$' | cut -f1); then
if [[ $pkgurl =~ (\.tar(\.[^.?#/]+)?)([?#]|$)|(#bin(#|$)) ]] || ! checksum=$(git ls-remote -q "${pkgurl%%'#'*}" HEAD 2>/dev/null | grep $'\tHEAD$' | cut -f1); then
# pkgurl is a file
local archiveext=${BASH_REMATCH[1]}
if [[ -n $archiveext ]]; then # pkgurl is a tar archive
Expand Down Expand Up @@ -394,7 +394,7 @@ upkg_download() (
fi
mkdir -p "$TMPPATH/root/.upkg/.packages"
# Check if the URL is a tar, if not, try getting the remote HEAD commit sha. If that fails, assume it's a file of some sort
if [[ $pkgurl =~ (\.tar(\.[^.?#/]+)?)([?#]|$) ]] || ! git ls-remote -q "${pkgurl%%'#'*}" HEAD >/dev/null 2>&1; then
if [[ $pkgurl =~ (\.tar(\.[^.?#/]+)?)([?#]|$)|(#bin(#|$)) ]] || ! git ls-remote -q "${pkgurl%%'#'*}" HEAD >/dev/null 2>&1; then
local archiveext=${BASH_REMATCH[1]} # Empty if we are not dealing with an archive
local prefetchpath=$TMPPATH/prefetched/${checksum}${archiveext} filepath=${pkgpath}${archiveext}
if [[ -n $archiveext ]]; then
Expand Down

0 comments on commit 89a83dd

Please sign in to comment.