#!/bin/sh # ipkg - the itsy package management system # # Copyright (C) 2001 Carl D. Worth # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. set -e # By default do not do globbing. Any command wanting globbing should # explicitly enable it first and disable it afterwards. set -o noglob ipkg_is_upgrade () { local A B a b A=$(echo $1 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g"). B=$(echo $2 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g"). while [ \! -z "$A" ] && [ \! -z "$B" ]; do { set $A; a=$1; shift; A=$* set $B; b=$1; shift; B=$* [ "$a" -lt "$b" ] 2>&- && return 1 { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && return }; done return 1 } which md5sum 2>&1 >/dev/null || alias md5sum=md5 ipkg_srcs() { local srcre="$1" sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF } ipkg_src_names() { sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF } ipkg_src_byname() { local src="$1" ipkg_srcs $src | head -n 1 } ipkg_dests() { local destre="`echo $1 | ipkg_protect_slashes`" sed -ne "/^dest[[:space:]]\+$destre/{ s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+// s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/ p }" < $IPKG_CONF } ipkg_dest_names() { sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF } ipkg_dests_all() { ipkg_dests '.*' } ipkg_state_dirs() { ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|" } ipkg_dest_default() { ipkg_dests_all | head -n 1 } ipkg_dest_default_name() { ipkg_dest_names | head -n 1 } ipkg_dest_byname() { local dest="$1" ipkg_dests $dest | head -n 1 } ipkg_option() { local option="$1" sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF } ipkg_load_configuration() { if [ -z "$IPKG_CONF_DIR" ]; then IPKG_CONF_DIR=/etc fi IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf" if [ -z "$IPKG_OFFLINE_ROOT" ]; then IPKG_OFFLINE_ROOT="`ipkg_option offline_root`" fi # Export IPKG_OFFLINE_ROOT for use by update-alternatives export IPKG_OFFLINE_ROOT if [ -n "$DEST_NAME" ]; then IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`" if [ -z "$IPKG_ROOT" ]; then if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME"; else echo "ipkg: invalid destination specification: $DEST_NAME Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2 ipkg_dest_names >&2 return 1 fi fi else IPKG_ROOT="`ipkg_dest_default`" fi # Global ipkg state directories IPKG_DIR_PREFIX=usr/lib/opkg IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending if [ -z "$IPKG_TMP" ]; then IPKG_TMP=$IPKG_ROOT/tmp/ipkg fi [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP # Destination specific ipkg meta-data directory IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX # Proxy Support IPKG_PROXY_USERNAME="`ipkg_option proxy_username`" IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`" IPKG_HTTP_PROXY="`ipkg_option http_proxy`" IPKG_FTP_PROXY="`ipkg_option ftp_proxy`" IPKG_NO_PROXY="`ipkg_option no_proxy`" if [ -n "$IPKG_HTTP_PROXY" ]; then export http_proxy="$IPKG_HTTP_PROXY" fi if [ -n "$IPKG_FTP_PROXY" ]; then export ftp_proxy="$IPKG_FTP_PROXY" fi if [ -n "$IPKG_NO_PROXY" ]; then export no_proxy="$IPKG_NO_PROXY" fi IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conf
#!/bin/sh
grep \^CONFIG_TARGET_ .config | head -n3 > tmp/.diffconfig.head
grep '^CONFIG_ALL=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_DEVEL=y' .config >> tmp/.diffconfig.head
grep '^CONFIG_TOOLCHAINOPTS=y' .config >> tmp/.diffconfig.head
./scripts/config/conf -D tmp/.diffconfig.head -w tmp/.diffconfig.stage1 Config.in >/dev/null
./scripts/kconfig.pl '>+' tmp/.diffconfig.stage1 .config >> tmp/.diffconfig.head
./scripts/config/conf -D tmp/.diffconfig.head -w tmp/.diffconfig.stage2 Config.in >/dev/null
./scripts/kconfig.pl '>' tmp/.diffconfig.stage2 .config >> tmp/.diffconfig.head
cat tmp/.diffconfig.head
rm -f tmp/.diffconfig tmp/.diffconfig.head