From a706c17633d423d29e54bb7bfc9f225553774c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sat, 16 Oct 2010 18:32:14 -0500 Subject: =?UTF-8?q?Archivos=20primera=20versi=C3=B3n=20(no=20funciona=20bi?= =?UTF-8?q?en)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + arch2parabola | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ check-non-free | 57 +++++++++++++++ repo-list-diff | 53 ++++++++++++++ 4 files changed, 337 insertions(+) create mode 100644 .gitignore create mode 100755 arch2parabola create mode 100755 check-non-free create mode 100755 repo-list-diff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0dde19 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +#*# diff --git a/arch2parabola b/arch2parabola new file mode 100755 index 0000000..503a7a2 --- /dev/null +++ b/arch2parabola @@ -0,0 +1,225 @@ +#!/bin/bash + +# (C) Joshua Ismael Haase Hernández 2010 +# This script is free software! You can do what you want with it, as long as you don't convert it into proprietary software +# and if you redistribute it either vertabim or modified you must do so under the same licence. + +tempdir=$(mktemp -d) +logdir=$(pwd) +logname=$(echo $logdir/arch2parabola$(date +%Y%m%d).log) +mirrorfile=$() +dependancies=(which date pacman wget seq sed wget test) # "seq" y "test" are in coreutils package + # "sudo" might be optdepend or not be + # used at all and require to use as root + # as I did. +# ---------- Function Declarations ---------- + +# Define the abort procedure. +abort () { + cat <>$logname <> $logname + abort + } + else { + q="" + } + fi +} + + +section=" ---------- Sanity Check ----------" + +if [ $EUID != 0 ]; then { + cat </dev/null 2>/dev/null || { + issues="yes" + "$x is missing, please install." >> $logname + } +done + +# Check if the system is running a custom kernel. +pacman -Q kernel26 >/dev/null 2>/dev/null || { + issues="yes" + cat >>$logname <>$logname 2>> $logname || { + echo "Download failed, exiting" >> $logname + abort +} +a=($(cut -d: -f1 blacklist.txt)) + +echo "Searching for proprietary software on the system." +echo "" +b[0]="These proprietary software packages have been found on the system:" + +for i in ${a[@]} ; do + pacman -Q $i >/dev/null 2>/dev/null && b[${#b[@]}]=$i +done + +for i in $(seq 0 ${#b[@]}) ; do + echo ${b[$i]} + echo ${b[$i]} >> $logname +done +unset b[0] +section="---------- Pacman mirrorlist replacement ----------" +log_section +cat <> $logname <>$logname 2>> $logname || { + cat >> $logname <>$logname 2>> $logname || abort +pacman -Syy --noconfirm >>$logname 2>> $logname || abort + +# # Manual way, it should be replaced by a field on blacklist.txt +# # Here we declare packages that have a free replacement. +# replacements=() +# for x in ${replacements[@]}; do +# pacman -S --noconfirm $ +# done + +# ----- blacklist.txt way -----. It should be this way, this way +# linux-libre, etc, should be updated automaticaly + +for x in ${b[@]}; do + if [$x]; then + a=$(grep -e $x[:space:] blacklist.txt | cut -d: f2) + if [$a]; then + pacman -S --noconfirm $a >>$logname 2>>$logname || abort + fi + fi +done + +section="---------- Non-free packages removal ----------" +log_section +cat <>$logname 2>>$logname || abort +done + +rm -rf $tempdir + +section="---------- You are now on Parabola GNU/Linux ----------" +log_section +cat <. + + + + +dir=$(pwd) +tempdir=$(mktemp -d) +cd $tempdir + +#Run a sanity check +which pacman wget >/dev/null 2>/dev/null || { + echo "Cannot find pacman or wget, exiting"; + exit 1 +} + +echo "Downloading the blacklist of proprietary software packages." +echo "" +wget http://www.parabolagnulinux.org/docs/blacklist.txt 2>/dev/null || { + echo "Download failed, exiting" + exit 1 +} + +a=($(cut -d: -f1 blacklist.txt)) + +source dir/PKGBUILD + +echo "" +b[0]="" + +for i in ${a[@]} ; do + pacman -Q $i >/dev/null 2>/dev/null && b[${#b[@]}]=$i +done + +for i in $(seq 0 ${#b[@]}) ; do + echo ${b[$i]} +done +rm -rf $tempdir +exit 0 diff --git a/repo-list-diff b/repo-list-diff new file mode 100755 index 0000000..49aea51 --- /dev/null +++ b/repo-list-diff @@ -0,0 +1,53 @@ +#!/bin/bash +# (C) This script is free software! You can do what you want with it, as long as you don't convert it into proprietary software +# and if you redistribute it either vertabim or modified you must do so under the same licence or GPLv3 or later. + +dirname=$(pwd) +tempdir=$(mktemp -d) +cd $tempdir + +#Run a sanity check +which pacman sudo wget >/dev/null 2>/dev/null || { + echo "Cannot find pacman, sudo or wget, exiting"; + exit 1 +} + +echo "" +echo "Updating pacman database." +echo "" +sudo pacman -Sy --noconfirm >>"$dirname/db-sync" 2>>"$dirname/db-sync" + +echo "Downloading the whitelist of free software packages." +echo "" +wget http://www.parabolagnulinux.org/docs/whitelist.txt 2>/dev/null || { + echo "Download failed, exiting" + exit 1 +} + +a=($(cut -d: -f1 whitelist.txt)) + +echo "Searching for packages in whitelist and not in repo" +echo "" + +for i in ${a[@]} ; do + pacman -Si $i >/dev/null 2>/dev/null || echo $i >> "$dirname/in whitelist and not in repo" +done + +echo "Downloading the blacklist of proprietary software packages." +echo "" +wget http://www.parabolagnulinux.org/docs/blacklist.txt 2>/dev/null || { + echo "Download failed, exiting" + exit 1 +} + +a=($(cut -d: -f1 blacklist.txt)) + +echo "Searching for packages in blacklist and in repo" +echo "" + +for i in ${a[@]} ; do + pacman -Si $i >/dev/null 2>/dev/null && echo $i >> "$dirname/in blacklist and in repo" +done + +rm -rf $tempdir +exit 0 -- cgit v1.2.3