diff options
| author | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-04-10 07:26:30 +0800 |
|---|---|---|
| committer | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-04-10 07:26:30 +0800 |
| commit | a64930636462bf24118ca7266f699ce2b696e821 (patch) | |
| tree | 58d116ac5f03aa9e84ece6e4ffa6b489573042a4 /repos/extra/ports/git | |
| parent | ddd8e1a8fab2ac39396282a7c09ddf6eca219613 (diff) | |
| download | alicelinux-a64930636462bf24118ca7266f699ce2b696e821.tar.gz alicelinux-a64930636462bf24118ca7266f699ce2b696e821.zip | |
clang branch updated
Diffstat (limited to 'repos/extra/ports/git')
| -rw-r--r-- | repos/extra/ports/git | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/repos/extra/ports/git b/repos/extra/ports/git new file mode 100644 index 00000000..654a8c77 --- /dev/null +++ b/repos/extra/ports/git @@ -0,0 +1,47 @@ +#!/bin/sh +# +# /etc/ports/drivers/git: git driver script for ports(8) +# + +if [ $# -ne 1 ]; then + echo "usage: $0 <file>" >&2 + exit 1 +fi + +. $1 + +if [ -z "$URL" ]; then + echo "URL not set in '$1'" >&2 + exit 2 +fi +if [ -z "$NAME" ]; then + echo "NAME not set in '$1'" >&2 + exit 2 +fi +if [ -z "$BRANCH" ]; then + echo "BRANCH not set in '$1'" >&2 + exit 2 +fi + +REPOSITORY="$PORTS_DIR/$NAME" +if [ -n "$LOCAL_REPOSITORY" ]; then + REPOSITORY="$LOCAL_REPOSITORY" +fi + +echo "Fetching updates from $URL" +echo "Updating collection $NAME" + +cd "$REPOSITORY" 2> "/dev/null" + +if [ $? -lt 1 ]; then + git checkout -q "$BRANCH" + git fetch -q + git diff --pretty=format: --name-status "$BRANCH" origin/"$BRANCH" | sed "s/M\t/ Edit /g; s/A\t/ Checkout /g; s/D\t/ Delete /g" | sort + git clean -q -f + git reset -q --hard origin/"$BRANCH" +else + git clone -q -b "$BRANCH" "$URL" "$REPOSITORY" + ls -1 $REPOSITORY | sed "s/^/ Checkout /" +fi + +echo "Finished successfully" |