[aur-general] [arch-dev-public] Status of arch=any ?

Firmicus Firmicus at gmx.net
Wed May 6 05:45:22 EDT 2009


Abhishek Dasgupta wrote:
> 2009/5/6 Firmicus <Firmicus at gmx.net>:
>   
>> OK, back to topic. First of all, the git repo you gave me does not have
>> the patches from Abhishek. I finally figured out that I had to pull his
>> branch any-arch from github.
>>     
>
> Aaron's git repo also mirrors my any-arch branch on github so you
> should have got it when you cloned.
>   

My bad then. I had cloned the official archlinux git repo instead :/
 
>> BTW, the script convert-to-any is quite broken. I have first tried to
>> fix it but soon realized it is actually not a good idea to rely on it at
>> all. Better to create clean packages for arch=any instead.
>>     
>
> There are quite a lot of packages which need to be moved to the any
> architecture. If all of them have to be rebuilt it'll be a waste of time.
> I'll look through the convert-to-any script and try to fix it next week.
> Making this script work properly will save us a lot of time later.
>   

Why move up-to-date packages to simply change the arch parameter? We can
easily change it in the PKGBUILDs in trunk and it will occur
automatically with the next update. There is no benefit in converting
the actual packages, really. It may save some space on the server and
the mirrors but the risk that we thereby  mess things up does not
justify this IMHO.

Still, if you insist and if my fellow devs think we should massively
move architecture-independent packages to "arch=any", then I would
propose the following approach:

Clearly the first step of the process involves commiting the change to svn:

#BEGIN "commitpkg2any"
#==========================================
#!/bin/bash

if [ $# -ne 1 ]; then
    echo "Syntax: $(basename $0) <repo>"
    exit 1
fi

repo=$1

source PKGBUILD

sed -i 's|^arch=.\+$|arch=(any)|' PKGBUILD

svn commit -m "upgpkg: $pkgname $pkgver-$pkgrel
    Converted to arch=any" > /dev/null

archrelease $repo-any
if [ $? -ne 0 ]; then
    echo "Cancelled"
    exit 1
fi
echo "===> Tagged for $repo-any"

pushd ..
svn rm $repo-i686
svn rm $repo-x86_64
svn commit -m "removed $repo-i686 and $repo-x86_64 for $pkgname"
popd

echo "Don't forget to run \"/arch/convert2any\" on the package to be
converted"
echo "in your staging dir on gerolde, followed by \"/arch/db-$repo\""
#==========================================
#END

The convert2any script should only take care of converting the actual
package in the staging dir. Your convert-to-any script in fact
duplicates much of the code in db-update, which shouldn't be.

#BEGIN convert2any
#==========================================
#!/bin/bash
if [ $# -ne 1 ]; then
    echo "Syntax: $(basename $0) <package_file> (in your staging dir)"
    exit 1
fi

pkg=$1

if [ ! -f $pkg ]; then
    echo "Package not found. You can copy it here from /srv/ftp/<repo>/"
    exit 1
fi

if [ "$(basename $(readlink -f ..))" != "staging" ]; then
    echo "Error: Not in a staging dir!"
    exit 1
fi

PKGEXT=".pkg.tar.gz"

newpkg=$(echo $pkg | sed "s/-\(i686\|x86_64\)$PKGEXT/-any$PKGEXT/")
mv $pkg $newpkg
gunzip $newpkg
newtar=${newpkg%.gz}
tar xf $newtar .PKGINFO
sed -i 's/\(i686\|x86_64\)/any/' .PKGINFO
tar --delete -f $newtar .PKGINFO
tar rf $newtar .PKGINFO
rm .PKGINFO
gzip $newtar
echo "Conversion to $newpkg done"
#==========================================
#END

The rest can then be done by db-update.

Best,
F


PS: I've attached my updated patch for dbscripts, with additional
changes for cron-jobs/adjust-permissions
and cron-jobs/check_archlinux/check_packages.py




More information about the aur-general mailing list