From 39795a0a40310baf41eaadacfb8428ce2242cd3b Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 5 Mar 2018 13:38:46 +0800 Subject: [PATCH] updated --- buildpkg | 22 ++++++++++++-- functions/functions | 70 +-------------------------------------------- scratchpkg.conf | 11 ++++--- 3 files changed, 26 insertions(+), 77 deletions(-) diff --git a/buildpkg b/buildpkg index 8fab504..a9dc087 100755 --- a/buildpkg +++ b/buildpkg @@ -544,9 +544,27 @@ main() { NO_ORPHAN_CHECK=yes fi + #### CHECK SPKGBUILD ### + #if [ -z "$name" ] || [ -z "$version" ] || [ -z "$release" ] || [ "$(basename `pwd`)" != "$name" ] || [ "`type -t build`" != "function" ]; then + #msgerr "Please check spkgbuild." + #exit 1 + #fi + ### CHECK SPKGBUILD ### - if [ -z "$name" ] || [ -z "$version" ] || [ -z "$release" ] || [ "$(basename `pwd`)" != "$name" ] || [ "`type -t build`" != "function" ]; then - msgerr "Please check spkgbuild." + if [ -z "$name" ]; then + msgerr "'name' is empty!" + exit 1 + elif [ "$(basename `pwd`)" != "$name" ]; then + msgerr "Port name and Directory name is different!" + exit 1 + elif [ -z "$version" ]; then + msgerr "'version' is empty!" + exit 1 + elif [ -z "$release" ]; then + msgerr "'release' is empty!" + exit 1 + elif [ "`type -t build`" != "function" ]; then + msgerr "'build' function not exist!" exit 1 fi diff --git a/functions/functions b/functions/functions index 93208a6..5c3c041 100644 --- a/functions/functions +++ b/functions/functions @@ -16,10 +16,9 @@ INDEX_DIR="/var/lib/scratchpkg/index" PACKAGE_DIR="/var/cache/scratchpkg/packages" SOURCE_DIR="/var/cache/scratchpkg/sources" WORK_DIR="/tmp" -BACKUP_DIR="/var/cache/scratchpkg/backup" -REJECTED_DIR="/var/cache/scratchpkg/rejected" LOG_DIR="/var/cache/scratchpkg/log" HOOK_DIR="/etc/hooks" +PORT_DIR="/etc/ports" OPTIONS=(!libtool emptydirs strip docs purge zipman buildflags makeflags) PURGE_FILES=(usr/{,share/}info/dir) @@ -91,73 +90,6 @@ checktool() { } -updmimedb() { - - # msg2 "Update mime database..." - if [ -x /usr/bin/update-mime-database ]; then - /usr/bin/update-mime-database /usr/share/mime - fi - -} - -updiconcache() { - - # ms2 "Update icon cache..." - if [ -x /usr/bin/gtk-update-icon-cache ]; then - /usr/bin/gtk-update-icon-cache -qf /usr/share/icons/hicolor - fi - -} - -updglibschemas() { - - # msg2 "Update glib schemas..." - if [ -x /usr/bin/glib-compile-schemas ]; then - /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas - fi - -} - -upddesktopdb() { - - # msg2 "Update desktop database..." - if [ -x /usr/bin/update-desktop-database ]; then - /usr/bin/update-desktop-database - fi - -} - -updmandb() { - - # msg2 "Update man database..." - if [ -x /usr/bin/mandb ]; then - /usr/bin/mandb -q - fi - -} - -updlibdb() { - - # msg2 "Running ldconfig..." - if [ -x /sbin/ldconfig ]; then - /sbin/ldconfig - fi - -} - -updinfopages() { - - pushd /usr/share/info - if [ -f dir ]; then - rm dir - fi - for f in *; do - install-info $f dir 2>/dev/null - done - popd - -} - getpkginfo() { description=$(cat $BUILD_SCRIPT | grep ^'# description' | sed 's/\://' | cut -d ' ' -f 3-) diff --git a/scratchpkg.conf b/scratchpkg.conf index 5e240a0..ceaed90 100644 --- a/scratchpkg.conf +++ b/scratchpkg.conf @@ -33,17 +33,13 @@ PORT_REPO+=(/usr/ports/wip) # PACKAGE_DIR="/var/cache/scratchpkg/packages" # SOURCE_DIR="/var/cache/scratchpkg/sources" # WORK_DIR="/tmp" -# BACKUP_DIR="/var/cache/scratchpkg/backup" -# REJECTED_DIR="/var/cache/scratchpkg/rejected" # LOG_DIR="/var/cache/scratchpkg/log" # HOOK_DIR="/etc/hooks" +# PORT_DIR="/etc/ports" ## ## GLOBAL PACKAGE OPTIONS ## -# -- These are default values for the options=() settings -# -- add '!' in front of this option to disable it -# # -- libtool: Keep libtool file (*.la) in packages # -- emptydirs: Keep empty directories in packages # -- strip: Strip symbols from binaries/libraries @@ -53,7 +49,10 @@ PORT_REPO+=(/usr/ports/wip) # -- buildflags: Enable buildflags (CFLAGS and CXXFLAGS) # -- makeflags: Enable makeflags (MAKEFLAGS) # -# OPTIONS=(libtool emptydirs strip docs purge zipman buildflags makeflags) +# -- These are default values for the options=() settings +# -- add '!' in front of this option to disable it +# +# OPTIONS=(!libtool emptydirs strip docs purge zipman buildflags makeflags) # -- Files to be removed from all packages (if purge is specified) # PURGE_FILES=(usr/{,share/}info/dir)