Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/arch/tests/data/fake_archlinux_repository_init.sh
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/usr/bin/env bash | |||||
# Script to generate fake-archlinux-repository.tar.gz | |||||
# Creates a git repository like https://github.com/archlinux/svntogit-packages.git | |||||
# for tests purposes | |||||
set -euo pipefail | |||||
# files and directories | |||||
mkdir -p tmp_dir/archlinux-svntogit-packages-index/ | |||||
cd tmp_dir/archlinux-svntogit-packages-index/ | |||||
mkdir -p .dot-dir | |||||
touch .dot-dir/empty | |||||
touch .dot-file | |||||
mkdir -p gzip/repos/core-x86_64 | |||||
touch gzip/repos/core-x86_64/PKGBUILD | |||||
mkdir -p mercurial/repos/extra-x86_64 | |||||
touch mercurial/repos/extra-x86_64/PKGBUILD | |||||
# Init as a git repository | |||||
git init | |||||
git add . | |||||
git commit -m "Init fake archlinux-svntogit-packages-index repository for tests purpose" | |||||
# gzip PKGBUILD | |||||
echo -e '''# Maintainer: Sébastien "Seblu" Luttringer <seblu@archlinux.org> | |||||
# Contributor: Allan McRae <allan@archlinux.org> | |||||
# Contributor: judd <jvinet@zeroflux.org> | |||||
pkgname=gzip | |||||
pkgver=1.10 | |||||
pkgrel=1 | |||||
pkgdesc='GNU compression utility' | |||||
arch=('x86_64') | |||||
url='https://www.gnu.org/software/gzip/' | |||||
license=('GPL3') | |||||
groups=('base-devel') | |||||
depends=('glibc' 'bash' 'less') | |||||
validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering | |||||
source=("https://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz"{,.sig}) | |||||
sha256sums=('ce5e03e519f637e1f814011ace35c4f87b33c0bbabeec35baf5fbd3479e91956' | |||||
'SKIP') | |||||
prepare() { | |||||
cd $pkgname-$pkgver | |||||
# apply patch from the source array (should be a pacman feature) | |||||
local filename | |||||
for filename in "${source[@]}"; do | |||||
if [[ "$filename" =~ \.patch$ ]]; then | |||||
echo "Applying patch ${filename##*/}" | |||||
patch -p1 -N -i "$srcdir/${filename##*/}" | |||||
fi | |||||
done | |||||
: | |||||
} | |||||
build() { | |||||
cd $pkgname-$pkgver | |||||
./configure --prefix=/usr | |||||
make | |||||
} | |||||
check() { | |||||
cd $pkgname-$pkgver | |||||
make check | |||||
} | |||||
package() { | |||||
cd $pkgname-$pkgver | |||||
make prefix="$pkgdir/usr" install | |||||
} | |||||
# vim:set ts=2 sw=2 et: | |||||
''' > gzip/repos/core-x86_64/PKGBUILD | |||||
git add gzip/repos/core-x86_64/PKGBUILD | |||||
git commit -m "Add gzip 1.10" | |||||
sed -i -e "s/pkgver=1.10/pkgver=1.11/g" gzip/repos/core-x86_64/PKGBUILD | |||||
git add gzip/repos/core-x86_64/PKGBUILD | |||||
git commit -m "Update to gzip to 1.11" | |||||
sed -i -e "s/pkgver=1.11/pkgver=1.12/g" gzip/repos/core-x86_64/PKGBUILD | |||||
git add gzip/repos/core-x86_64/PKGBUILD | |||||
git commit -m "Update to gzip 1.12" | |||||
# mercurial PKGBUILD | |||||
echo -e '''# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org> | |||||
# Contributor: Giovanni Scafora <giovanni@archlinux.org> | |||||
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org> | |||||
pkgname=mercurial | |||||
pkgver=6.1 | |||||
pkgrel=1 | |||||
pkgdesc='A scalable distributed SCM tool' | |||||
arch=(x86_64) | |||||
url="https://www.mercurial-scm.org/" | |||||
license=(GPL) | |||||
depends=(python) | |||||
makedepends=(python-docutils) | |||||
optdepends=('tk: for the hgk GUI') | |||||
backup=(etc/mercurial/hgrc) | |||||
source=(https://www.mercurial-scm.org/release/${pkgname}-${pkgver}.tar.gz{,.asc} | |||||
mercurial.profile) | |||||
sha512sums=('4adb8299747601d4c38b5ee83105f83810348357e244b6380b063c5ab25ea2ea2756fb0caf7f980d7cc707c27dee709b206894417aab9e6aee0818ddfe3aaf2b' | |||||
'SKIP' | |||||
'710dcddb24d928efc97370e869d9caa083107929ed9a1086dd2a3ae0caaf2c71e2f29060597e29315b6b15b1616251c42412e268ce737109c48ae4d7aa1b9555') | |||||
''' > mercurial/repos/extra-x86_64/PKGBUILD | |||||
git add mercurial/repos/extra-x86_64/PKGBUILD | |||||
git commit -m "Add mercurial 6.1" | |||||
sed -i -e "s/pkgver=6.1/pkgver=6.1.1/g" mercurial/repos/extra-x86_64/PKGBUILD | |||||
git add mercurial/repos/extra-x86_64/PKGBUILD | |||||
git commit -m "Update to mercurial 6.1.1" | |||||
sed -i -e "s/pkgver=6.1.1/pkgver=6.1.2/g" mercurial/repos/extra-x86_64/PKGBUILD | |||||
git add mercurial/repos/extra-x86_64/PKGBUILD | |||||
git commit -m "Update to mercurial 6.1.2" | |||||
# Save some space | |||||
rm .git/hooks/*.sample | |||||
# Tar archive | |||||
cd ../ | |||||
tar -czf ../fake-archlinux-svntogit-packages-index.tar.gz archlinux-svntogit-packages-index/ | |||||
# Clean up removing tmp_dir | |||||
cd ../ | |||||
rm -rf tmp_dir/ |