Commit 282290b9 authored by Seblu's avatar Seblu
Browse files

Remove repository handling stuff

All the code related to repository management is moved to archrepo.

This is a transient repository to a final repman. w&s.
parent 67180b8f
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ pkgdesc='Seblu Archlinux Utils'
arch=('any')
url='https://github.com/seblu/archutils'
license=('GPL2')
depends=('python' 'bash' 'devtools')
depends=('python' 'bash')

#pkgver() {
#  git log -1 --pretty=format:%h
@@ -15,18 +15,12 @@ depends=('python' 'bash' 'devtools')

package() {
  cd "$startdir"
  install -dm755 "$pkgdir"/usr/{share/licenses/$pkgname,share/devtools,bin}
  install -dm755 "$pkgdir"/usr/{share/licenses/$pkgname,bin}
  # install legal stuff
  install -m644 COPYRIGHT LICENSE "$pkgdir/usr/share/licenses/$pkgname"
  # install config
  install -m644 pacman-seblu.conf "$pkgdir/usr/share/devtools"
  # install binaries
  install -m755 atc seblu-build seblu-repo-add aurdown seblu-build-commit \
    seblu-update go2chroot seblu-commit	addpkg sign archbuild-dl pkgbuild2json \
    seblu-remove tmpmakepkg seblu-cleanup seblu-list "$pkgdir/usr/bin"
  # symlink archbuild
  ln -s archbuild $pkgdir/usr/bin/seblu-i686-build
  ln -s archbuild $pkgdir/usr/bin/seblu-x86_64-build
  install -m755 atc aurdown go2chroot	addpkg sign archbuild-dl pkgbuild2json \
    tmpmakepkg "$pkgdir/usr/bin"
}

# vim:set ts=2 sw=2 et:

pacman-seblu.conf

deleted100644 → 0
+0 −98
Original line number Diff line number Diff line
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
HoldPkg     = pacman glibc
# If upgrades are available for these packages they will be asked for first
#SyncFirst   = pacman
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
#UseDelta
#TotalDownload
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists

# PGP signature checking
# NOTE: None of this will work without running `pacman-key --init` first.
# The compiled in default is equivalent to the following line. This requires
# you to locally sign and trust packager keys using `pacman-key` for them to be
# considered valid.
#SigLevel = Optional TrustedOnly
# If you wish to check signatures but avoid local sign and trust issues, use
# the following line. This will treat any key imported into pacman's keyring as
# trusted.
#SigLevel = Optional TrustAll
# For now, off by default unless you read the above.
SigLevel = Never

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[testing]
#Include = /etc/pacman.d/mirrorlist
[seblu]
Server = http://127.0.0.1/archlinux/$repo/$arch

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

#[community-testing]
#Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

seblu-build

deleted100755 → 0
+0 −52
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © Sébastien Luttringer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

#chroot='/var/tmp/chroots'
#chroot_32="$chroot/seblu-i686"
#chroot_64="$chroot/seblu-x86_64"

[[ ! -f PKGBUILD ]] && echo 'No PKGBUILD' && exit 1

source /etc/makepkg.conf
source PKGBUILD

# usage : in_array( $needle, $haystack )
# return : 0 - found
#          1 - not found
in_array() {
	local needle=$1; shift
	local item
	for item in "$@"; do
	   [[ $item = $needle ]] && return 0 # Found
	done
	return 1 # Not Found
}

# arch x86 and any builds
if in_array 'i686' "${arch[@]}" || in_array 'any' "${arch[@]}"; then
	#linux32 makechrootpkg -c -r "$chroot_32" || exit 1
	seblu-i686-build
fi

# arch amd64 build
if in_array 'x86_64' "${arch[@]}"; then
	#linux64 makechrootpkg -c -r "$chroot_64" || exit 1
	seblu-x86_64-build
fi

# vim:set ts=2 sw=2 ft=sh noet:

seblu-build-commit

deleted100755 → 0
+0 −21
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © Sébastien Luttringer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

seblu-build && seblu-commit

# vim:set ts=2 sw=2 ft=sh noet:

seblu-cleanup

deleted100755 → 0
+0 −53
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © Sébastien Luttringer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

db='seblu.db.tar.gz'
repo='/srv/http/archlinux/seblu'
arch=('i686' 'x86_64')

# source makepkg config
. /etc/makepkg.conf

cleanup() {
	[[ -e $dir_file ]] && rm -f "$dir_file"
	[[ -e $db_file ]] && rm -f "$db_file"
}

# remove temp file on exit
trap cleanup 0

# create temporary files for computes diff
dir_file=$(mktemp ${0##*/}.XXXXX)
db_file=$(mktemp ${0##*/}.XXXXX)

# naive implementation without locking
for arch in "${arch[@]}"; do
	[[ -t 1 ]] && echo ":: Cleaning $repo/$arch"
	# list files in directory
	find "$repo/$arch" -type f -name "*${PKGEXT}" -printf '%f\n'|sort > "$dir_file"
	# list files in database
	bsdtar -xOf "$repo/$arch/$db" | awk '/^%FILENAME%/{getline;print}'|sort > "$db_file"
	# compute file not in db
	comm -23 "$dir_file" "$db_file" | while read -r file; do
		rm -v -f "$repo/$arch/$file"{,.sig}
	done
done

exit 0

# vim:set ts=2 sw=2 ft=sh noet:
Loading