From 8ed347d8f35d02485a95f9a2af152e8e8ec2b9f7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 9 May 2019 17:34:17 +0300 Subject: [PATCH] puke: git support --- puke | 27 +++++++++++++++++++-------- repo/hummingbird/build | 5 +++++ repo/hummingbird/checksums | 0 repo/hummingbird/depends | 0 repo/hummingbird/manifest | 8 ++++++++ repo/hummingbird/sources | 1 + repo/hummingbird/version | 1 + 7 files changed, 34 insertions(+), 8 deletions(-) create mode 100755 repo/hummingbird/build create mode 100644 repo/hummingbird/checksums create mode 100644 repo/hummingbird/depends create mode 100644 repo/hummingbird/manifest create mode 100644 repo/hummingbird/sources create mode 100644 repo/hummingbird/version diff --git a/puke b/puke index ff2c0382..679bb224 100755 --- a/puke +++ b/puke @@ -13,13 +13,15 @@ log() { } clean() { - cd "$old_pwd/repo/$name" - rm -rf -- "$mak_dir" "$pkg_dir" .checksums + rm -rf -- "$mak_dir" "$pkg_dir" + + [ -n "$name" ] && + rm "$old_pwd/repo/$name/.checksums" } pkg_info() { [ -z "$1" ] && die "No package specified." - cd "repo/$1" || die "Package '$1' not in repository." + cd "./repo/$1" || die "Package '$1' not in repository." [ -f version ] || die "Version file not found." [ -f depends ] || die "Depends file not found." [ -f sources ] || die "Sources file not found." @@ -47,6 +49,9 @@ pkg_sources() { log "Found cached $src_name." continue + elif [ -z "${src##git:*}" ]; then + git clone "${src##git:}" "$mak_dir" + elif [ -z "${src##*://*}" ]; then log "Downloading '$src'." wget -P "$src_dir" "$src" || die "Failed to download $src." @@ -61,7 +66,10 @@ pkg_checksum() { while read -r src; do src_name=${src##*/} - if [ -f "$src" ]; then + if [ -z "${src##git:*}" ]; then + continue + + elif [ -f "$src" ]; then src_path=$src elif [ -f "$src_dir/$src_name" ]; then @@ -88,11 +96,14 @@ pkg_extract() { while read -r src; do src_name=${src##*/} - if [ -f "$src" ]; then + if [ -z "${src##git:*}" ]; then + continue + + elif [ -f "$src" ]; then cp -f "$src" "$mak_dir" elif [ ! -f "$src_dir/$src_name" ]; then - die "$src_name" not found. + die "$src_name not found." else case $src_dir/$src_name in @@ -113,7 +124,7 @@ pkg_build() { set -e . "$OLDPWD/build" set +e - cd - + cd - >/dev/null log "Sucessfully built $pkg." } @@ -125,7 +136,7 @@ pkg_manifest() { _ -not -type d > "$OLDPWD/manifest" _ -type d | sort -r >> "$OLDPWD/manifest" - cd - + cd - >/dev/null } args() { diff --git a/repo/hummingbird/build b/repo/hummingbird/build new file mode 100755 index 00000000..22406e3a --- /dev/null +++ b/repo/hummingbird/build @@ -0,0 +1,5 @@ +make +make DESTDIR="$pkg_dir" install + +install -Dm755 ./etc/rc.init "$pkg_dir/etc/rc.init" +install -Dm755 ./etc/rc.shutdown "$pkg_dir/etc/rc.shutdown" diff --git a/repo/hummingbird/checksums b/repo/hummingbird/checksums new file mode 100644 index 00000000..e69de29b diff --git a/repo/hummingbird/depends b/repo/hummingbird/depends new file mode 100644 index 00000000..e69de29b diff --git a/repo/hummingbird/manifest b/repo/hummingbird/manifest new file mode 100644 index 00000000..e3df6bef --- /dev/null +++ b/repo/hummingbird/manifest @@ -0,0 +1,8 @@ +/usr/bin/shutdown +/usr/bin/hummingbird +/usr/bin/reboot +/etc/rc.shutdown +/etc/rc.init +/usr/bin +/usr +/etc diff --git a/repo/hummingbird/sources b/repo/hummingbird/sources new file mode 100644 index 00000000..6cbaf5b1 --- /dev/null +++ b/repo/hummingbird/sources @@ -0,0 +1 @@ +git:https://github.com/dylanaraps/hummingbird.git diff --git a/repo/hummingbird/version b/repo/hummingbird/version new file mode 100644 index 00000000..a383ea1a --- /dev/null +++ b/repo/hummingbird/version @@ -0,0 +1 @@ +git 1