puke: git support

This commit is contained in:
Dylan Araps 2019-05-09 17:34:17 +03:00
parent bc101a0230
commit 8ed347d8f3
7 changed files with 34 additions and 8 deletions

27
puke
View File

@ -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() {

5
repo/hummingbird/build Executable file
View File

@ -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"

View File

0
repo/hummingbird/depends Normal file
View File

View File

@ -0,0 +1,8 @@
/usr/bin/shutdown
/usr/bin/hummingbird
/usr/bin/reboot
/etc/rc.shutdown
/etc/rc.init
/usr/bin
/usr
/etc

1
repo/hummingbird/sources Normal file
View File

@ -0,0 +1 @@
git:https://github.com/dylanaraps/hummingbird.git

1
repo/hummingbird/version Normal file
View File

@ -0,0 +1 @@
git 1