aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trunk/conf/repos.conf6
-rw-r--r--trunk/conf/simplepkg.conf40
-rw-r--r--trunk/doc/CHANGELOG13
-rw-r--r--trunk/lib/common.sh2
-rw-r--r--trunk/src/createpkg133
-rwxr-xr-xtrunk/src/simplaret16
6 files changed, 121 insertions, 89 deletions
diff --git a/trunk/conf/repos.conf b/trunk/conf/repos.conf
index c6f806f..480a0f8 100644
--- a/trunk/conf/repos.conf
+++ b/trunk/conf/repos.conf
@@ -23,7 +23,7 @@ ROOT-powerpc="workaround%http://slackintosh.workaround.ch/pub/slackintosh/"
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="sarava%http://slack.sarava.org/packages/slamd64/"
ROOT-x86_64="slackadelic%http://mirror1.slackadelic.com/slamd64/"
ROOT-x86_64="heanet%http://ftp.heanet.ie/pub/slamd64/"
@@ -38,7 +38,3 @@ ROOT-x86_64="heanet%http://ftp.heanet.ie/pub/slamd64/"
# 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/simplepkg.conf b/trunk/conf/simplepkg.conf
index b10382c..fa5f863 100644
--- a/trunk/conf/simplepkg.conf
+++ b/trunk/conf/simplepkg.conf
@@ -12,11 +12,11 @@
#---------------------------------------------------------------------
# Default architecture: set this option if you dont want simplepkg
# to use the value from /etc/slackware-version
-# DEFAULT_ARCH="i386"
+# DEFAULT_ARCH="i486"
# Default version: set this option if you dont want simplepkg
# to use the value from /etc/slackware-version
-# DEFAULT_VERSION="12.1"
+# DEFAULT_VERSION="12.2"
# Temporary folder
TMP="/tmp"
@@ -25,20 +25,23 @@ TMP="/tmp"
# MKBUILD AND CREATEPKG SECTION
#---------------------------------------------------------------------
-# Set SlackBuilds default directory for scripts
-SLACKBUILDS_DIR="/var/simplepkg/slackbuilds"
-
# Set default directory for mkbuilds
MKBUILDS_DIR="/var/simplepkg/mkbuilds"
-# Set SlackBuilds svn default repository
-SLACKBUILDS_SVN="http://slack.sarava.org/slackbuilds"
+# Set SlackBuilds default directory for scripts
+SLACKBUILDS_DIR="/var/simplepkg/slackbuilds"
+
+# Set packages default repository directory
+PACKAGES_DIR="/var/simplepkg/repos"
# Set mkbuilds svn default repository
MKBUILDS_SVN="http://slack.sarava.org/mkbuilds"
-# Set binaries default repository directory
-MAKEPKG_REPOS="/var/simplepkg/repos"
+# Set SlackBuilds svn default repository
+SLACKBUILDS_SVN="http://slack.sarava.org/slackbuilds"
+
+# Set packages svn default repository
+PACKAGES_SVN="http://slack.sarava.org/packages"
# Set the binaries default repository nested folder, useful if you manage
# packages from different distribution versions and architectures in the
@@ -50,19 +53,19 @@ MAKEPKG_REPOS="/var/simplepkg/repos"
#
# Default value is "distro/distro-version" and you should change this just
# if you know what are you doing.
-MAKEPKG_REPOS_STYLE="distro/distro-version"
+PACKAGES_REPOS_STYLE="distro/distro-version"
# Se this to "yes" if you want createpkg to put noarch packages also in
# a noarch/ folder.
-MAKEPKG_REPOS_NOARCH="off"
+PACKAGES_REPOS_NOARCH="on"
-# If your binary repository is under svn and you plan to manage it with an
+# If your packages repository is under svn and you plan to manage it with an
# user different than root, then set this parameter with the username
# owning the repository working copy.
-MAKEPKG_SVN_USER=""
+PACKAGES_SVN_USER=""
# Same as the previous option, but for svn repository group.
-MAKEPKG_SVN_GROUP=""
+PACKAGES_SVN_GROUP=""
# If your mkbuild and slackbuild repositories is under svn and you plan to
# manage it with an user different than root, then set this parameter with the
@@ -75,15 +78,14 @@ MKBUILDS_SVN_GROUP=""
# Set sources default directory
SOURCE_DIR="/var/simplepkg/sources"
-# Set color style
-# possible values are: color,gray, none
+# Set color style. Possible values are: color,gray, none.
COLOR_MODE="none"
-# Createpkg architecture
-CREATE_ARCH="i486"
+# Createpkg architecture. Use this to force createpkg to a given arch.
+# CREATEPKG_ARCH="i486"
# Remove build files
-CREATE_CLEANUP="yes"
+CREATEPKG_CLEANUP="yes"
# Remove old packages from repository tree by createpkg
REMOVE_OLD_PACKAGE="off"
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG
index 88cc8ce..e74a99c 100644
--- a/trunk/doc/CHANGELOG
+++ b/trunk/doc/CHANGELOG
@@ -6,14 +6,17 @@ simplepkg changelog
- new "compact" template storage format
- common.sh:
+ - default arch when its not present at /etc/slackware-version is now assumed to be "i486"
- other minor changes
- repository metainformationg is now added at svn control if applicable
- new functions svn_remove_empty_folders, svn_del, su_svn, chown_svn, chgrp_svn,
regexp_slash, 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 twice in any case
+ - simplaret:
+ - simplaret_search_and_process_patch do not donwload a package with the same
+ package name twice in any case
+ - simplaret_set_arch: mapping non-present architectures to i486
- default simplepkg.conf and repos.conf moved to defaults/ folder
- templatepkg and mkjail: minor changes
- templates:
@@ -40,8 +43,10 @@ simplepkg changelog
- new options --status, --update and --commit to manage subversion repository
- subversion integration
- minor changes
- - new config parameters MAKEPKG_REPOS_STYLE, MOVE_SLACK_REQUIRED, MKBUILDS_SVN_USER,
- MAKEPKG_SVN_USER, MAKEPKG_SVN_GROUP, MKBUILDS_SVN_GROUP, MAKEPKG_REPOS_NOARCH
+ - renamed config parameter CREATE_ARCH to CREATEPKG_ARCH
+ - renamed all "MAKEPKG" config parameters to "PACKAGES", "MAKEPKG_REPOS" to "PACKAGES_DIR"
+ - new config parameters PACKAGES_REPOS_STYLE, MOVE_SLACK_REQUIRED, MKBUILDS_SVN_USER,
+ PACKAGES_SVN_USER, PACKAGES_SVN_GROUP, MKBUILDS_SVN_GROUP, PACKAGES_REPOS_NOARCH, PACKAGES_SVN
- cleaner -s option output
- lspkg: fix on package search routine
- jail-commit: using unified diff
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index 89e4e25..7f299f0 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -338,7 +338,7 @@ function default_arch {
if [ -f "$1/etc/slackware-version" ]; then
arch="`cat $1/etc/slackware-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`"
if [ -z "$arch" ]; then
- arch="i386"
+ arch="i486"
fi
elif [ -f "$1/etc/slamd64-version" ] || [ -f "$1/etc/bluewhite64-version" ] || [ -f "$1/etc/sflack-version" ]; then
arch="x86_64"
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index c72cb04..3d59ce5 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -106,22 +106,22 @@ function check_config {
TMP=${TMP:=/tmp}
if [ ! -z "$REPOS" ]; then
- MAKEPKG_REPOS="$REPOS"
+ PACKAGES_DIR="$REPOS"
else
- REPOS=$MAKEPKG_REPOS
+ REPOS=$PACKAGES_DIR
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" \
+ if [ ! -z "$PACKAGES_REPOS_STYLE" ]; then
+ PACKAGES_REPOS_STYLE=$(echo $PACKAGES_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"
+ PACKAGES_DIR="$PACKAGES_DIR/$PACKAGES_REPOS_STYLE"
+ REPOS="$REPOS/$PACKAGES_REPOS_STYLE"
fi
# Create $TMP and $REPOS if need
[ ! -e $TMP ] && mkdir -p $TMP
- [ ! -e $MAKEPKG_REPOS ] && mkdir -p $MAKEPKG_REPOS
+ [ ! -e $PACKAGES_DIR ] && mkdir -p $PACKAGES_DIR
#
SLACKBUILDS_DIR=${SLACKBUILDS_DIR:=/var/simplepkg/slackbuilds}
#
@@ -156,8 +156,8 @@ function solve_dep {
if [ $EXIT_CODE -eq $ERROR_CREATEPKG_SLACKBUILD_NOTFOUND ]; then
# Try to use simplaret
- ARCH=$CREATE_ARCH simplaret --update
- ARCH=$CREATE_ARCH simplaret --install $PACK
+ ARCH=$CREATEPKG_ARCH simplaret --update
+ ARCH=$CREATEPKG_ARCH simplaret --install $PACK
[ $? -ne 0 ] && handle_error $ERROR_CREATEPKG_SLACKBUILD_NOTFOUND $PACK
elif [ $EXIT_CODE -ne 0 ]; then
handle_error $EXIT_CODE $PACK
@@ -247,33 +247,61 @@ function list_builds {
function load_parameters {
# Load Createpkg parameters
- MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplepkg/repos`"
- MAKEPKG_REPOS_STYLE="`eval_parameter MAKEPKG_REPOS_STYLE none`"
- NOARCH_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplepkg/repos`/noarch"
+ PACKAGES_DIR="`eval_parameter PACKAGES_DIR /var/simplepkg/repos`"
+ PACKAGES_SVN="`eval_parameter PACKAGES_SVN http://slack.sarava.org/packages`"
+ PACKAGES_REPOS_STYLE="`eval_parameter PACKAGES_REPOS_STYLE none`"
+ NOARCH_DIR="`eval_parameter PACKAGES_DIR /var/simplepkg/repos`/noarch"
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`"
- SVN_USER="`eval_parameter MAKEPKG_SVN_USER`"
- SVN_GROUP="`eval_parameter MAKEPKG_SVN_GROUP`"
+ SVN_USER="`eval_parameter PACKAGES_SVN_USER`"
+ SVN_GROUP="`eval_parameter PACKAGES_SVN_GROUP`"
COLOR_MODE="`eval_parameter COLOR_MODE none`"
- CREATE_ARCH="`eval_parameter CREATE_ARCH $(default_arch)`"
- CREATE_CLEANUP="`eval_parameter CREATE_CLEANUP yes`"
+ CREATEPKG_ARCH="`eval_parameter CREATEPKG_ARCH $(default_arch)`"
+ CREATEPKG_CLEANUP="`eval_parameter CREATEPKG_CLEANUP yes`"
TMP="`eval_parameter TMP /tmp`"
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`"
- MAKEPKG_REPOS_NOARCH="`eval_boolean_parameter MAKEPKG_REPOS_NOARCH $off`"
+ PACKAGES_REPOS_NOARCH="`eval_boolean_parameter PACKAGES_REPOS_NOARCH $off`"
+
+}
+
+function repository_checkout {
+
+ local svn
+
+ if [ -d "$PACKAGES_DIR" ]; then
+ mv $PACKAGES_DIR $PACKAGES_DIR.old
+ fi
+
+ if [ -z "$1" ]; then
+ svn="$1"
+ else
+ svn="$SLACKBUILDS_SVN"
+ fi
+
+ svn checkout $svn $PACKAGES_DIR
}
function repository_update {
- if [ -d "$MAKEPKG_REPOS/.svn" ]; then
+ if [ -d "$PACKAGES_DIR/.svn" ]; then
+ echo "Fetching changes from svn repository for $PACKAGES_DIR..."
cwd="`pwd`"
- chown_svn $MAKEPKG_REPOS && chgrp_svn $MAKEPKG_REPOS
- cd $MAKEPKG_REPOS && su_svn update
+ chown_svn $PACKAGES_DIR && chgrp_svn $PACKAGES_DIR
+ cd $PACKAGES_DIR && su_svn update
+ cd $cwd
+ fi
+
+ if [ -d "$NOARCH_DIR/.svn" ]; then
+ echo "Fetching changes from svn repository for $NOARCH_DIR..."
+ cwd="`pwd`"
+ chown_svn $NOARCH_DIR && chgrp_svn $NOARCH_DIR
+ cd $NOARCH_DIR && su_svn update
cd $cwd
fi
@@ -283,17 +311,17 @@ function repository_update {
function repository_status {
- if [ -d "$MAKEPKG_REPOS/.svn" ]; then
- echo "Status of $MAKEPKG_REPOS."
+ if [ -d "$PACKAGES_DIR/.svn" ]; then
+ echo "Status of $PACKAGES_DIR."
cwd="`pwd`"
- cd $MAKEPKG_REPOS && su_svn status
+ cd $PACKAGES_DIR && su_svn status
cd $cwd
fi
- if [ -d "$NOARCH_REPOS/.svn" ]; then
+ if [ -d "$NOARCH_DIR/.svn" ]; then
cwd="`pwd`"
- echo "Status of $NOARCH_REPOS."
- cd $NOARCH_REPOS && su_svn status
+ echo "Status of $NOARCH_DIR."
+ cd $NOARCH_DIR && su_svn status
cd $cwd
fi
@@ -380,7 +408,7 @@ function remove_old_package_data {
)
else
- # Using -mindepth 2 so it doesn't delete the new PACKAGE
+ # Using -mindepth 2 so it doesn't delete the new package
find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.tgz" -exec rm {} 2>/dev/null \;
find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.meta" -exec rm {} 2>/dev/null \;
find $makepkg_repos -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \;
@@ -530,9 +558,9 @@ case $1 in
;;
'--commit')
shift
- commit_changes $MAKEPKG_REPOS "`basename $MAKEPKG_REPOS:`" $*
- if [ $MAKEPKG_REPOS_NOARCH -eq $on ]; then
- commit_changes "noarch:" $NOARCH_REPOS $*
+ commit_changes $PACKAGES_DIR "`basename $PACKAGES_DIR:`" $*
+ if [ $PACKAGES_REPOS_NOARCH -eq $on ]; then
+ commit_changes "noarch:" $NOARCH_DIR $*
fi
exit $EXIT_CODE
;;
@@ -626,10 +654,10 @@ cd $SCRIPT_BASE
TMP=$TMP \
SRC_DIR=${SRC_DIR:=$SOURCE_DIR} \
SRC=${SRC_DIR:=$SOURCE_DIR} \
- ARCH=${ARCH:=$CREATE_ARCH} \
+ ARCH=${ARCH:=$CREATEPKG_ARCH} \
COLOR=${COLOR:=$COLOR_MODE} \
- REPOS=${REPOS:=$MAKEPKG_REPOS} \
- CLEANUP=${CLEANUP:=$CREATE_CLEANUP} \
+ REPOS=${REPOS:=$PACKAGES_DIR} \
+ CLEANUP=${CLEANUP:=$CREATEPKG_CLEANUP} \
INTERACT=no sh $SHELL_FLAG ./$SCRIPT_NAME
)
@@ -637,31 +665,31 @@ cd $SCRIPT_BASE
handle_error $? $PACKAGE
# Get package name
-PKG_NAME="`ls -1 -c $MAKEPKG_REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`"
+PKG_NAME="`ls -1 -c $PACKAGES_DIR/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basename`"
# Select repository directory
if [ $MOVE_BIN_PACKAGE -eq $on ]; then
SUBFOLDER="$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} )"
- NEW_REPOS=$MAKEPKG_REPOS/$SUBFOLDER
+ NEW_REPOS=$PACKAGES_DIR/$SUBFOLDER
else
SUBFOLDER="."
- NEW_REPOS=$MAKEPKG_REPOS
+ NEW_REPOS=$PACKAGES_DIR
fi
# Create the repository folders
-create_repo_folder $MAKEPKG_REPOS
+create_repo_folder $PACKAGES_DIR
# Remove old packages from repository tree
-remove_old_package_data $MAKEPKG_REPOS
+remove_old_package_data $PACKAGES_DIR
# Move package to SlackBuilds-like tree
if [ $MOVE_BIN_PACKAGE -eq $on ]; then
- mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/
+ mv $PACKAGES_DIR/$PKG_NAME $NEW_REPOS/
if [ -d "$NEW_REPOS/.svn" ]; then
(
cd $NEW_REPOS
- chown_svn $MAKEPKG_REPOS && chgrp_svn $MAKEPKG_REPOS
+ chown_svn $PACKAGES_DIR && chgrp_svn $PACKAGES_DIR
svn_add $PKG_NAME
)
fi
@@ -676,22 +704,23 @@ if [ $MOVE_BIN_PACKAGE -eq $on ]; then
fi
# Update repository metadata
-update_metadata $MAKEPKG_REPOS
+repository update
+update_metadata $PACKAGES_DIR
# General cleanup
echo Cleaning up the repository...
-svn_remove_empty_folders $MAKEPKG_REPOS
+svn_remove_empty_folders $PACKAGES_DIR
# Update noarch repository
-if [ $MAKEPKG_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch" ]; then
+if [ $PACKAGES_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch" ]; then
echo Copying package to noarch repository...
- create_repo_folder $NOARCH_REPOS
- remove_old_package_data $NOARCH_REPOS
- svn_copy $NEW_REPOS/$PKG_NAME $NOARCH_REPOS/$SUBFOLDER/
- svn_copy $NEW_REPOS/`basename $PKG_NAME .tgz`.meta $NOARCH_REPOS/$SUBFOLDER/
- svn_copy $NEW_REPOS/$PACKAGE.slack-required $NOARCH_REPOS/$SUBFOLDER/
- update_metadata $NOARCH_REPOS
- svn_remove_empty_folders $NOARCH_REPOS
+ create_repo_folder $NOARCH_DIR
+ remove_old_package_data $NOARCH_DIR
+ svn_copy $NEW_REPOS/$PKG_NAME $NOARCH_DIR/$SUBFOLDER/
+ svn_copy $NEW_REPOS/`basename $PKG_NAME .tgz`.meta $NOARCH_DIR/$SUBFOLDER/
+ svn_copy $NEW_REPOS/$PACKAGE.slack-required $NOARCH_DIR/$SUBFOLDER/
+ update_metadata $NOARCH_DIR
+ svn_remove_empty_folders $NOARCH_DIR
fi
# Install package
@@ -701,8 +730,8 @@ fi
echo "Package saved at $NEW_REPOS/$PKG_NAME"
-if [ $MAKEPKG_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch" ]; then
- echo "Aditional copy saved at $NOARCH_REPOS/$SUBFOLDER/$PKG_NAME"
+if [ $PACKAGES_REPOS_NOARCH -eq $on ] && [ "`package_arch $PKG_NAME`" == "noarch" ]; then
+ echo "Aditional copy saved at $NOARCH_DIR/$SUBFOLDER/$PKG_NAME"
fi
exit $EXIT_CODE
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 59fc3fd..700c3bc 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -995,13 +995,13 @@ function simplaret_set_arch {
local repos_type new_arch
- # any arch defined in ARCH_i386 that hasn't an entry
- # on $REPOS_CONF will be mapped to i386
+ # any arch defined in ARCH_i486 that hasn't an entry
+ # on $REPOS_CONF will be mapped to i486
- ARCH_i386=" nocona prescott pentium4m pentium4 pentium-m pentium3m pentium3 "
- ARCH_i386="$ARCH_i386 pentium2 i686 pentium-pro i586 pentium-mmx pentium i486 "
- ARCH_i386="$ARCH_i386 athlon-mp athlon-xp athlon4 athlon-tbird athlon k6 k6-2 "
- ARCH_i386="$ARCH_i386 k6-3 winchip-c6 winchip2 c3 c3-2 i386 "
+ ARCH_i486=" nocona prescott pentium4m pentium4 pentium-m pentium3m pentium3 "
+ ARCH_i486="$ARCH_i486 pentium2 i686 pentium-pro i586 pentium-mmx pentium i486 "
+ ARCH_i486="$ARCH_i486 athlon-mp athlon-xp athlon4 athlon-tbird athlon k6 k6-2 "
+ ARCH_i486="$ARCH_i486 k6-3 winchip-c6 winchip2 c3 c3-2 "
# any arch defined in ARCH_x86_64 that hasn't an entry
# on $REPOS_CONF will be mapped to x86_64
@@ -1011,8 +1011,8 @@ function simplaret_set_arch {
for repos_type in patches root repos noarch; do
if [ -z "`simplaret_repository $repos_type`" ]; then
# there's no repository definition for that arch
- if echo "$ARCH_i386" | grep -q " $ARCH "; then
- new_arch="i386"
+ if echo "$ARCH_i486" | grep -q " $ARCH "; then
+ new_arch="i486"
elif echo "$ARCH_x86_64" | grep -q " $ARCH "; then
new_arch="x86_64"
else