aboutsummaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'trunk')
-rw-r--r--trunk/lib/common.sh54
-rw-r--r--trunk/mkbuild/generic.mkSlackBuild8
-rw-r--r--trunk/mkbuild/perl.mkSlackBuild8
-rwxr-xr-xtrunk/simplepkg.SlackBuild2
-rwxr-xr-xtrunk/src/simplaret54
5 files changed, 57 insertions, 69 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index 5a2cb35..2fcdb12 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -41,8 +41,7 @@ function package_version {
local file pack version
file="`basename $1`"
pack="`package_name $1`"
- version="`echo $file | sed -e "s/^$pack-//" | cut -d "-" -f 1`"
- echo $version
+ echo $file | sed -e "s/^$pack-//" | cut -d "-" -f 1
}
@@ -50,10 +49,7 @@ function package_arch {
# get ARCH from a package name
local file pack arch
- file="`basename $1`"
- pack="`package_name $1`"
- arch="`echo $file | sed -e "s/^$pack-//" | cut -d "-" -f 2`"
- echo $arch
+ echo `basename $1` | sed -e 's/.*\-\(.*\)\-.*.tgz$/\1/' -e 's/_slamd64$//g' -e 's/_sflack$//g'
}
@@ -61,10 +57,7 @@ function package_build {
# get BUILD from a package name
local file pack build
- file="`basename $1 .tgz`"
- pack="`package_name $1`"
- build="`echo $file | sed -e "s/^$pack-//" | cut -d "-" -f 3`"
- echo $build
+ echo `basename $1` | sed -e 's/.*\-.*\-\(.*\).tgz$/\1/'
}
@@ -310,10 +303,13 @@ function default_version {
# get version from /etc/slackware-version
if [ -f "$1/etc/slackware-version" ]; then
cat $1/etc/slackware-version | awk '{ print $2 }' | sed -e 's/.0$//'
+ elif [ -f "$1/etc/slamd64-version" ]; then
+ cat $1/etc/slamd64-version | awk '{ print $2 }' | sed -e 's/.0$//'
+ elif [ -f "$1/etc/bluewhite64-version" ]; then
+ cat $1/etc/bluewhite64-version | awk '{ print $2 }' | sed -e 's/.0$//'
else
aaa_base="`basename $(ls $1/var/log/packages/aaa_base-[0-9]* 2> /dev/null)`"
- pack="`basename $aaa_base | sed -e 's/-[^-]*-[^-]*-[^-]*$//'`"
- echo $aaa_base | sed -e "s/^$pack-//" | cut -d "-" -f 1 | sed -e 's/.0$//'
+ echo `package_version $aaa_base`
fi
}
@@ -323,7 +319,17 @@ function default_arch {
# get arch from /etc/slackware-version
local arch
- arch="`cat $1/etc/slackware-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`"
+
+ if [ -f "$1/etc/slackware-version" ]; then
+ arch="`cat $1/etc/slackware-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`"
+ elif [ -f "$1/etc/slamd64-version" ]; then
+ arch="`cat $1/etc/slamd64-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`"
+ elif [ -f "$1/etc/bluewhite64-version" ]; then
+ arch="`cat $1/etc/bluewhite64-version | awk '{ print $3 }' | sed -e 's/(//' -e 's/)//'`"
+ else
+ aaa_base="`basename $(ls $1/var/log/packages/aaa_base-[0-9]* 2> /dev/null)`"
+ echo `package_arch $aaa_base`
+ fi
if [ -z "$arch" ]; then
echo `uname -m`
@@ -660,13 +666,13 @@ function gen_meta {
return;
fi
- NAME=$(echo $1|sed -re "s/(.*\/)(.*.tgz)$/\2/")
- LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.tgz)$/\1/")
- SIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $1}'` / 1024 )
- USIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $2}'` / 1024 )
- REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
- CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
- SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null|xargs -r )
+ NAME=$(echo $1 | sed -re "s/(.*\/)(.*.tgz)$/\2/")
+ LOCATION=$(echo $1 | sed -re "s/(.*)\/(.*.tgz)$/\1/")
+ SIZE=$( expr `gunzip -l $1 | tail -n 1 | awk '{print $1}'` / 1024 )
+ USIZE=$( expr `gunzip -l $1 | tail -n 1 | awk '{print $2}'` / 1024 )
+ REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
+ CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
+ SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null | xargs -r )
METAFILE=${NAME%tgz}meta
echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE
@@ -683,7 +689,7 @@ function gen_meta {
echo "PACKAGE SUGGESTS: $SUGGESTS" >> $LOCATION/$METAFILE
echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
- tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
+ tar xzfO $1 install/slack-desc | grep -E '\w+\:' | grep -v '^#' >> $LOCATION/$METAFILE
echo "" >> $LOCATION/$METAFILE
@@ -692,6 +698,7 @@ function gen_meta {
# -----------------------------------------------
# Error functions
# -----------------------------------------------
+
function error_codes {
# Slackbuilds error codes ** not change **
@@ -817,6 +824,7 @@ function handle_error {
# -----------------------------------------------
# svn functions
# -----------------------------------------------
+
function build_repo {
# Checkout a new slackbuild working copy
@@ -883,7 +891,7 @@ function color_select {
messag="\033[32;1m" # blue
error="\033[31;1m" # red
alert="\033[33;1m" # yellow
- normal="\033[m" # normal
+ normal="\033[m" # normal
;;
*)
commun=""
@@ -914,6 +922,6 @@ function is_number {
return 1
else
(let int=$1) 2>/dev/null
- return $? # Exit status of the let thread
+ return $? # Exit status of the let thread
fi
}
diff --git a/trunk/mkbuild/generic.mkSlackBuild b/trunk/mkbuild/generic.mkSlackBuild
index 7653210..cc388d6 100644
--- a/trunk/mkbuild/generic.mkSlackBuild
+++ b/trunk/mkbuild/generic.mkSlackBuild
@@ -219,7 +219,11 @@ fi
# Install documentation
DOCS="[[DOCUMENTATION FILES]]"
mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
-cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
</install_documentation>
<slackdesc> off
@@ -268,6 +272,6 @@ makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERRO
<clean_builds> off
# Delete source and build directories if requested
if [ "$CLEANUP" == "yes" ]; then
- rm -rf "$PKG_SRC" "$PKG"
+ rm -rf "$PKG_SRC" "$PKG" "$PKG_WORK""
fi
</clean_builds>
diff --git a/trunk/mkbuild/perl.mkSlackBuild b/trunk/mkbuild/perl.mkSlackBuild
index 0192ed5..323c515 100644
--- a/trunk/mkbuild/perl.mkSlackBuild
+++ b/trunk/mkbuild/perl.mkSlackBuild
@@ -231,7 +231,11 @@ fi
# Install documentation
DOCS="[[DOCUMENTATION FILES]]"
mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
-cp -a $DOCS "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
</install_documentation>
<slackdesc> off
@@ -280,6 +284,6 @@ makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERRO
<clean_builds> off
# Delete source and build directories if requested
if [ "$CLEANUP" == "yes" ]; then
- rm -rf "$PKG_SRC" "$PKG"
+ rm -rf "$PKG_SRC" "$PKG" "$PKG_WORK"
fi
</clean_builds>
diff --git a/trunk/simplepkg.SlackBuild b/trunk/simplepkg.SlackBuild
index c6714d2..7ddaf30 100755
--- a/trunk/simplepkg.SlackBuild
+++ b/trunk/simplepkg.SlackBuild
@@ -18,7 +18,7 @@
PACKAGE="simplepkg"
PACK_DIR="package-$PACKAGE"
BUILD=${BUILD:=1rha}
-VERSION="0.6pre10"
+VERSION="0.6pre11"
ARCH="noarch"
LIBEXEC="/usr/libexec/$PACKAGE"
BINDIR="/usr/bin"
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index b08ba59..7f96fba 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# simplaret v0.2: simplepkg's retrieval tool
+# simplaret v0.3: simplepkg's retrieval tool
# feedback: rhatto at riseup.net | gpl
#
# Simplaret is free software; you can redistribute it and/or modify it under the
@@ -29,8 +29,8 @@ fi
function simplaret_usage {
- echo "usage: [ARCH=otherarch] [VERSION=otherversion] $BASENAME <OPTION> package-name"
- echo -e "\t OPTIONS: --install, --update, --upgrade, --search, --get, --get-patches, --purge, --remove"
+ echo "usage: [ARCH=otherarch] [VERSION=otherversion] $BASENAME [OPTION] package-name"
+ echo -e "\t OPTIONS: --help, --install, --update, --upgrade, --search, --get, --get-patches, --purge, --remove"
exit 1
}
@@ -215,8 +215,8 @@ function simplaret_repository_url {
fi
if [ "$repos_type" == "root" ]; then
- simplaret_distro_folder
- repository_url="$repository_url/$DISTRO_FOLDER/$EXTRA_FOLDER"
+ simplaret_set_arch
+ repository_url="$repository_url/`basename $repository_url`/"
fi
}
@@ -974,41 +974,6 @@ function simplaret_install {
}
-function simplaret_distro_folder {
-
- # first we point to the correct arch
- simplaret_set_arch
-
- # then we set the distro folder
- if [ "$ARCH" == "i386" ]; then
- DISTRO="slackware"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- elif [ "$ARCH" == "x86_64" ]; then
- # EXTRA_FOLDER="tree"
- DISTRO="slamd64"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- elif [ "$ARCH" == "s390" ]; then
- DISTRO="slack390"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- elif [ "$ARCH" == "x86_uclibc" ]; then
- DISTRO="ucslack"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- elif [ "$ARCH" == "arm" ]; then
- DISTRO="armedslack"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- elif [ "$ARCH" == "powerpc" ]; then
- DISTRO="slackintosh"
- DISTRO_FOLDER="$VERSION"
- elif [ "$ARCH" == "sparc" ]; then
- DISTRO="splack"
- DISTRO_FOLDER="tree-$VERSION"
- else
- DISTRO="$ARCH"
- DISTRO_FOLDER="$DISTRO-$VERSION"
- fi
-
-}
-
function simplaret_set_arch {
# set correct value for ARCH
@@ -1145,6 +1110,13 @@ case $1 in
"--purge" | "purge") shift ; simplaret_req_arg $1 simplaret_purge $* ;;
"--install" | "install") shift ; simplaret_req_arg $1 ; simplaret_install $* ;;
"--remove" | "remove") simplaret_req_arg $2 ; ROOT=/$ROOT removepkg $2 ;;
- *) simplaret_usage ;;
+ "--help" | "help") simplaret_usage ;;
+ *)
+ if echo $1 | grep -v '^--'; then
+ simplaret_install $*
+ else
+ simplaret_usage
+ fi
+ ;;
esac