From 825ac89cfa857e4379e9e1baf6d470cf9e583dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Wed, 11 Jan 2012 21:43:33 -0600 Subject: fullpkg: corrected some error. --- fullpkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fullpkg b/fullpkg index fe74432..bccd816 100755 --- a/fullpkg +++ b/fullpkg @@ -27,6 +27,7 @@ done shift $(( OPTIND - 1 )) -fullpkg-find "$1" && fullpkg-build -N "$1" +build_dir="${1:-$(mktemp -d /tmp/fullpkg.XXXXXX)}" +fullpkg-find "$build_dir" && fullpkg-build -N "$build_dir" exit 0 -- cgit v1.1-4-g5e80 From 29b793a63d5f8e134f23cfebc9694a98acb316b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Wed, 25 Jan 2012 11:22:31 -0600 Subject: libremakepkg: pass arguments to makechrootpkg correctly --- libremakepkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libremakepkg b/libremakepkg index 99ab1a4..257faf4 100755 --- a/libremakepkg +++ b/libremakepkg @@ -55,7 +55,7 @@ function usage { echo '' echo 'cd to a dir containing a PKGBUILD and run:' - echo '$0 [options] [-- makechrootpkg args] [-- makepkg args]' + echo '$0 [options] [-- makechrootpkg args [-- makepkg args]]' echo 'This script will build your package on a chroot.' echo '' echo 'OPTIONS:' @@ -118,7 +118,7 @@ fi unset CLEANFIRST UPDATEFIRST LIBRECHROOT_ARGS -makechrootpkg -r "$CHROOTDIR" -l "$CHROOT" "$MAKEPKG_ARGS" +makechrootpkg -r "$CHROOTDIR" -l "$CHROOT" $MAKEPKG_ARGS ev="$?" # exit value copy_log -- cgit v1.1-4-g5e80 From 7887f99d234b4c88c3833c294869e307d2757787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Wed, 25 Jan 2012 12:12:21 -0600 Subject: is_built: faster (from fauno's branch) updated calls to is_built --- fullpkg-find | 2 +- is_built | 31 ++++++++++++++++++++++--------- prtools/prfullpkg | 4 ++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/fullpkg-find b/fullpkg-find index d253913..8c0c063 100644 --- a/fullpkg-find +++ b/fullpkg-find @@ -47,7 +47,7 @@ find_deps() { fi fi - if is_built "${pkgbase}>=${fullver}"; then + if is_built "${pkgbase}" "${fullver}"; then exit 0 # pkg is built and updated fi diff --git a/is_built b/is_built index 60f24e9..2a90d65 100755 --- a/is_built +++ b/is_built @@ -2,9 +2,10 @@ usage() { echo "$0 " echo - echo "Detect is a package is installed or in a database" + echo "Detect if a given package version is already in repos" + echo "Assuming you want greater or equal" echo - echo "Example usage: is_built \"pcre>=20\"" + echo "Example usage: is_built 'pcre' '20'" } while getopts 'h' arg; do @@ -14,12 +15,24 @@ while getopts 'h' arg; do esac done -# Checks for package, if -T returns non-zero output, egrep will return 0 -# because it finds it, so we negate the value to say it's not built. -# -Sp works backwards, it will print output only when the package already -# exists +set -x -!(sudo pacman -T "$1" | egrep "*" >/dev/null) || \ -sudo pacman -Sp "$1" --print-format "%n-%v" 2>/dev/null | egrep "*" >/dev/null +ver=${2} +pkg=${1} +pver=$(LC_ALL=C pacman -Sdp --print-format "%v" "${pkg}" 2>/dev/null) -exit $? +# if pacman fails or returns nothing +r=$? +[ "${pver}" = " there is nothing to do" ] && r=1 + +result=$(vercmp "${pver}" "${ver}") + +# if vercmp > 1 means our version is bigger +if [ ${result} -ge 0 -a ${r} -eq 0 ]; then + exit 0 +else + exit 1 +fi + +# just in case +exit 1 diff --git a/prtools/prfullpkg b/prtools/prfullpkg index dd2ba3a..bbb8d73 100755 --- a/prtools/prfullpkg +++ b/prtools/prfullpkg @@ -85,7 +85,7 @@ function find_deps { # Checks ABSROOT and look for target pkg deps. Adds them i local epoch=${epoch:-0} local fullver=$(get_fullver ${epoch} ${pkgver} ${pkgrel}) - if is_built "${pkgbase}>=${fullver}"; then + if is_built "${pkgbase}" "${fullver}"; then exit 0 # pkg is built and updated fi @@ -316,7 +316,7 @@ fi if [ $level -eq 0 ]; then if [ ! -d ${build_dir} ]; then # in case of custom -d option - mkdir -p ${build_dir} + mkdir -p ${build_dir} else cleanup # files already there can screw find_deps fi -- cgit v1.1-4-g5e80 From d9e8d78e09bed97b77bf05626ff91ec77a8f1f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 4 Feb 2012 12:57:43 -0300 Subject: Removed debug setting --- is_built | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/is_built b/is_built index 2a90d65..1fa79d2 100755 --- a/is_built +++ b/is_built @@ -15,11 +15,9 @@ while getopts 'h' arg; do esac done -set -x - ver=${2} pkg=${1} -pver=$(LC_ALL=C pacman -Sdp --print-format "%v" "${pkg}" 2>/dev/null) +pver=$(LC_ALL=C pacman -Sddp --print-format "%v" "${pkg}" 2>/dev/null) # if pacman fails or returns nothing r=$? -- cgit v1.1-4-g5e80 From 8aae92a56d577749d8ff73179ad5186ee7cba34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 4 Feb 2012 13:11:13 -0300 Subject: Tool to quickly know if a package is unfree --- is_unfree | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 is_unfree diff --git a/is_unfree b/is_unfree new file mode 100755 index 0000000..f32c193 --- /dev/null +++ b/is_unfree @@ -0,0 +1,11 @@ +#!/bin/bash +# Checks if a package is on blacklist + +# fail immediately on error +set -E + +blacklist="$XDG_CONFIG_HOME/libretools/blacklist.txt" + +egrep -q "^${1}:" "${blacklist}" + +exit $? -- cgit v1.1-4-g5e80 From 9808018ca09050ade144d0dfc0b0b6edadefa368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 4 Feb 2012 13:12:11 -0300 Subject: Diff PKGBUILDs if duplicate + use https AUR --- aur | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/aur b/aur index 1b17358..b96cb20 100755 --- a/aur +++ b/aur @@ -42,28 +42,48 @@ for _pkg in ${@}; do _pkg="${_pkg%%[<>=]*}" if [ -f "${_pkg}/PKGBUILD" ]; then - warning "${_pkg} already existed. skipping..." - continue + warning "${_pkg} already existed." + +# Check if we want to diff + if [ -z "${DIFFTOOL}" ]; then + continue + else +# Store our copy of the PKGBUILD dir + _diff="${PWD}/${_pkg}" + stdnull "pushd $(mktemp -d /tmp/${_pkg}.XXXX)" + msg2 "Downloading PKGBUILD into ${PWD} for diff" + fi fi msg "Downloading $_pkg..." - wget -O - -q http://aur.archlinux.org/packages/$_pkg/$_pkg.tar.gz | \ + wget -O - -q https://aur.archlinux.org/packages/$_pkg/$_pkg.tar.gz | \ tar xzf - >/dev/null 2>&1 - [[ $? -ne 0 ]] && { + if [ $? -ne 0 ]; then error "Couldn't get $_pkg" continue - } + fi stdnull "pushd $_pkg" + if [ ! -z "$_diff" ]; then + msg2 "Diffing files" +# Diff all files with our difftool + for file in *; do + ${DIFFTOOL} ${_diff}/${file} ${file} + done + +# Go back to our copy to continue working + stdnull "pushd ${_diff}" + fi + source PKGBUILD - pkgbuild-check-nonfree || { + if ! pkgbuild-check-nonfree; then if [ $? -eq 15 ]; then warning "This PKGBUILD links to known unfree packages" fi - } + fi msg2 "Checking license..." free=0 @@ -84,7 +104,7 @@ for _pkg in ${@}; do if ! is_built $_dep; then if ! find ${ABSROOT} -maxdepth 2 -type d -name "$_dep" | egrep "*" >/dev/null ; then msg2 "$_dep will be get from AUR" - missing_deps+=($_dep) + missing_deps+=($_dep) fi else msg2 "$_dep is on repos" -- cgit v1.1-4-g5e80 From 5ab36af3c7a505ff40bb8ca46ec387b94d85cbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sat, 4 Feb 2012 13:15:32 -0300 Subject: Create a repo by default, add [repo] to CHROOT/etc/pacman.conf to use it --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libremakepkg b/libremakepkg index 99ab1a4..06500d2 100755 --- a/libremakepkg +++ b/libremakepkg @@ -118,7 +118,7 @@ fi unset CLEANFIRST UPDATEFIRST LIBRECHROOT_ARGS -makechrootpkg -r "$CHROOTDIR" -l "$CHROOT" "$MAKEPKG_ARGS" +makechrootpkg -d -r "$CHROOTDIR" -l "$CHROOT" "$MAKEPKG_ARGS" ev="$?" # exit value copy_log -- cgit v1.1-4-g5e80 From c5d7675fa4de40514deda2757cd027bb4870424e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sun, 5 Feb 2012 00:43:43 -0300 Subject: Script to update cleansystem It creates an empty root and prints base and base-devel installation onto cleansystem. Run and commit cleansystem after. --- cleansystem | 14 +++++++++++++- update-cleansystem | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 update-cleansystem diff --git a/cleansystem b/cleansystem index b91bf86..f210416 100644 --- a/cleansystem +++ b/cleansystem @@ -6,16 +6,19 @@ bash binutils bison bzip2 +ca-certificates cloog coreutils cracklib cronie cryptsetup +curl db dbus-core device-mapper dhcpcd diffutils +dirmngr e2fsprogs expat fakeroot @@ -31,8 +34,12 @@ gettext glib2 glibc gmp +gnupg +gnupg2 +gpgme grep groff +grub gzip heirloom-mailx iana-etc @@ -44,15 +51,18 @@ isl jfsutils kbd keyutils +kmod krb5 less libarchive +libassuan libcap libfetch libffi libgcrypt libgpg-error libgssglue +libksba libldap libltdl libmpc @@ -60,6 +70,7 @@ libnl libpcap libpipeline libsasl +libssh2 libtirpc libtool libusb @@ -76,7 +87,6 @@ man-pages mdadm mkinitcpio mkinitcpio-busybox -module-init-tools mpfr nano ncurses @@ -89,12 +99,14 @@ pciutils pcmciautils pcre perl +pinentry pkg-config popt ppl ppp procps psmisc +pth readline reiserfsprogs run-parts diff --git a/update-cleansystem b/update-cleansystem new file mode 100755 index 0000000..d4ad943 --- /dev/null +++ b/update-cleansystem @@ -0,0 +1,24 @@ +#!/bin/bash +# Updates the cleansystem file +# Creates a fake Parabola root and prints all packages installable from base +# and base-devel plus extras + +set -E + +if [ ! -w / ]; then + echo "Run as root." + exit 1 +fi + +tmpdir=/tmp/cleansystem.${RANDOM} + +mkdir -p ${tmpdir}/var/lib/pacman + +# We sync first because updating info gets printed to stdout too +pacman -r ${tmpdir} --config /etc/pacman.conf -Sy +pacman -r ${tmpdir} \ + --config /etc/pacman.conf \ + -Sp --print-format "%n" \ + base base-devel ${@} | sort > $(dirname $0)/cleansystem + +exit $? -- cgit v1.1-4-g5e80