Showing posts with label Slackware. Show all posts
Showing posts with label Slackware. Show all posts

Monday, December 19, 2011

slackware & git colors

By default in Slackware, the colors in git are not displayed correct. If you enable colors in git with a command like this:
git config color.ui true
instead of colored text you see escape characters like those below:
ESC[33mblablabalESC[m
This has to do with the fact that `less' which is used by git to display pages doesn't by default output escape sequences in "raw" form to the terminal (you need apply to use -R option). Executing something like this will fix the issue:
git config --global core.pager "less -FXRS"

Wednesday, March 30, 2011

Download Alien Bob's multilib support packages

I've created a Perl script to download all slackware-current multilib support packages from here. Perl really makes you a lazy programmer. You can do unbelievable many things in just a few lines.
#!/usr/bin/perl -w

use LWP::UserAgent;
use strict;

sub get_links
{
my $url = shift;
my $page = LWP::UserAgent->new->get($url)->content;

map { m@/$@ && get_links($_) || system("wget -xnH $_"); }
map { "$url$_" } $page =~ m@<a href="(.+)">\1</a>@g;
}

my $url = "http://connie.slackware.com/~alien/multilib/current/";

get_links($url);

Wednesday, January 28, 2009

Download kde4 from slackware-current

This is a script to mirror the kde4 packages from slackware-current. For now, those packages works for slackware 12.2 too.

The script may be executed multiple times from the same directory. It will detect the changes made in the repositoty, it will remove the obsolete local files and will only download the newer files that are not present in the local copy.

#!/bin/sh

# Copyright 2008-2009 Nikos Skalkotos, Athens, Greece
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


server=ftp://ftp.ntua.gr
url_path=pub/linux/slackware/slackware-current/testing/packages/kde4
url=$server/$url_path
dirs="deps extragear kde kde3-compat kde-l10n"
files="remove-kde3.sh remove-kde4.sh"

if [ "$1" = "--clean" ]; then
echo -n "Cleaning up..."
rm -fr $files $dirs
echo "done"
exit 0
fi

remove_obsolete() {
echo "Checking local directory \"$1\" for obsolete files..."
(cd $1
for i in `ls`; do
exists=`echo "$2" | grep $i`

if [ $i != "" -a "$exists" = "" ] ; then
echo "Removing file: $1/$i"
rm -f $i
fi
done
)
}


for filename in $files; do
#Those are small scripts, so I'll download them every time
rm -f $filename
wget -c $url/$filename
done

for dir in $dirs; do

#I need to create the dir the first time
mkdir -p "$dir"

echo
#Clean old files no longer listened in the repository
echo -n "Listing kde4/$dir content..."
dir_content=`curl -sl $url/$dir/`
echo "done"
remove_obsolete $dir "$dir_content"

#Now mirror the directory
(cd $dir; wget --mirror -nH -nd $url/$dir/)
done

Monday, March 17, 2008

multiple gcc versions in Slackware 12.0

Slackware's default compiler nowadays is gcc-4.1.2. If you need an older compiler from the 3.x series, then you may use the one from the pasture directory of the distribution.

The problem is that you cannot have them both, because the two packages have files with the same name. So, if you try to use installpkg to install the older compiler the installer will overwrite some gcc-4.1.2 files.

Fortunately, you don't need to compile gcc by your self. Eric Hameleers (alien bob) maintains an unofficial slackbuilds repository hosted in slackware. There is a gcc package: http://www.slackware.com/~alien/slackbuilds/gcc34/ which is compatible with the official one.