On Wed, Mar 11, 2009 at 11:26 AM, Abhishek Dasgupta <abhidg@gmail.com> wrote:
2009/3/11 Aaron Griffin <aaronmgriffin@gmail.com>:
I guess the only thing this DOESN'T take into account is the symlinking part, but that would just be a single "special case" when copying
Modified patch based on the any-arch branch: (I've added SVN check for ANYPKGS separately and symlinks)
--- db-update 2009-03-11 21:52:58.000000000 +0530 +++ db-update 2009-03-11 21:46:46.000000000 +0530 @@ -79,6 +79,7 @@ current_arch="$A"
ftppath="$FTP_BASE/$reponame/os/$current_arch/" + ftppath_any="$FTP_BASE/$reponame/os/any/"
if [ ! -d "$ftppath" ]; then echo "FTP path for this repo ($reponame) is missing" @@ -105,6 +106,7 @@ to_add="" if [ -d "$stagedir" ]; then ADDPKGS="$(/bin/ls $stagedir/*-${current_arch}$PKGEXT 2>/dev/null)" + ANYPKGS="$(/bin/ls $stagedir/*-any$PKGEXT 2>/dev/null)" fi
if [ -n "$ADDPKGS" ]; then @@ -145,6 +147,30 @@ fi done
+ for pkg in $ANYPKGS; do + _pkgfile=$(basename $pkg) + _pkgname="$(getpkgname $pkg)" + svnrepo="$reponame-any" + echo " Validating package arch (any) $_pkgname" + if ! check_pkg_arch "$pkg" "any"; then + echo " ERROR: $_pkgfile is not architecture independent!" + else + echo " Checking SVN for $_pkgname" + /usr/bin/svn up -q $_pkgname + if [ -d "$_pkgname/repos/$svnrepo" ]; then + . "$_pkgname/repos/$svnrepo/$BUILDSCRIPT" + if [ "$_pkgfile" = "$pkgname-$pkgver-$pkgrel-any$PKGEXT" ]; then + to_add="$to_add $pkg" + else + echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo" + fi + else + echo " WARNING: Package $_pkgname not found in $svnrepo" + fi + fi + done + + if [ -n "$to_add" ]; then cd "$WORKDIR/build/" for f in $to_add; do /bin/cp "$f" .; done @@ -164,12 +190,16 @@ # if non empty, move all build dirs if [ $(/bin/ls "$WORKDIR/build/" 2>/dev/null | wc -l) != 0 ]; then echo "Copying new files to '$ftppath'" - for f in "$WORKDIR/build/"*; do + for f in "$WORKDIR/build/"*$current_arch.pkg.tar.gz; do if ! /bin/cp "$f" "$ftppath"; then die "error: failure while copying files to $ftppath" fi done - + for f in "$WORKDIR/build/"*any.pkg.tar.gz; do + /bin/cp "$f" "$ftppath_any" || die "error: failure while copying files to $ftppath_any" + ln -s "$ftppath_any/$f" "$ftppath/$f" || die "error: failed to make link for $f." + done + /bin/cp "$WORKDIR/build/$reponame.db"* "$ftppath" || die "failed to move repository $reponame-$A". else echo "Nothing to copy, no work done" fi
Committed. One problem I see is that the "rm $to_add" will delete the any packages for the first arch, so they won't be processed for the next arch in the loop. I committed the patch anyway, but that will still need to be fixed