Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2009 02:31:55 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Manolis Kiagias <sonic2000gr@gmail.com>
Cc:        twh359@earthlink.net, freebsd-questions@freebsd.org
Subject:   Re: Newbie: offline package use / XFCE.
Message-ID:  <20090121023155.8c8ea863.freebsd@edvax.de>
In-Reply-To: <49765B5D.5090909@gmail.com>
References:  <op.un2t3an4zupx9r@dialup-4.249.15.110.dial1.washington2.level3.net> <49765B5D.5090909@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Jan 2009 01:16:45 +0200, Manolis Kiagias <sonic2000gr@gmail.com> wrote:
> In short, yes.  And this will be quite difficult to get right. *Unless*
> the machine you actually use to get the packages is also running
> FreeBSD.   You could then pkg_add -r xfce4 on it  and then recreate  all
> the required packages and transfer them to the target machine. To
> recreate the packages:
> 
> [...]
> 
> The same applies also if you decide to build xfce from Ports.  You could
> still create packages in the same way.
> Simply copy the packages to a CD or USB drive, and pkg_add on the target
> machine (note you will not use '-r' on it as all the packages are local)

Just as a friendly sidenote: I need to put emphasize on the fact that
you will need to install XFCE 4 on the machine with Internet access
in order to follow this procedure. If you don't mind doing this or
of you intend to run XFCE on that machine anyway, stop reading now. :-)



If you intentionally DON'T want to install XFCE 4 on the machine
you want to use to get the packages, how about trying this dirty
script?



###########################################################################



#!/bin/sh
#
# pkg_download.sh 2008-08-19
# ===============
#
# fetch a precompiled package as well as its dependencies
# for further installation

if [ "$1" = "" ]; then
	echo "$0 <package>"
	exit 1
fi

echo -n "fetching $1 ... "
if [ -f $1.tbz ]; then
	echo "$1.tbz already there"
	exit 1
fi

pkg_add -fKnrv $1 > $1.txt 2>&1

echo "done"

for DEP in `cat $1.txt | grep $1 | grep "depends on" | cut -d "'" -f 6 | cut -d "/" -f 2`; do
	echo "dependency for $1 is ${DEP}"
	$0 ${DEP}
done

rm $1.txt

exit 0



###########################################################################



Put this content into a file pkg_download.sh, chmod it +x and then run

	% ./pkg_download.sh xfce4

And yes, it's a very dirty solution, needlessly complicated,
untidy and unfriendly to use, but it will work and bypass the
need to install XFCE 4 on the machine to fetch. The script
does not compile anything, it relies on the pkg_add -r mechanism
and the presence of the proper packages on the default server.

But please note that it will download any dependency needed
recursively, which may lead you to a huge pile of tbz files.
Just think about what Gtk 2 will need...

I wrote this script in order to achieve the same goal as it
has been requested initially.





-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090121023155.8c8ea863.freebsd>