head	1.2;
access;
symbols
	pkgsrc-2013Q2:1.2.0.42
	pkgsrc-2013Q2-base:1.2
	pkgsrc-2012Q4:1.2.0.40
	pkgsrc-2012Q4-base:1.2
	pkgsrc-2011Q4:1.2.0.38
	pkgsrc-2011Q4-base:1.2
	pkgsrc-2011Q2:1.2.0.36
	pkgsrc-2011Q2-base:1.2
	pkgsrc-2009Q4:1.2.0.34
	pkgsrc-2009Q4-base:1.2
	pkgsrc-2008Q4:1.2.0.32
	pkgsrc-2008Q4-base:1.2
	pkgsrc-2008Q3:1.2.0.30
	pkgsrc-2008Q3-base:1.2
	cube-native-xorg:1.2.0.28
	cube-native-xorg-base:1.2
	pkgsrc-2008Q2:1.2.0.26
	pkgsrc-2008Q2-base:1.2
	cwrapper:1.2.0.24
	cwrapper-base:1.2
	pkgsrc-2008Q1:1.2.0.22
	pkgsrc-2008Q1-base:1.2
	pkgsrc-2007Q4:1.2.0.20
	pkgsrc-2007Q4-base:1.2
	pkgsrc-2007Q3:1.2.0.18
	pkgsrc-2007Q3-base:1.2
	pkgsrc-2007Q2:1.2.0.16
	pkgsrc-2007Q2-base:1.2
	pkgsrc-2007Q1:1.2.0.14
	pkgsrc-2007Q1-base:1.2
	pkgsrc-2006Q4:1.2.0.12
	pkgsrc-2006Q4-base:1.2
	pkgsrc-2006Q3:1.2.0.10
	pkgsrc-2006Q3-base:1.2
	pkgsrc-2006Q2:1.2.0.8
	pkgsrc-2006Q2-base:1.2
	pkgsrc-2006Q1:1.2.0.6
	pkgsrc-2006Q1-base:1.2
	pkgsrc-2005Q4:1.2.0.4
	pkgsrc-2005Q4-base:1.2
	pkgsrc-2005Q3:1.2.0.2
	pkgsrc-2005Q3-base:1.2
	pkgsrc-2005Q2:1.1.1.1.0.16
	pkgsrc-2005Q2-base:1.1.1.1
	pkgsrc-2005Q1:1.1.1.1.0.14
	pkgsrc-2005Q1-base:1.1.1.1
	pkgsrc-2004Q4:1.1.1.1.0.12
	pkgsrc-2004Q4-base:1.1.1.1
	pkgsrc-2004Q3:1.1.1.1.0.10
	pkgsrc-2004Q3-base:1.1.1.1
	pkgsrc-2004Q2:1.1.1.1.0.8
	pkgsrc-2004Q2-base:1.1.1.1
	pkgsrc-2004Q1:1.1.1.1.0.6
	pkgsrc-2004Q1-base:1.1.1.1
	pkgsrc-2003Q4:1.1.1.1.0.4
	pkgsrc-2003Q4-base:1.1.1.1
	netbsd-1-6-1:1.1.1.1.0.2
	netbsd-1-6-1-base:1.1.1.1
	pkgsrc-base:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2005.09.16.07.41.50;	author martti;	state dead;
branches;
next	1.1;

1.1
date	2002.09.30.08.37.14;	author martti;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2002.09.30.08.37.14;	author martti;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Removed distfetch from pkgsrc
@
text
@#!/bin/sh
#
# $NetBSD: distfetch,v 1.1 2002/09/30 08:37:14 martti Exp $
#
# Copyright (c) 2002 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Martti Kuparinen.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#        This product includes software developed by the NetBSD
#        Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``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 FOUNDATION OR CONTRIBUTORS
# 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.
#
#
# This script helps you to fetch distfiles for packages.
#
# See also:
#
# - distfetch(1)
# - __PREFIX__/share/examples/distfetch/distfetch.conf
#
PATH="/sbin:/usr/sbin:/bin:/usr/bin:${PATH}"

# Default settings
CONFIG="__PREFIX__/etc/distfetch.conf"
PKGSRCDIR="${PKGSRCDIR:=/usr/pkgsrc}"
DISTDIR="`cd ${PKGSRCDIR} && make -V DISTDIR`"
TEMPFILE="/tmp/`basename $0`.$$" 
VERBOSE=

usage() {
	cat << EOF

Usage: `basename $0` [options]

Options:

  -c filename   Location of the configuration file
  -d directory  Location of the distribution files
  -s directory  Location of pkgsrc

  -h            This help text
  -v            Be more verbose

Default settings:

  -c ${CONFIG}
  -d ${DISTDIR}
  -s ${PKGSRCDIR}

Example:

  # `basename $0` -c ~/.distfetchrc

EOF
	exit 1
}

#
# main()
#

# Read command line arguments
ARGV=`getopt c:d:hs:v $*`
[ $? != 0 ] && usage
set -- ${ARGV}
for i; do
	case "${i}" in
	-c)
		CONFIG="${2}"
		shift 2
		;;
	-d)
		DISTDIR="${2}"
		shift 2
		;;
	-h)
		usage
		;;
	-s)
		PKGSRCDIR="${2}"
		shift 2
		;;
	-v)
		VERBOSE=YES
		shift
		;;
	--)
		shift
		break
		;;
	esac
done

# Check if DISTDIR could be set
DIRECTORY="`cd ${PKGSRCDIR} && make -V DISTDIR DISTDIR=${DISTDIR}`"
if [ "x${DIRECTORY}" != "x${DISTDIR}" ]; then
	echo "Error: you already have DISTDIR=${DIRECTORY} in /etc/mk.conf"
	exit 1
fi
DISTDIR="${DIRECTORY}"
export DISTDIR

# Read the configuration file
if [ ! -r "${CONFIG}" ]; then
	echo "`basename $0`: ${CONFIG} not found"
	exit 1
fi
echo "Reading package list from ${CONFIG}"
PKGS=
for i in `sed -e 's+#.*++' -e '/^$/d' < ${CONFIG} | tr '\n' ' '`
do
	if [ ! -d "${PKGSRCDIR}/${i}" ]; then
		echo "Warning: unknown package ${i}"
		continue
	fi
	echo "===> ${i}"
	PKGS="${PKGS} ${i}"
done

# Generate a list of missing files
echo "Processing packages"
(cd ${PKGSRCDIR} && make SITE_SPECIFIC_PKGS="${PKGS}" SPECIFIC_PKGS=1 \
	fetch-list) > "${TEMPFILE}"

# Fetch distfiles into ${DISTDIR}
echo "Fetching missing distfiles into ${DISTDIR}"
if [ -z "${VERBOSE}" ]; then
	sh "${TEMPFILE}" || exit 1
else
	echo "Running \"sh -x ${TEMPFILE}\""
	sh -x "${TEMPFILE}" || exit 1
fi

rm -f "${TEMPFILE}"
echo "All done"
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
# $NetBSD$
@


1.1.1.1
log
@distfetch helps you to fetch all the distfiles you need to compile
your packages. Only the required distfiles are downloaded.
@
text
@@
