From d8f1302757015d136aeab270d7214a17f2e86a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Sun, 4 Mar 2012 23:59:20 +0100 Subject: Add a script for making mips64el base tarballs. --- librebasebuilder | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 librebasebuilder diff --git a/librebasebuilder b/librebasebuilder new file mode 100644 index 0000000..3eaadd8 --- /dev/null +++ b/librebasebuilder @@ -0,0 +1,66 @@ +#!/bin/bash +# -*- coding: utf-8 -*- +# Copyright (C) 2012 Michał Masłowski +# +# 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 3 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +set -e + +# TODO: + +# - make it more configurable + +# - compare the result with previous base images + +for arg in "$@" ; do + case "$arg" in + -h|--h|--he|--hel|--help|-\?) + echo 'Usage: librebasebuilder + +Make a base tarball named parabola-mips64el-DATE.tar.bz2. + +This script must be run as root.' >&2 + exit 0 + ;; + esac +done + +[[ "$UID" != "0" ]] && { + echo "This script must be run as root." >&2 + exit 1 +} + +tempdir=/home/chroot/base +outdir=$(pwd) + +mkarchroot $tempdir mkinitcpio base sudo parted nano zile vi ed openssh + +cd $tempdir + +# Don't list mtjm's DNS servers. +cat > etc/resolv.conf < +#nameserver + +# End of file +EOF + +rm .arch-chroot + +tar cjf $outdir/parabola-mips64el-$(LC_ALL=C date -u +%Y%m%d).tar.bz2 . -- cgit v1.2.3 From 27b946270520befdb810dba04cfa0e7cab9a6bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Fri, 9 Mar 2012 21:11:09 +0100 Subject: Rename a variable to avoid having it replaced when sourcing PKGBUILDs. --- toru | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/toru b/toru index 766331b..28f0b8a 100755 --- a/toru +++ b/toru @@ -109,15 +109,15 @@ update() { local -a package_paths=() # Traverse all specified repos - for _repo in $@; do + for __repo in $@; do # Check if the repo is set as such, otherwise skip - is_repo ${_repo} || continue + is_repo ${__repo} || continue # Fullpath of the repo - _repopath=$(readlink -f ${_repo}) + _repopath=$(readlink -f ${__repo}) # This is the syncfile, stores the last date as content and mtime - local lastsyncfile=${TORUPATH}/${_repo}.lastsync + local lastsyncfile=${TORUPATH}/${__repo}.lastsync # Find all the PKGBUILDs newer than the last update # Update newer, otherwise everything @@ -131,13 +131,13 @@ update() { # Only find newer than lastsyncfile and read everything else from cache pkgbuilds=($(find ${_repopath} -maxdepth 2 -type f -name 'PKGBUILD' -newer ${lastsyncfile})) - packages_in_abs=($(read_cache ${_repo})) + packages_in_abs=($(read_cache ${__repo})) $quiet || msg2 "Getting ${#packages_in_abs[@]} packages from cache" fi - package_paths=($(read_cache ${_repo}.paths || true)) + package_paths=($(read_cache ${__repo}.paths || true)) # Inform how many PKGBUILDS were found and quit immediately if none $quiet || msg "Found $((${#pkgbuilds[*]}-1)) PKGBUILDs to update" @@ -177,16 +177,16 @@ update() { # Sync! (Only if there was an actual sync) ${update_sync_file} && lastsync ${lastsyncfile} - if [ "${lastsyncfile}" -nt "${TORUPATH}/${_repo}.paths.cache" ]; then + if [ "${lastsyncfile}" -nt "${TORUPATH}/${__repo}.paths.cache" ]; then print_package_array "${package_paths[@]}" > $TMPDIR/paths - store_cache ${_repo}.paths $TMPDIR/paths + store_cache ${__repo}.paths $TMPDIR/paths fi # If there isn't an update cache or it's older than the last update, we check - if [ "${lastsyncfile}" -nt "${TORUPATH}/${_repo}.updates.cache" ]; then + if [ "${lastsyncfile}" -nt "${TORUPATH}/${__repo}.updates.cache" ]; then # Get repo database contents - packages_in_sync=($(get_db_contents ${_repo})) + packages_in_sync=($(get_db_contents ${__repo})) # Drops arrays into files print_package_array "${packages_in_abs[@]}" > ${TMPDIR}/packages_in_abs print_package_array "${packages_in_sync[@]}" > ${TMPDIR}/packages_in_sync @@ -227,17 +227,17 @@ update() { unset _pkg _syncver _absver need_line # Save the cache - store_cache ${_repo} ${TMPDIR}/packages_in_abs + store_cache ${__repo} ${TMPDIR}/packages_in_abs # See above FIXME # print_package_array "${updates[@]}" > ${TMPDIR}/updates if [ -r ${TMPDIR}/updates ]; then - store_cache ${_repo}.updates ${TMPDIR}/updates + store_cache ${__repo}.updates ${TMPDIR}/updates fi else $quiet || msg "Reading updates from cache..." - read_cache ${_repo}.updates + read_cache ${__repo}.updates fi done # end repos @@ -252,10 +252,10 @@ missing() { ## usage: where_is # Look in all caches but pick the first one where_is() { - local _repo + local __repo local _path - for _repo in ${REPOS[@]}; do - _path=$(grep "^${1}:" "${TORUPATH}/${_repo}.paths.cache" 2>/dev/null | + for __repo in ${REPOS[@]}; do + _path=$(grep "^${1}:" "${TORUPATH}/${__repo}.paths.cache" 2>/dev/null | cut -d: -f2) [ -n "${_path}" ] && break -- cgit v1.2.3 From aa229eb53be49987b35a95e3a2dcfb2d8e21a08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Fri, 30 Mar 2012 11:01:00 +0200 Subject: fullpkg-find: correctly find CARCH-specific depends and don't needlessly rebuild kdebase. --- fullpkg-find | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fullpkg-find b/fullpkg-find index 9ddfa08..64c1790 100755 --- a/fullpkg-find +++ b/fullpkg-find @@ -34,6 +34,7 @@ get_fullver() { # Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated. find_deps() { # Check this level + source /etc/makepkg.conf source PKGBUILD local repo="${repo:-$(guess_repo)}" @@ -47,7 +48,11 @@ find_deps() { fi fi - if is_built "${pkgbase}" "${fullver}"; then + # Checking any package built, since otherwise e.g. kdebase would + # be always considered outdated: there is no package built named kdebase. + # TODO: maybe check for the package requested in case of recursive calls, + # instead of the first one listed? + if is_built "${pkgname[0]}" "${fullver}"; then exit 0 # pkg is built and updated fi -- cgit v1.2.3 From c3d8e13891a935f658f77cf15009d1491c513703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Fri, 30 Mar 2012 11:01:54 +0200 Subject: libremakepkg: fix passing makepkg arguments. --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libremakepkg b/libremakepkg index 44c0d29..7db0e3c 100755 --- a/libremakepkg +++ b/libremakepkg @@ -118,7 +118,7 @@ fi unset CLEANFIRST UPDATEFIRST LIBRECHROOT_ARGS -makechrootpkg -d -r "$CHROOTDIR" -l "$CHROOT" $MAKEPKG_ARGS +makechrootpkg -d -r "$CHROOTDIR" -l "$CHROOT" -- $MAKEPKG_ARGS ev="$?" # exit value copy_log -- cgit v1.2.3 From 203fb2c1f543bfb3caa13a4108a9d9cd386903ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Fri, 30 Mar 2012 11:02:55 +0200 Subject: Enable dependency checks for libremakepkg used by fullpkg, they might be needed. --- libretools.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretools.conf b/libretools.conf index 9e7f938..514c37d 100644 --- a/libretools.conf +++ b/libretools.conf @@ -49,9 +49,9 @@ ABSLIBREGIT=http://projects.parabolagnulinux.org/abslibre.git ## Uncomment one of those or make one of your choice # Normal fullpkg -FULLBUILDCMD="sudo libremakepkg -cuN -- -d" +FULLBUILDCMD="sudo libremakepkg -cuN" # Cross compiling fullkpg -# FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot' -- -d" +# FULLBUILDCMD="sudo libremakepkg -cuN -d '/path/to/cross-compiling/chroot'" ## Toru # Section for toru's vars -- cgit v1.2.3