diff options
-rw-r--r-- | trunk/doc/CHANGELOG | 8 | ||||
-rw-r--r-- | trunk/lib/common.sh | 6 | ||||
-rwxr-xr-x | trunk/simplepkg.SlackBuild | 2 | ||||
-rwxr-xr-x | trunk/src/jail-commit | 6 | ||||
-rwxr-xr-x | trunk/src/templatepkg | 41 | ||||
-rw-r--r-- | trunk/templates/openoffice/openoffice.perms | 0 | ||||
-rw-r--r-- | trunk/templates/slackware/slackware.perms | 0 | ||||
-rw-r--r-- | trunk/templates/vserver-legacy/vserver-legacy.perms | 0 | ||||
-rw-r--r-- | trunk/templates/vserver/vserver.perms | 0 |
9 files changed, 49 insertions, 14 deletions
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG index 5a3949f..c9bccf0 100644 --- a/trunk/doc/CHANGELOG +++ b/trunk/doc/CHANGELOG @@ -1,6 +1,14 @@ simplepkg changelog =================== +0.5pre2 +======= + + - lots of bugfixes + + - templatepkg: + - now creates missing components in a template + 0.5pre1 ======= diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index af76cd1..e856890 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -321,13 +321,13 @@ function default_arch { function search_default_template { - if [ -f "$BASE_CONF/templates/default.template" ]; then + if [ -e "$BASE_CONF/templates/default.template" ]; then TEMPLATE_BASE="$BASE_CONF/templates/default" echo $BASENAME: using default template - elif [ -f "$BASE_CONF/default.template" ]; then + elif [ -e "$BASE_CONF/default.template" ]; then TEMPLATE_BASE="$BASE_CONF/default" echo $BASENAME using default template - elif [ -f "$BASE_CONF/defaults/templates/default/default.template" ]; then + elif [ -e "$BASE_CONF/defaults/templates/default/default.template" ]; then TEMPLATE_BASE="$BASE_CONF/defaults/templates/default" else echo $BASENAME: error: default template not found diff --git a/trunk/simplepkg.SlackBuild b/trunk/simplepkg.SlackBuild index f150b76..bbd6ced 100755 --- a/trunk/simplepkg.SlackBuild +++ b/trunk/simplepkg.SlackBuild @@ -6,7 +6,7 @@ PACKAGE="simplepkg" PACK_DIR="package-$PACKAGE" BUILD=${BUILD:=1rha} -VERSION="0.5pre1" +VERSION="0.5pre2" ARCH="noarch" LIBEXEC="/usr/libexec/$PACKAGE" BINDIR="/usr/bin" diff --git a/trunk/src/jail-commit b/trunk/src/jail-commit index d8cd987..f3d5f05 100755 --- a/trunk/src/jail-commit +++ b/trunk/src/jail-commit @@ -94,8 +94,10 @@ function template_svn_commit { # usage: template_svn_commit <template-folder> if use_svn && [ -d "$1/.svn" ]; then - echo Commiting changes to the repository... cd $1 + echo First checking out from the repository... + svn update + echo Commiting changes to the repository... svn commit -m "changes for `date`" if [ "$?" != "0" ]; then echo $BASENAME: commit error @@ -142,11 +144,9 @@ elif [ "$1" == "--all" ]; then elif echo $1 | grep -q -e "^--"; then usage elif [ ! -z "$1" ]; then - echo "This is jail-commit; Run \"$BASENAME --help\" for help" do_commit $1 $2 template_svn_commit `dirname $TEMPLATE_BASE` else - echo "This is jail-commit; Run \"$BASENAME --help\" for help" if [ -f $JAIL_LIST ]; then for jailpath in `cat $JAIL_LIST`; do do_commit $jailpath diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index c218638..d1bffb6 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -86,6 +86,8 @@ function usage { echo "" exit + # TODO: opcao para apagar script de pos-instalacao + } function check_svn_repo { @@ -200,7 +202,7 @@ function template_create { if use_svn && [ -d "$TEMPLATE_BASE/.svn" ]; then - cd $TEMPLATE_BASE + cd `dirname $TEMPLATE_BASE` if ! svn_check $TEMPLATE_BASE.d; then svn mkdir $TEMPLATE_BASE.d @@ -455,10 +457,11 @@ function template_add { function check_template_exist { # check if a template exists + # and create missing components local components - components="$TEMPLATE_BASE.template $TEMPLATE_BASE.perms $TEMPLATE_BASE.d $TEMPLATE_BASE.s" + components="template perms d s" if [ ! -d "`dirname $TEMPLATE_BASE`" ]; then echo $BASENAME: template not found @@ -466,13 +469,30 @@ function check_template_exist { fi for component in $components; do - if [ ! -e "$component" ]; then - echo $BASENAME: template component not found: $component - echo $BASENAME: please run $BASENAME -c before update a template - exit 1 + + if [ ! -e "$TEMPLATE_BASE.$component" ]; then + echo "$BASENAME: template component not found: $component; creating..." + + cd `dirname $TEMPLATE_BASE` + + if [ "$component" == "perms" ] || [ "$component" == "template" ]; then + touch $TEMPLATE_BASE.$component + else + mkdir $TEMPLATE_BASE.$component + fi + + if use_svn && [ -d "$TEMPLATE_BASE/.svn" ]; then + svn add $TEMPLATE_BASE.$component + info_commit="yes" + fi + fi done + if [ "$info_commit" == "yes" ]; then + echo "$BASENAME: please run 'jail-commit --all' to add new files in the svn repository" + fi + } function template_delete { @@ -517,6 +537,7 @@ function template_remove { if use_svn && [ -d "$basedir/.svn" ]; then cd $BASE_CONF/templates + svn update svn del --force $template if [ "$?" != "0" ]; then echo $BASENAME: error deleting template $template @@ -602,7 +623,11 @@ function template_post_install_edit { fi else - if [ -d "$TEMPLATE_BASE.s" ]; then + if [ -e "$TEMPLATE_BASE.s/$1" ]; then + + echo $BASENAME: file $TEMPLATE_BASE.s/$1 not a regular file + + elif [ -d "$TEMPLATE_BASE.s" ]; then touch $TEMPLATE_BASE.s/$1 chmod +x $TEMPLATE_BASE.s/$1 @@ -639,6 +664,8 @@ function template_edit { [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then echo "$BASENAME: please run 'jail-commit --all' to send changes to the repository" fi + elif [ -e "$TEMPLATE_BASE.template" ]; then + echo $BASENAME: file $TEMPLATE_BASE.template not a regular file else echo $BASENAME: file not found: $TEMPLATE_BASE.template fi diff --git a/trunk/templates/openoffice/openoffice.perms b/trunk/templates/openoffice/openoffice.perms new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/trunk/templates/openoffice/openoffice.perms diff --git a/trunk/templates/slackware/slackware.perms b/trunk/templates/slackware/slackware.perms new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/trunk/templates/slackware/slackware.perms diff --git a/trunk/templates/vserver-legacy/vserver-legacy.perms b/trunk/templates/vserver-legacy/vserver-legacy.perms new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/trunk/templates/vserver-legacy/vserver-legacy.perms diff --git a/trunk/templates/vserver/vserver.perms b/trunk/templates/vserver/vserver.perms new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/trunk/templates/vserver/vserver.perms |