aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-08 00:03:16 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-08 00:03:16 +0000
commit33a8a56106adae25714eec24d1bcb4889fcf8267 (patch)
tree2b0e1cf7840f2c7514beeb6f4452acbe9fd44c24 /trunk/src
parent6878c9fdb73390836232b93ab42b50e59d742716 (diff)
downloadsimplepkg-33a8a56106adae25714eec24d1bcb4889fcf8267.tar.gz
simplepkg-33a8a56106adae25714eec24d1bcb4889fcf8267.tar.bz2
simplaret: fix, see doc/CHANGELOG
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@319 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/lspkg15
-rwxr-xr-xtrunk/src/repos99
-rwxr-xr-xtrunk/src/simplaret7
3 files changed, 26 insertions, 95 deletions
diff --git a/trunk/src/lspkg b/trunk/src/lspkg
index 74ed684..c60de49 100755
--- a/trunk/src/lspkg
+++ b/trunk/src/lspkg
@@ -16,6 +16,7 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA
#
+
function head_line {
echo "usage: [ROOT=/otherroot] `basename $0` [option expression]"
}
@@ -46,17 +47,17 @@ else
fi
if [ $# -eq 2 ]; then
- LIST_PKGS=`ls /$ROOT/var/log/packages/$2-[0-9]* 2> /dev/null`
+ LIST_PKGS="`ls /$ROOT/var/log/packages/$2-[0-9]* 2> /dev/null`"
if [ -z "$LIST_PKGS" ]; then
- LIST_PKGS=`ls /$ROOT/var/log/packages/$2* 2> /dev/null`
+ LIST_PKGS="`ls /$ROOT/var/log/packages/$2* 2> /dev/null`"
fi
elif [ $# -eq 1 ]; then
- LIST_PKGS=`ls /$ROOT/var/log/packages/$1-[0-9]* 2> /dev/null`
+ LIST_PKGS="`ls /$ROOT/var/log/packages/$1-[0-9]* 2> /dev/null`"
if [ -z "$LIST_PKGS" ]; then
- LIST_PKGS=`ls /$ROOT/var/log/packages/$1* 2> /dev/null`
+ LIST_PKGS="`ls /$ROOT/var/log/packages/$1* 2> /dev/null`"
fi
else
- LIST_PKGS=`ls /$ROOT/var/log/packages/ 2> /dev/null`
+ LIST_PKGS="`ls /$ROOT/var/log/packages/ 2> /dev/null`"
fi
LIST_PKGS="`slash $LIST_PKGS`"
@@ -118,9 +119,9 @@ case $1 in
echo "$LIST_PKGS"
else
if [ ! -z "$ROOT" ]; then
- echo "$2: package not found on /$ROOT/var/log/packages"
+ echo "$1: package not found on /$ROOT/var/log/packages"
else
- echo "$2: package not found on /var/log/packages"
+ echo "$1: package not found on /var/log/packages"
fi
fi
;;
diff --git a/trunk/src/repos b/trunk/src/repos
index c37e625..191af44 100755
--- a/trunk/src/repos
+++ b/trunk/src/repos
@@ -10,100 +10,25 @@
#
# Changes by rhatto at riseup.net to fit http://slack.sarava.org needs
#
-# TODO: - simplepkg's config file support
+# TODO: - config file options
# - integration with binary repository
# - package's and CHECKSUMS.md5 signature creation
#
-function usage {
-
- echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"
-
-}
-
-function svn_add_meta {
+BASENAME="`basename $0`"
+REPOS_CONF="/etc/simplepkg/repos.conf"
+COMMON="/usr/libexec/simplepkg/common.sh"
- find *meta -exec svn add {} 2> /dev/null \;
- find . -name *meta -exec svn add {} 2> /dev/null \;
+if [ -f "$COMMON" ]; then
+ source $COMMON
+else
+ echo "error: file $COMMON found, check your $BASENAME installation"
+ exit 1
+fi
-}
-
-function gen_filelist {
-
- local cwd
-
- for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILELIST.TXT
- echo "Created new FILELIST.TXT"
- if [ -d "patches" ]; then
- cwd="`pwd`"
- cd patches
- for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILE_LIST
- echo "Created new patches/FILE_LIST"
- cd $pwd
- fi
-
-}
-
-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
- echo "Created new PACKAGES.TXT and PACKAGES.TXT.gz"
- if [ -d "patches" ]; then
- find patches -type f -name '*.meta' -exec cat {} \; >> patches/PACKAGES.TXT
- cat patches/PACKAGES.TXT | gzip -9 -c - > patches/PACKAGES.TXT.gz
- echo "Created new patches/PACKAGES.TXT and patches/PACKAGES.TXT.gz"
- fi
-
-}
-
-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
- echo "Created new CHECKSUMS.md5 and CHECKSUMS.md5.gz"
- if [ -d "patches" ]; then
- find patches -type f -name '*.tgz' -exec md5sum {} \; >> patches/CHECKSUMS.md5
- cat patches/CHECKSUMS.md5 | gzip -9 -c - > patches/CHECKSUMS.md5.gz
- echo "Created new patches/CHECKSUMS.md5 and patches/CHECKSUMS.md5.gz"
- fi
-
-}
-
-function gen_meta {
+function usage {
- if [ ! -f $1 ]; then
- echo "File not found: $1"
- exit 1;
- else
- echo "Processing $1"
- fi
- if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).tgz[ ]{0,}$'`" == "" ]; then
- 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 )
- METAFILE=${NAME%tgz}meta
- echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE
- if [ -n "$DL_URL" ]; then
- echo "PACKAGE MIRROR: $DL_URL" >> $LOCATION/$METAFILE
- fi
- echo "PACKAGE LOCATION: $LOCATION" >> $LOCATION/$METAFILE
- echo "PACKAGE SIZE (compressed): $SIZE K" >> $LOCATION/$METAFILE
- echo "PACKAGE SIZE (uncompressed): $USIZE K" >> $LOCATION/$METAFILE
- echo "PACKAGE REQUIRED: $REQUIRED" >> $LOCATION/$METAFILE
- echo "PACKAGE CONFLICTS: $CONFLICTS" >> $LOCATION/$METAFILE
- echo "PACKAGE SUGGESTS: $SUGGESTS" >> $LOCATION/$METAFILE
- echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
- tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
- echo "" >> $LOCATION/$METAFILE
+ echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]"
}
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index 2f68743..4081f5e 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -474,7 +474,7 @@ function simplaret_get {
# get a package
# usage: simplaret_get <package-name> [--silent]
- local silent
+ local silent generate_patches
# prevent user to stay in $storage
cd
@@ -512,6 +512,7 @@ function simplaret_get {
if [ "$repos_type" == "root" ] && \
[ "$STORE_ROOT_PATCHES_ON_PATCHES_DIR" == "1" ] && echo $file | grep -q "patches"; then
folder="$PATCHES_DIR/$ARCH/$VERSION/root-$repository_name"
+ generate_patches="1"
else
folder="$storage/$repository_name"
fi
@@ -555,6 +556,10 @@ function simplaret_get {
if [ -f "$folder/$candidate.asc" ] || [ "$SIGNATURE_CHECKING" == "1" ]; then
gpg --verify $folder/$candidate.asc $folder/$candidate
fi
+ # generate the patches FILE_LIST if needed
+ if [ "$generate_patches" == "1" ]; then
+ gen_patches_filelst $folder
+ fi
simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $folder/$candidate $silent
return $?
fi