aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 02:00:38 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 02:00:38 +0000
commit0f63f59fe31ab7f0bf31ba622c6b131921bb596d (patch)
treea92eb853ccb355edbbc7dae08b0b26b8306778e2
parent2b1c9862fefe57ac580cec2db4a76440dd79895e (diff)
downloadsimplepkg-0f63f59fe31ab7f0bf31ba622c6b131921bb596d.tar.gz
simplepkg-0f63f59fe31ab7f0bf31ba622c6b131921bb596d.tar.bz2
lots of changes, see CHANGELOG for details
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@537 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--trunk/Makefile46
-rw-r--r--trunk/conf/repos.conf37
-rw-r--r--trunk/conf/repos.conf.new51
-rw-r--r--trunk/conf/simplepkg.conf (renamed from trunk/conf/simplepkg.conf.new)21
-rw-r--r--trunk/doc/CHANGELOG16
-rw-r--r--trunk/doc/README7
-rw-r--r--trunk/doc/README.pt_BR6
-rw-r--r--trunk/doc/README.simplaret15
-rw-r--r--trunk/doc/README.simplaret.pt_BR8
-rw-r--r--trunk/doc/simplaret-en.tex4
-rw-r--r--trunk/doc/simplaret-pt_BR.tex2
-rw-r--r--trunk/doc/simplepkg-en.tex4
-rw-r--r--trunk/doc/simplepkg-pt_BR.tex2
-rw-r--r--trunk/install/doinst.sh2
-rw-r--r--trunk/lib/common.sh133
-rw-r--r--trunk/src/createpkg164
-rwxr-xr-xtrunk/src/simplaret15
-rwxr-xr-xtrunk/src/templatepkg26
18 files changed, 384 insertions, 175 deletions
diff --git a/trunk/Makefile b/trunk/Makefile
index ff0583c..f7d6390 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -5,7 +5,7 @@
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or any later version.
#
-# This SlackBuild is distributed in the hope that it will be useful, but WITHOUT
+# This Makefile is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
@@ -14,6 +14,7 @@
# Place - Suite 330, Boston, MA 02111-1307, USA
#
+PACKAGE = simplepkg
VERSION = 0.6pre31
BUILD = 1rha
PREFIX = /usr
@@ -23,7 +24,7 @@ clean:
find . -name *~ | xargs rm -f # clean local backups
install_lib:
- $(INSTALL) -D --mode=0644 lib/common.sh $(DESTDIR)/$(PREFIX)/libexec/simplepkg/common.sh
+ $(INSTALL) -D --mode=0644 lib/common.sh $(DESTDIR)/$(PREFIX)/libexec/$(PACKAGE)/common.sh
install_bin:
$(INSTALL) -D --mode=0755 src/simplaret $(DESTDIR)/$(PREFIX)/bin/simplaret
@@ -43,35 +44,34 @@ install_sbin:
@cd $(DESTDIR)/usr/sbin && ln -sf jail-upgrade vserver-upgrade
install_doc:
- $(INSTALL) -D --mode=0644 doc/COPYING $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/COPYING
- $(INSTALL) -D --mode=0644 doc/TODO $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/TODO
- $(INSTALL) -D --mode=0644 doc/CHANGELOG $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/CHANGELOG
- $(INSTALL) -D --mode=0644 doc/README $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/README
- $(INSTALL) -D --mode=0644 doc/README.pt_BR $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/README.pt_BR
- $(INSTALL) -D --mode=0644 doc/README.simplaret $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/README.simplaret
- $(INSTALL) -D --mode=0644 doc/README.simplaret.pt_BR $(DESTDIR)/$(PREFIX)/doc/simplepkg-$(VERSION)/README.simplaret.pt_BR
+ $(INSTALL) -D --mode=0644 doc/COPYING $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/COPYING
+ $(INSTALL) -D --mode=0644 doc/TODO $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/TODO
+ $(INSTALL) -D --mode=0644 doc/CHANGELOG $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/CHANGELOG
+ $(INSTALL) -D --mode=0644 doc/README $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/README
+ $(INSTALL) -D --mode=0644 doc/README.pt_BR $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/README.pt_BR
+ $(INSTALL) -D --mode=0644 doc/README.simplaret $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/README.simplaret
+ $(INSTALL) -D --mode=0644 doc/README.simplaret.pt_BR $(DESTDIR)/$(PREFIX)/doc/$(PACKAGE)-$(VERSION)/README.simplaret.pt_BR
install_config:
- $(INSTALL) -D --mode=0644 conf/simplepkg.conf.new $(DESTDIR)/etc/simplepkg/simplepkg.conf.new
- $(INSTALL) -D --mode=0644 conf/repos.conf.new $(DESTDIR)/etc/simplepkg/repos.conf.new
- @mkdir -p $(DESTDIR)/etc/simplepkg/defaults/mkbuild/
- @cp mkbuild/* $(DESTDIR)/etc/simplepkg/defaults/mkbuild/
+ $(INSTALL) -D --mode=0644 conf/$(PACKAGE).conf $(DESTDIR)/etc/$(PACKAGE)/default/$(PACKAGE).conf
+ $(INSTALL) -D --mode=0644 conf/repos.conf $(DESTDIR)/etc/$(PACKAGE)/default/repos.conf
+ @mkdir -p $(DESTDIR)/etc/$(PACKAGE)/defaults/mkbuild/
+ @cp mkbuild/* $(DESTDIR)/etc/$(PACKAGE)/defaults/mkbuild/
install_defaults:
- @mkdir -p $(DESTDIR)/etc/simplepkg/{defaults/mkbuild,templates}
- @rsync -av --exclude=.svn templates/* $(DESTDIR)/etc/simplepkg/defaults/templates/
- @chmod +x $(DESTDIR)/etc/simplepkg/defaults/templates/vserver/vserver.s/*.sh
- @chmod +x $(DESTDIR)/etc/simplepkg/defaults/templates/vserver-legacy/vserver-legacy.s/*.sh
+ @mkdir -p $(DESTDIR)/etc/$(PACKAGE)/{defaults/mkbuild,templates}
+ @rsync -av --exclude=.svn templates/* $(DESTDIR)/etc/$(PACKAGE)/defaults/templates/
+ @chmod +x $(DESTDIR)/etc/$(PACKAGE)/defaults/templates/vserver/vserver.s/*.sh
+ @chmod +x $(DESTDIR)/etc/$(PACKAGE)/defaults/templates/vserver-legacy/vserver-legacy.s/*.sh
install: clean
@make install_lib install_bin install_sbin install_doc install_config install_defaults
$(INSTALL) -D --mode=0644 install/slack-desc $(DESTDIR)/install/slack-desc
- $(INSTALL) -D --mode=0755 install/doinst.sh $(DESTDIR)/install/doinst.sh
+ #$(INSTALL) -D --mode=0755 install/doinst.sh $(DESTDIR)/install/doinst.sh
package:
echo "Remember to run this option as root!"
- @rm -rf /tmp/package-simplepkg
- @mkdir -p /tmp/package-simplepkg
- @make DESTDIR=/tmp/package-simplepkg install
- @cd /tmp/package-simplepkg && makepkg -c y -l y /tmp/simplepkg-$(VERSION)-noarch-$(BUILD).tgz && cd - && rm -rf /tmp/package-simplepkg
- echo "Remember to run this option as root!"
+ @rm -rf /tmp/package-$(PACKAGE)
+ @mkdir -p /tmp/package-$(PACKAGE)
+ @make DESTDIR=/tmp/package-$(PACKAGE) install
+ @cd /tmp/package-$(PACKAGE) && makepkg -c y -l y /tmp/$(PACKAGE)-$(VERSION)-noarch-$(BUILD).tgz && cd - && rm -rf /tmp/package-$(PACKAGE)
diff --git a/trunk/conf/repos.conf b/trunk/conf/repos.conf
new file mode 100644
index 0000000..fa06a8e
--- /dev/null
+++ b/trunk/conf/repos.conf
@@ -0,0 +1,37 @@
+#
+# repository definitions for simplaret
+# please dont use any spaces inside a repository definition
+#
+
+# slackware root repositories
+#ROOT-i386="sarava%http://slack.sarava.org/slackware/"
+ROOT-i386="tds%http://slackware.mirrors.tds.net/pub/slackware/"
+ROOT-i386="easynews%http://slackware.mirrors.easynews.com/linux/slackware/"
+ROOT-i386="gwdg%http://ftp.gwdg.de/pub/linux/slackware/"
+
+# powerpc root definitions
+ROOT-powerpc="workaround%http://slackintosh.workaround.ch/pub/slackintosh/"
+
+# s390 root definitions
+ROOT-s390="ibiblio%http://distro.ibiblio.org/pub/linux/distributions/slack390/"
+
+# slamd64 root repositories
+#ROOT-x86_64="sarava%http://slack.sarava.org/slamd64/"
+ROOT-x86_64="slackadelic%http://mirror1.slackadelic.com/slamd64/"
+ROOT-x86_64="heanet%http://ftp.heanet.ie/pub/slamd64/"
+
+# If you want to use Bluewhite64 instead of Slamd64, please uncoment the
+# next line and make sure to comment out all other slamd64 repository definitions
+#ROOT-x86_64="bluewhite64%http://mirror.inode.at/data/bluewhite64/"
+
+# If you want to use Sflack instead of Slamd64 or Bluewhite64, please uncoment
+# the next line and make sure to comment out all other slamd64 and Bluewhite64
+# repository definitions
+#ROOT-x86_64="bluewhite64%http://webftp.slackarea.net/pub/sflack/"
+
+# noarch
+NOARCH="sarava%http://slack.sarava.org/packages/noarch"
+
+# i386 12.1
+REPOS-i386-12.1="sarava%http://slack.sarava.org/packages/slackware/slackware-12.1/"
+PATCHES-i386-12.1="sarava%http://slack.sarava.org/packages/slackware/slackware-12.1/patches/"
diff --git a/trunk/conf/repos.conf.new b/trunk/conf/repos.conf.new
deleted file mode 100644
index 02ded08..0000000
--- a/trunk/conf/repos.conf.new
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# repository definitions for simplaret
-# please dont use any spaces inside a repository definition
-#
-
-# root repositories
-ROOT-i386="tds%http://slackware.mirrors.tds.net/pub/slackware/"
-ROOT-i386="sarava%http://slack.sarava.org/slackware/"
-ROOT-powerpc="workaround%http://slackintosh.workaround.ch/pub/slackintosh/"
-ROOT-s390="ibiblio%http://distro.ibiblio.org/pub/linux/distributions/slack390/"
-ROOT-x86_64="sarava%http://slack.sarava.org/slamd64/"
-ROOT-x86_64="slackadelic%http://mirror1.slackadelic.com/slamd64/"
-ROOT-x86_64="heanet%http://ftp.heanet.ie/pub/slamd64/"
-# If you want to use Bluewhite64 instead of Slamd64, please uncoment the
-# next line and make sure to comment out all other slamd64 repository definitions
-#ROOT-x86_64="bluewhite64%http://mirror.inode.at/data/bluewhite64/"
-# If you want to use Sflack instead of Slamd64, please uncoment the
-# next line and make sure to comment out all other slamd64 repository definitions
-#ROOT-x86_64="bluewhite64%http://webftp.slackarea.net/pub/sflack/"
-
-# noarch
-NOARCH="sarava%http://slack.sarava.org/packages/noarch"
-
-# i386 10.2
-REPOS-i386-10.2="sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/"
-PATCHES-i386-10.2="sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/patches/"
-
-# x86_64 10.2
-REPOS-x86_64-10.2="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
-PATCHES-x86_64-10.2="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/patches/"
-
-# x86_64 10.2b
-REPOS-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/"
-PATCHES-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/patches/"
-
-# i386 11.0
-REPOS-i386-11.0="sarava%http://slack.sarava.org/packages/slackware/slackware-11.0/"
-PATCHES-i386-11.0="sarava%http://slack.sarava.org/packages/slackware/slackware-11.0/patches/"
-
-# x86_64 11.0
-REPOS-x86_64-11.0="sarava%http://slack.sarava.org/packages/slamd64/slamd64-11.0/"
-PATCHES-x86_64-11.0="sarava%http://slack.sarava.org/slamd64/slamd64-11.0/patches/"
-
-# powerpc 11.0
-REPOS-powerpc-11.0="sarava%http://slack.sarava.org/packages/slackintosh/slackintosh-11.0/"
-PATCHES-powerpc-11.0="workaround%http://slackintosh.workaround.ch/pub/slackintosh/11.0/patches/"
-
-# i386 12.0
-REPOS-i386-12.0="sarava%http://slack.sarava.org/packages/slackware/slackware-12.0/"
-PATCHES-i386-12.0="sarava%http://slack.sarava.org/packages/slackware/slackware-12.0/patches/"
-
diff --git a/trunk/conf/simplepkg.conf.new b/trunk/conf/simplepkg.conf
index d5b2e2d..9e7427d 100644
--- a/trunk/conf/simplepkg.conf.new
+++ b/trunk/conf/simplepkg.conf
@@ -1,5 +1,5 @@
#
-# /etc/simplepkg/simplepkg.conf
+# /etc/simplepkg/default/simplepkg.conf
#
# Default architecture: set this option if you dont want simplepkg
@@ -10,10 +10,13 @@
# to use the value from /etc/slackware-version
# DEFAULT_VERSION="12.1"
+# Temporary folder
+TMP="/tmp"
+
# Where jails are placed
JAIL_ROOT="/vservers"
-# Wheter mkjial should add new jails in the jail list;
+# Wheter mkjail should add new jails in the jail list;
# to enable it, set to "1" or "yes"
ADD_TO_JAIL_LIST="1"
@@ -141,6 +144,17 @@ MKBUILDS_SVN="http://slack.sarava.org/mkbuilds"
# Set binaries default repository directory
MAKEPKG_REPOS="/var/simplepkg/repos"
+# Set the binaries default repository nested folder, useful if you manage
+# packages from different distribution versions and architectures in the
+# same parent folder.
+#
+# You can use any string here and also de special parameters none, distro,
+# arch and version. You can also mix more than one parameter, like
+# "distro-version".
+#
+# Default value is "none", which means no nested folders.
+MAKEPKG_REPOS_STYLE="none"
+
# Set sources default directory
SOURCE_DIR="/var/simplepkg/sources"
@@ -160,4 +174,7 @@ REMOVE_OLD_PACKAGE="off"
# Move package to SlackBuilds-like tree
MOVE_BIN_PACKAGE="on"
+# Move package's slack-required to binary repository
+MOVE_SLACK_REQUIRED="on"
+
#---------------------------------------------------------------------
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG
index 79c7f63..79d586d 100644
--- a/trunk/doc/CHANGELOG
+++ b/trunk/doc/CHANGELOG
@@ -4,6 +4,15 @@ simplepkg changelog
0.6pre31
========
+ - common.sh:
+ - other minor changes
+ - repository metainformationg is now added at svn control if applicable
+ - new functions default_distro and svn_add
+ - new config parameter "TMP"
+ - renamed function use_svn to templates_under_svn
+ - simplaret: simplaret_search_and_process_patch do not donwload a package with the same
+ package name twicce in any case
+ - default simplepkg.conf and repos.conf moved to default/ folder
- templatepkg and mkjail: minor changes
- templates:
- removed slackware and added slackware-12.1
@@ -14,7 +23,12 @@ simplepkg changelog
- config() on postinstall_script now accepting .dist and .sample config file extensions
- clean_builds now compliant with standard --cleanup behaviour
- added git_source section
- - createpkg: most clean -s option output
+ - createpkg:
+ - new options --status, --update and --commit to manage subversion repository
+ - subversion integration
+ - minor changes
+ - new config parameters MAKEPKG_REPOS_STYLE and MOVE_SLACK_REQUIRED
+ - cleaner -s option output
- lspkg: fix on package search routine
- jail-commit: using unified diff
diff --git a/trunk/doc/README b/trunk/doc/README
index 82d3f0a..7068255 100644
--- a/trunk/doc/README
+++ b/trunk/doc/README
@@ -260,7 +260,7 @@ Storing templates inside a Subversion repository
------------------------------------------------
In order to increase once more the control and flexibility of template contents, simplepkg can also handle templates
-inside a subversion repository. To do that, edit first the config gile /etc/simplepkg/simplepkg.conf and set the
+inside a subversion repository. To do that, edit first the config file /etc/simplepkg/simplepkg.conf and set the
parameter TEMPLATES_UNDER_SVN to "yes".
Then, create a fresh subversion repository to keep your templates with a command like that:
@@ -394,7 +394,10 @@ and to create SlackBuild scripts.
Configuration parameters
------------------------
-Simplepkg's config file is /etc/simplepkg/simplepkg.conf and it keeps parameters used by all scripts.
+Simplepkg's default config file is /etc/simplepkg/default/simplepkg.conf and it keeps parameters used by all scripts.
+If you want to change some of its parameters, do not edit this file. Use /etc/simplepkg/simplepkg.conf instead as it
+overrides the default settings.
+
In this section, we won't cover any parameter that's just used by simplaret, whose settings are covered
in its own documentation.
diff --git a/trunk/doc/README.pt_BR b/trunk/doc/README.pt_BR
index 1ba34b1..fadf309 100644
--- a/trunk/doc/README.pt_BR
+++ b/trunk/doc/README.pt_BR
@@ -408,10 +408,14 @@ sozinhos ou pelo o createpkg.
Parâmetros de configuração
--------------------------
-O arquivo de configuração do simplepkg é o /etc/simplepkg/simplepkg.conf. Ele contém parâmetros de
+O arquivo de configuração do simplepkg é o /etc/simplepkg/default/simplepkg.conf. Ele contém parâmetros de
configuração de todos os scripts, porém neste texto não trataremos das opções específicas ao simplaret,
as quais tem uma seção específica no artigo correspondente.
+Se você quiser alterar algum parâmetro, não edite esse arquivo: use, ao invés dele, o arquivo
+/etc/simplepkg/simplepkg.conf, pois este sobrescreve qualquer opção padrão.
+
+
- JAIL_ROOT: pasta padrão onde as jaulas são criadas pelo mkjail. Valor padrão: "/vservers".
- ADD_TO_JAIL_LIST: controla se uma jaula criada pelo mkjail deve ser adicionada automaticamente
diff --git a/trunk/doc/README.simplaret b/trunk/doc/README.simplaret
index 102728e..cb98cf1 100644
--- a/trunk/doc/README.simplaret
+++ b/trunk/doc/README.simplaret
@@ -20,10 +20,17 @@ The always updated english documentation is hosted at http://slack.sarava.org/si
Downloading and installing
--------------------------
-Simplaret comes with simplepkg, wich installation and configuration is detailed at
-http://slack.sarava.org/simplepkg. Simplaret uses /etc/simplepkg/simplepkg.conf for its definitions
-and /etc/simplepkg/repos.conf for repository information. The default configuration should work
-for almost everyone.
+Simplaret comes with simplepkg, wich installation and configuration is detailed
+at http://slack.sarava.org/simplepkg. Simplaret uses
+/etc/simplepkg/simplepkg.conf for its definitions and /etc/simplepkg/repos.conf
+for repository information.
+
+The default configuration is placed, respectively, at
+/etc/simplepkg/default/simplepkg.conf and /etc/simplepkg/default/repos.conf and
+should work for most people, but if you want to change something please don't
+edit the default configuration files as the default setting may change in
+future releases. If you have a /etc/simplepkg/repos.conf file, then simplaret
+will just ignore the default repos.conf.
Using simplaret
---------------
diff --git a/trunk/doc/README.simplaret.pt_BR b/trunk/doc/README.simplaret.pt_BR
index 0dbf328..4abdd2d 100644
--- a/trunk/doc/README.simplaret.pt_BR
+++ b/trunk/doc/README.simplaret.pt_BR
@@ -26,9 +26,15 @@ em http://slack.sarava.org/packages/noarch/ e em seguida instalando-o com o coma
installpkg simplepkg-VERSAO-noarch-BUILD.tgz
A partir daí você já pode utilizar o simplaret para baixar pacotes dos repositórios padrão ou
-então alterar a lista de repositórios do arquivo /etc/simplepkg/repos.conf ou a configuração
+então editar a lista de repositórios do arquivo /etc/simplepkg/repos.conf ou a configuração
do aplicativo pelo arquivo /etc/simplepkg/simplepkg.conf.
+A configuração padrão de repositórios no simplaret se encontra em
+/etc/simplepkg/default/repos.conf, mas não recomendamos você editá-la. Use, ao
+invés disso, o /etc/simplepkg/repos.conf para sua configuração personalizada:
+se o simplaret encontrar esse arquivo, ele simplesmente ingorará as definições
+padrão de repositório.
+
Usando o simplaret
------------------
diff --git a/trunk/doc/simplaret-en.tex b/trunk/doc/simplaret-en.tex
index 59a69dc..a83cf95 100644
--- a/trunk/doc/simplaret-en.tex
+++ b/trunk/doc/simplaret-en.tex
@@ -19,7 +19,9 @@ It was inspired in swaret behavior but don't tries to get its complexity level,
\section{Downloading and installing}
-Simplaret comes with simplepkg, wich installation and configuration is detailed at http://slack.sarava.org/simplepkg. Simplaret uses /etc/simplepkg/simplepkg.conf for its definitions and /etc/simplepkg/repos.conf for repository information. The default configuration should work for almost everyone.
+Simplaret comes with simplepkg, wich installation and configuration is detailed at http://slack.sarava.org/simplepkg. Simplaret uses /etc/simplepkg/simplepkg.conf for its definitions and /etc/simplepkg/repos.conf for repository information.
+
+The default configuration is placed, respectively, at /etc/simplepkg/default/simplepkg.conf and /etc/simplepkg/default/repos.conf and should work for most people, but if you want to change something please don't edit the default configuration files as the default setting may change in future releases. If you have a /etc/simplepkg/repos.conf file, then simplaret will just ignore the default repos.conf.
\section{Using simplaret}
diff --git a/trunk/doc/simplaret-pt_BR.tex b/trunk/doc/simplaret-pt_BR.tex
index dba6086..8cef3dc 100644
--- a/trunk/doc/simplaret-pt_BR.tex
+++ b/trunk/doc/simplaret-pt_BR.tex
@@ -28,6 +28,8 @@ installpkg simplepkg-VERSAO-noarch-BUILD.tgz
A partir daí você já pode utilizar o \emph{simplaret} para baixar pacotes dos repositórios padrão ou então alterar a lista de repositórios do arquivo \emph{/etc/simplepkg/repos.conf} ou a configuração do aplicativo pelo arquivo \emph{/etc/simplepkg/simplepkg.conf}.
+A configuração padrão de repositórios no simplaret se encontra em \emph{/etc/simplepkg/default/repos.conf}, mas não recomendamos você editá-la. Use, ao invés disso, o \emph{/etc/simplepkg/repos.conf} para sua configuração personalizada: se o simplaret encontrar esse arquivo, ele simplesmente ingorará as definições padrão de repositório.
+
\section{Usando o simplaret}
Em geral, como o \emph{simplaret} armazena as informações em pastas do sistema, algumas funcionalidades só estarão disponíveis quando o mesmo é rodado pelo superusuário do sistema.
diff --git a/trunk/doc/simplepkg-en.tex b/trunk/doc/simplepkg-en.tex
index 4db0931..42add65 100644
--- a/trunk/doc/simplepkg-en.tex
+++ b/trunk/doc/simplepkg-en.tex
@@ -363,7 +363,9 @@ For their time, scripts repos and mkbuild are used, respectivelly, to create and
\section{Configuration parameters}
-Simplepkg's config file is /etc/simplepkg/simplepkg.conf and it keeps parameters used by all scripts. In this section, we won't cover any parameter that's just used by simplaret, whose settings are covered in its own documentation.
+Simplepkg's config file is /etc/simplepkg/simplepkg.conf and it keeps parameters used by all scripts. If you want to change some of its parameters, do not edit this file. Use /etc/simplepkg/simplepkg.conf instead as it overrides the default settings.
+
+In this section, we won't cover any parameter that's just used by simplaret, whose settings are covered in its own documentation.
\begin{itemize}
\item JAIL\_ROOT: Where jails are placed by mkjail. Default: "/vservers".
diff --git a/trunk/doc/simplepkg-pt_BR.tex b/trunk/doc/simplepkg-pt_BR.tex
index 336a32c..3132250 100644
--- a/trunk/doc/simplepkg-pt_BR.tex
+++ b/trunk/doc/simplepkg-pt_BR.tex
@@ -372,6 +372,8 @@ Por fim, os scripts repos e mkbuild são os que se encontram na etapa de maior de
O arquivo de configuração do \emph{simplepkg} é o /etc/simplepkg/simplepkg.conf. Ele contém parâmetros de configuração de todos os scripts, porém neste texto não trataremos das opções específicas ao \htmladdnormallink{simplaret}{http://slack.sarava.org/simplaret}, as quais tem uma seção específica no artigo correspondente.
+Se você quiser alterar algum parâmetro, não edite esse arquivo: use, ao invés dele, o arquivo /etc/simplepkg/simplepkg.conf, pois este sobrescreve qualquer opção padrão.
+
\begin{itemize}
\item \emph{JAIL\_ROOT}: pasta padrão onde as jaulas são criadas pelo mkjail. Valor padrão: "/vservers".
\item \emph{ADD\_TO\_JAIL\_LIST}: controla se uma jaula criada pelo mkjail deve ser adicionada automaticamente no arquivo /etc/simplepkg/jailist. O valor padrão é "1" (habilitado).
diff --git a/trunk/install/doinst.sh b/trunk/install/doinst.sh
deleted file mode 100644
index f3af964..0000000
--- a/trunk/install/doinst.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-( if [ ! -f "etc/simplepkg/simplepkg.conf" ]; then mv etc/simplepkg/simplepkg.conf.new etc/simplepkg/simplepkg.conf; fi )
-( if [ ! -f "etc/simplepkg/repos.conf" ]; then mv etc/simplepkg/repos.conf.new etc/simplepkg/repos.conf; fi )
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index 92b00bb..38afca8 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -18,6 +18,7 @@
BASE_CONF="/etc/simplepkg"
CONF="$BASE_CONF/simplepkg.conf"
+DEFAULT_CONF="$BASE_CONF/default/simplepkg.conf"
JAIL_LIST="$BASE_CONF/jailist"
SIMPLARET="simplaret"
@@ -131,11 +132,13 @@ function remove_packages {
function eval_parameter {
- # usage: eval $1 parameter from $CONF
+ # usage: eval $1 parameter from $CONF or $DEFAULT_CONF
# return the evaluated parameter if available or $2 $3 ... $n
if grep -qe "^$1=" $CONF; then
grep -e "^$1=" $CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'
+ elif grep -qe "^$1=" $DEFAULT_CONF; then
+ grep -e "^$1=" $DEFAULT_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'
else
shift
echo $*
@@ -187,11 +190,12 @@ function eval_config {
# simplepkg config file evaluation
# usage: eval_config <program-name> [-u]
- if [ -f "$CONF" ]; then
+ if [ -f "$DEFAULT_CONF" ]; then
DEFAULT_ARCH="`eval_parameter DEFAULT_ARCH $(default_arch)`"
DEFAULT_VERSION="`eval_parameter DEFAULT_VERSION $(default_version)`"
+ TMP="`eval_parameter TMP /tmp`"
STORAGE="`eval_parameter STORAGE /var/simplaret/packages`"
JAIL_ROOT="`eval_parameter JAIL_ROOT /vservers`"
PATCHES_DIR="`eval_parameter PATCHES_DIR /var/simplaret/patches`"
@@ -243,9 +247,8 @@ function eval_config {
# now we place "patches" on the top of ROOT_PRIORITY
ROOT_PRIORITY="patches `echo $ROOT_PRIORITY | sed -e 's/patches//'`"
-
else
- echo $1 error: config file $CONFIG not found
+ echo $1 error: config file $DEFAULT_CONF not found
exit 1
fi
@@ -303,6 +306,22 @@ function eval_config {
# arch and version functions
# -----------------------------------------------
+function default_distro {
+
+ # get distro name from /etc/slackware-version
+ if [ -f "$1/etc/slamd64-version" ]; then
+ echo Slamd64
+ elif [ -f "$1/etc/bluewhite64-version" ]; then
+ echo Bluewhite64
+ elif [ -f "$1/etc/sflack-version" ]; then
+ echo Sflack
+ elif [ -f "$1/etc/slackware-version" ]; then
+ cat $1/etc/slackware-version | awk '{ print $1 }'
+ else
+ echo Slackware
+ fi
+}
+
function default_version {
# get version from /etc/slackware-version
@@ -466,7 +485,7 @@ function get_group {
# subversion functions
# -----------------------------------------------
-function use_svn {
+function templates_under_svn {
# check if svn usage is enabled
@@ -509,6 +528,51 @@ function svn_check {
}
+function build_repo {
+
+ # Checkout a new slackbuild working copy
+ # input: $1 - svn directory name
+ # $2 - svn address
+ [ $# -ne 2 ] && exit 5
+ SVN_BASEDIR="`dirname $1`"
+ mkdir -p $SVN_BASEDIR || exit 4
+ cd $SVN_BASEDIR
+ svn checkout $2
+ cd $1
+
+}
+
+function check_repo {
+
+ # Verify if repository exist
+ # input: $1 - svn directory name
+ # $2 - svn address
+ [ $# -ne 2 ] && exit 5
+ [ ! -d "$1" ] && build_repo $1 $2
+
+}
+
+function sync_repo {
+
+ # Synchronize repository
+ # input: $1 - svn directory name
+ # $2 - svn address
+ [ $# -ne 2 ] && exit 5
+ cd $1
+ svn update || build_repo $1 $2
+
+}
+
+function svn_add {
+
+ if ! svn_check $1; then
+ cwd="`pwd`"
+ cd `dirname $1` && svn add $1
+ cd $cwd
+ fi
+
+}
+
# -----------------------------------------------
# update jail functions
# -----------------------------------------------
@@ -518,7 +582,7 @@ function update_template_files {
# update template files from svn
# usage: update_template_files
- if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
echo Checking out last template revision from svn...
cd `dirname $TEMPLATE_BASE`
svn update
@@ -563,7 +627,7 @@ function copy_template_files {
if [ -d "$1" ]; then
if [ -d "$TEMPLATE_BASE.d" ]; then
echo "Copying template files to $1..."
- if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
rsync -av --exclude=.svn $TEMPLATE_BASE.d/ $1/
else
rsync -av $TEMPLATE_BASE.d/ $1/
@@ -612,6 +676,8 @@ function gen_filelist {
xargs -0r ls -ldL --time-style=long-iso > FILELIST.TXT
echo "Created new FILELIST.TXT"
+ svn_add FILELIST.TXT
+
}
function gen_patches_filelist {
@@ -623,8 +689,12 @@ function gen_patches_filelist {
cwd="`pwd`"
cd $1
+
find . -type f -name '*.tgz' -follow -print | sort | tr '\n' '\0' | \
xargs -0r ls -ldL --time-style=long-iso > FILE_LIST
+
+ svn_add FILE_LIST
+
cd $cwd
if [ "$1" == "." ]; then
@@ -650,6 +720,10 @@ function gen_packages_txt {
echo '' > PACKAGES.TXT
find . -type f -name '*.meta' -exec cat {} \; >> PACKAGES.TXT
cat PACKAGES.TXT | gzip -9 -c - > PACKAGES.TXT.gz
+
+ svn_add PACKAGES.TXT
+ svn_add PACKAGES.TXT.gz
+
cd $cwd
if [ "$1" == "." ]; then
@@ -675,6 +749,10 @@ function gen_md5_checksums {
echo '' > CHECKSUMS.md5
find . -type f -name '*.tgz' -exec md5sum {} \; >> CHECKSUMS.md5
cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz
+
+ svn_add CHECKSUMS.md5
+ svn_add CHECKSUMS.md5.gz
+
cd $cwd
if [ "$1" == "." ]; then
@@ -730,6 +808,8 @@ function gen_meta {
echo "" >> $LOCATION/$METAFILE
+ svn_add $LOCATION/$METAFILE
+
}
# -----------------------------------------------
@@ -866,45 +946,6 @@ function handle_error {
}
# -----------------------------------------------
-# svn functions
-# -----------------------------------------------
-
-function build_repo {
-
- # Checkout a new slackbuild working copy
- # input: $1 - svn directory name
- # $2 - svn address
- [ $# -ne 2 ] && exit 5
- SVN_BASEDIR="`dirname $1`"
- mkdir -p $SVN_BASEDIR || exit 4
- cd $SVN_BASEDIR
- svn checkout $2
- cd $1
-
-}
-
-function check_repo {
-
- # Verify if repository exist
- # input: $1 - svn directory name
- # $2 - svn address
- [ $# -ne 2 ] && exit 5
- [ ! -d "$1" ] && build_repo $1 $2
-
-}
-
-function sync_repo {
-
- # Synchronize repository
- # input: $1 - svn directory name
- # $2 - svn address
- [ $# -ne 2 ] && exit 5
- cd $1
- svn update || build_repo $1 $2
-
-}
-
-# -----------------------------------------------
# misc functions
# -----------------------------------------------
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index cf8e515..84fbb28 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -19,7 +19,7 @@
# /etc/simplepkg/slackbuildrc parameters:
#
# SLACKBUILDS_DIR="/folder/to/place/slackbuilds", defaults to /var/slackbuilds
-# SVN="svn://repository", defaults do svn://slack.sarava.org/slackbuilds
+# SVN="svn://repository", defaults do http://slack.sarava.org/slackbuilds
# SYNC="yes|no", whether to always update the repository
#
@@ -58,6 +58,12 @@ ${red}DESCRIPTION${normal}
list all the SlackBuilds
${red}--sync${normal}
synchronize SlackBuilds repository
+ ${red}--update${normal}
+ synchronize packages repository
+ ${red}--commit${normal} ${green}["message"]${normal}
+ commit changes to binary packages' repository
+ ${red}--status${normal}
+ check binary packages' svn repository status
${red}-h${normal}, ${red}--help${normal}
show this help
@@ -101,18 +107,28 @@ function build_all_slackbuild {
function check_config {
- # check the configuration
- TMP=${TMP:=/tmp};
+ # Check the configuration
+ TMP=${TMP:=/tmp}
+
if [ ! -z "$REPOS" ]; then
MAKEPKG_REPOS="$REPOS"
else
REPOS=$MAKEPKG_REPOS
fi
+
+ # Nested folders, if configured
+ if [ ! -z "$MAKEPKG_REPOS_STYLE" ]; then
+ MAKEPKG_REPOS_STYLE=$(echo $MAKEPKG_REPOS_STYLE | sed -e "s/none//g" -e "s/distro/`default_distro`/g" \
+ -e "s/arch/`default_arch`/g" -e "s/version/`default_version`/g")
+ MAKEPKG_REPOS="$MAKEPKG_REPOS/$MAKEPKG_REPOS_STYLE"
+ REPOS="$REPOS/$MAKEPKG_REPOS_STYLE"
+ fi
+
# Create $TMP and $REPOS if need
[ ! -e $TMP ] && mkdir -p $TMP
[ ! -e $MAKEPKG_REPOS ] && mkdir -p $MAKEPKG_REPOS
#
- SLACKBUILDS_DIR=${SLACKBUILDS_DIR:=/var/slackbuilds}
+ SLACKBUILDS_DIR=${SLACKBUILDS_DIR:=/var/simplepkg/slackbuilds}
#
SYNC=${SYNC:=$no}
SYNC=`convert_boolean $SYNC`
@@ -236,10 +252,11 @@ function list_builds {
function load_parameters {
# Load Createpkg parameters
- MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/repos`"
- SOURCE_DIR="`eval_parameter SOURCE_DIR /var/simplaret/sources`"
- SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`"
- SLACKBUILDS_SVN="`eval_parameter SLACKBUILDS_SVN svn://slack.sarava.org/slackbuilds`"
+ MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplepkg/repos`"
+ MAKEPKG_REPOS_STYLE="`eval_parameter MAKEPKG_REPOS_STYLE none`"
+ SOURCE_DIR="`eval_parameter SOURCE_DIR /var/simplepkg/sources`"
+ SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplepkg/slackbuilds`"
+ SLACKBUILDS_SVN="`eval_parameter SLACKBUILDS_SVN http://slack.sarava.org/slackbuilds`"
COLOR_MODE="`eval_parameter COLOR_MODE none`"
CREATE_ARCH="`eval_parameter CREATE_ARCH $(default_arch)`"
@@ -247,6 +264,48 @@ function load_parameters {
REMOVE_OLD_PACKAGE="`eval_boolean_parameter REMOVE_OLD_PACKAGE $off`"
MOVE_BIN_PACKAGE="`eval_boolean_parameter MOVE_BIN_PACKAGE $off`"
+ MOVE_SLACK_REQUIRED="`eval_boolean_parameter MOVE_SLACK_REQUIRED $off`"
+
+}
+
+function repository_update {
+
+ if [ -d "$MAKEPKG_REPOS/.svn" ]; then
+ cwd="`pwd`"
+ cd $MAKEPKG_REPOS && svn update
+ cd $cwd
+ fi
+
+ mk_exit 0
+
+}
+
+function repository_status {
+
+ if [ -d "$MAKEPKG_REPOS/.svn" ]; then
+ cwd="`pwd`"
+ cd $MAKEPKG_REPOS && svn status
+ cd $cwd
+ fi
+
+ mk_exit 0
+
+}
+
+function commit_changes {
+
+ if [ -d "$MAKEPKG_REPOS/.svn" ]; then
+ cwd="`pwd`"
+ cd $MAKEPKG_REPOS
+ if [ ! -z "$1" ]; then
+ svn commit -m $*
+ else
+ svn commit
+ fi
+ cd $cwd
+ fi
+
+ mk_exit 0
}
@@ -347,6 +406,19 @@ case $1 in
list_builds
exit $EXIT_CODE
;;
+ '--update')
+ repository_update
+ exit $EXIT_CODE
+ ;;
+ '--commit')
+ shift
+ commit_changes $*
+ exit $EXIT_CODE
+ ;;
+ '--status')
+ repository_status
+ exit $EXIT_CODE
+ ;;
*)
if [ "${1:0:1}" != "-" ]; then
PACKAGE="$1"
@@ -449,33 +521,81 @@ PKG_NAME="`ls -1 -c $MAKEPKG_REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basena
[ $MOVE_BIN_PACKAGE -eq $on ] && NEW_REPOS=$MAKEPKG_REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) || NEW_REPOS=$MAKEPKG_REPOS
# Create repository directory
-# TODO: subversion integration
-[ ! -e $NEW_REPOS ] && mkdir -p $NEW_REPOS 2>/dev/null
+if [ ! -e $NEW_REPOS ]; then
+ mkdir -p $NEW_REPOS || mkdir -p $NEW_REPOS
+ if [ -d "$MAKEPKG_REPOS/.svn" ] && ! svn_check $NEW_REPOS; then
+ cwd="`pwd`"
+ cd $MAKEPKG_REPOS
+ svn add $( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} )
+ cd $cwd
+fi
# Remove old packages from repository tree
-# TODO: subversion integration
-[ $REMOVE_OLD_PACKAGE -eq $on ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null
+if [ $REMOVE_OLD_PACKAGE -eq $on ]; then
+
+ # Using subversion
+ if [ -d "`basename $NEW_REPOS`/.svn" ]; then
+
+ cwd="`pwd`"
+ cd `basename $NEW_REPOS`
+
+ PACKAGE_VERSION="`package_version $PKG_NAME`"
+ PACKAGE_ARCH="`package_arch $PKG_NAME`"
+ PACKAGE_BUILD="`package_build $PKG_NAME`"
+
+ for file in `ls $PACKAGE-*-*-*.tgz`; do
+ if svn_check $file; then
+ # Just deleted packages with different arch, version or build number
+ if [ "`package_version $file`" != "$PACKAGE_VERSION" ] || \
+ [ "`package_arch $file`" != "$PACKAGE_ARCH" ] || \
+ [ "`package_build $file`" != "$PACKAGE_BUILD" ]; then
+ svn del --force $file
+ fi
+ fi
+ done
-# Move package and slack-required to SlackBuilds-like tree
-# TODO: subversion integration
-[ $MOVE_BIN_PACKAGE -eq $on ] && mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/
-[ ! -z "$SLACK_REQUIRED" ] && cp $SLACK_REQUIRED $NEW_REPOS/$PACKAGE.slack-required
+ cd $cwd
+
+ else
+ rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null
+ fi
+fi
+
+# Move package to SlackBuilds-like tree
+if [ $MOVE_BIN_PACKAGE -eq $on ]; then
+ mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/
+ if [ -d "`basename $NEW_REPOS`/.svn" ]; then
+ cwd="`pwd`"
+ cd `basename $NEW_REPOS`
+ svn add $PKG_NAME
+ cd $cwd
+ fi
+fi
+
+# Move package's slack-required to binary repository
+if [ $MOVE_SLACK_REQUIRED -eq $on ]; then
+ if [ ! -z "$SLACK_REQUIRED" ]; then
+ cp $SLACK_REQUIRED $NEW_REPOS/$PACKAGE.slack-required
+ if ! svn_check $NEW_REPOS/$PACKAGE.slack-required; then
+ cwd="`pwd`"
+ cd `basename $NEW_REPOS`
+ svn add $PACKAGE.slack-required
+ cd $cwd
+ fi
+ fi
+fi
# Install package
if [ "$INSTALL" -eq $on ]; then
- # as we dont have the full package file name, we'll
- # use the newer file name that matches our wildcard:
-
upgradepkg --install-new $NEW_REPOS/$PKG_NAME
fi
-# TODO: subversion integration
-# generate or update all metadata
-# svn commit
# Update repository FILELIST.TXT, ...
(
cd $MAKEPKG_REPOS
gen_filelist
+ gen_md5_checksums .
+ gen_patches_filelist patches
)
exit $EXIT_CODE
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 66bb1e1..d6555a0 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -17,7 +17,6 @@
#
BASENAME="`basename $0`"
-REPOS_CONF="/etc/simplepkg/repos.conf"
COMMON="/usr/libexec/simplepkg/common.sh"
if [ -f "$COMMON" ]; then
@@ -27,6 +26,12 @@ else
exit 1
fi
+if [ -f "/etc/simplepkg/repos.conf" ]; then
+ REPOS_CONF="/etc/simplepkg/repos.conf"
+else
+ REPOS_CONF="/etc/simplepkg/default/repos.conf"
+fi
+
function simplaret_usage {
echo "usage: [ARCH=otherarch] [VERSION=otherversion] $BASENAME [OPTION] package-name"
@@ -713,11 +718,11 @@ function simplaret_search_and_process_patch {
# check if the patch was already downloaded
if echo "$DOWNLOADED_PATCHES" | grep -q " $ARCH:$VERSION:$sugested_pack "; then
- if [ "$IS_UPGRADE" != "1" ]; then
- echo Package $sugested_pack already downloaded
- # echo "Jail $root needs package $sugested_pack (already downloaded, skipping)"
+ #if [ "$IS_UPGRADE" != "1" ]; then
+ #echo Package $sugested_pack already downloaded
+ #echo "Jail $root needs package $sugested_pack (already downloaded, skipping)"
return
- fi
+ #fi
fi
pack="`echo $sugested_pack | sed -e 's/\+/\\\+/'`"
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index ad7306f..e1533c7 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -177,7 +177,7 @@ function import_export_templates {
if [ "$?" != 0 ]; then
usage
exit 1
- elif ! use_svn; then
+ elif ! templates_under_svn; then
echo $BASENAME: simplepkg not configured to use svn
exit 1
fi
@@ -242,7 +242,7 @@ function template_create {
echo Creating template `basename $TEMPLATE_BASE`...
- if use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
+ if templates_under_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
cd `dirname $TEMPLATE_BASE`
svn mkdir `dirname $TEMPLATE_BASE`
else
@@ -257,7 +257,7 @@ function template_create {
touch $TEMPLATE_BASE.perms
touch $TEMPLATE_BASE.template
- if use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
+ if templates_under_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
cd `dirname $TEMPLATE_BASE`
@@ -285,7 +285,7 @@ function template_create {
info_commit="yes"
fi
- elif use_svn && [ -d "$TEMPLATE_FOLDER/.svn" ]; then
+ elif templates_under_svn && [ -d "$TEMPLATE_FOLDER/.svn" ]; then
mkdir $TEMPLATE_BASE.{d,s}
cd $TEMPLATE_FOLDER
@@ -320,7 +320,7 @@ function template_create {
cat $orig_template/$ROOT.template > $TEMPLATE_BASE.template
fi
- if use_svn && [ -d "$orig_template/.svn" ]; then
+ if templates_under_svn && [ -d "$orig_template/.svn" ]; then
cd `dirname $TEMPLATE_BASE`
@@ -448,7 +448,7 @@ function template_add {
if [ ! -a "$TEMPLATE_BASE.d/$candidate" ]; then
mkdir -p $TEMPLATE_BASE.d/`dirname $candidate`
cp -a $jail/$candidate $TEMPLATE_BASE.d/$candidate
- if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
cwd="`pwd`"
cd $TEMPLATE_BASE.d
svn add ./$candidate
@@ -477,7 +477,7 @@ function template_add {
destination="`echo $TEMPLATE_BASE.d/$file | sed -e 's/\/$//'`"
- if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
candidate="./`dirname $file`"
mkdir -p $TEMPLATE_BASE.d/$candidate
@@ -552,12 +552,12 @@ function check_template_exist {
mkdir $TEMPLATE_BASE.$component
fi
- if use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
+ if templates_under_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
svn add $TEMPLATE_BASE.$component
info_commit="yes"
fi
- elif use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ] && \
+ elif templates_under_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ] && \
! svn_check $TEMPLATE_BASE.$component; then
cd `dirname $TEMPLATE_BASE`
@@ -582,7 +582,7 @@ function template_delete {
if [ -e "$TEMPLATE_BASE.d/$1" ]; then
# first try to remove the file from the template
- if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then
cd $TEMPLATE_BASE.d
svn del --force ./$1 || rm -rf ./$1
if [ -z "$SILENT" ]; then
@@ -606,7 +606,7 @@ function template_delete {
fi
elif [ -e "$TEMPLATE_BASE.s/$1" ]; then
- if use_svn && [ -d "$TEMPLATE_BASE.s/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_BASE.s/.svn" ]; then
cd $TEMPLATE_BASE.s
svn del --force ./$1 || rm -rf ./$1
if [ -z "$SILENT" ]; then
@@ -642,7 +642,7 @@ function template_remove {
exit 1
fi
- if use_svn && [ -d "$basedir/.svn" ]; then
+ if templates_under_svn && [ -d "$basedir/.svn" ]; then
cd $TEMPLATE_FOLDER
svn update
svn del --force $template
@@ -938,7 +938,7 @@ elif [ "$1" == "-d" ] || [ "$1" == "--delete" ]; then
elif [ "$1" == "-s" ] || [ "$1" == "--sync" ]; then
- if use_svn && [ -d "$TEMPLATE_FOLDER/.svn" ]; then
+ if templates_under_svn && [ -d "$TEMPLATE_FOLDER/.svn" ]; then
( cd $TEMPLATE_FOLDER && svn update )
true
fi