]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
lots of bugfixes
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 6 Apr 2007 15:43:34 +0000 (15:43 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 6 Apr 2007 15:43:34 +0000 (15:43 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@290 04377dda-e619-0410-9926-eae83683ac58

trunk/doc/CHANGELOG
trunk/lib/common.sh
trunk/simplepkg.SlackBuild
trunk/src/jail-commit
trunk/src/templatepkg
trunk/templates/openoffice/openoffice.perms [new file with mode: 0644]
trunk/templates/slackware/slackware.perms [new file with mode: 0644]
trunk/templates/vserver-legacy/vserver-legacy.perms [new file with mode: 0644]
trunk/templates/vserver/vserver.perms [new file with mode: 0644]

index 5a3949f24b718125f6c8e5af7f89e0845db9e547..c9bccf0f159d62ed0572d759e4a1af88165011eb 100644 (file)
@@ -1,6 +1,14 @@
 simplepkg changelog
 ===================
 
+0.5pre2
+=======
+
+  - lots of bugfixes
+
+  - templatepkg:
+    - now creates missing components in a template
+
 0.5pre1
 =======
 
index af76cd1ba083b7fca83065b760bedae4a17fa6b3..e85689088e9c1e53263a192073a055e888a6ed63 100644 (file)
@@ -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
index f150b76ff2ff55dfa07bcc46c97024e03084190f..bbd6ced0ee170413892e515a11186e06f1ad7eec 100755 (executable)
@@ -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"
index d8cd987e1f989bca358639795331c4c796e86e0e..f3d5f05113d61094bf19f50a14fc25e122b8d879 100755 (executable)
@@ -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
index c218638732c633029c3fd9a20a878020afe118bd..d1bffb6e27fb0b7a8ac1dd14b71dbdab04ffc132 100755 (executable)
@@ -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 (file)
index 0000000..e69de29
diff --git a/trunk/templates/slackware/slackware.perms b/trunk/templates/slackware/slackware.perms
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/trunk/templates/vserver-legacy/vserver-legacy.perms b/trunk/templates/vserver-legacy/vserver-legacy.perms
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/trunk/templates/vserver/vserver.perms b/trunk/templates/vserver/vserver.perms
new file mode 100644 (file)
index 0000000..e69de29