summaryrefslogtreecommitdiffstats
path: root/Makefile.config
blob: ae1d665559391956b142740a51c4fa258fa68f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

_DISTRIB_NAME := $(shell sed -n '/^.*distribution=\([^,]*\),.*/s//\1/p' /etc/product.id)
DISTRIB_NAME = "$(_DISTRIB_NAME)"
DISTRIB_VERSION = $(shell sed -n '/^.*version=\([^,]*\),.*/s//\1/p' /etc/product.id)
DISTRIB_TYPE = $(shell sed -n '/^.*type=\([^,]*\),.*/s//\1/p' /etc/product.id)
DISTRIB_DESCR = "$(_DISTRIB_NAME) release $(DISTRIB_VERSION)"


# not config, but useful everywhere :)
ARCH := $(patsubst i%86,i386,$(shell uname -m))
ARCH := $(patsubst sparc%,sparc,$(ARCH))
ARCH := $(patsubst arm%,arm,$(ARCH))

PKG_ARCH := $(patsubst i386,i586,$(ARCH))

ifeq (x86_64, $(ARCH))
LIB = lib64
else
LIB = lib
endif
f the GNU General Public License #
+# along with this program; if not, write to the Free Software #
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
+################################################################################
+
+use POSIX;
+use Digest::MD5 qw(md5 md5_hex md5_base64);
+use HTTP::Request;
+use HTTP::Request::Common;
+use LWP::UserAgent;
+use MDK::Common;
+use Locale::GetText;
+
+#- I18N.
+setlocale (LC_ALL, "");
+Locale::GetText::textdomain ("mdkupdate");
+
+sub _ {
+ my ($format, @params) = @_;
+ sprintf(Locale::GetText::I_($format), @params);
+}
+
+my $VERSION = "0.16";
+my $security = 0;
+
+sub usage {
+ print STDERR _("mdkupdate version %s
+Copyright (C) 2002 MandrakeSoft.
+This is free software and may be redistributed under the terms of the GNU GPL.
+
+usage:
+") . _(" --help - print this help message.
+") . _(" --security - use only security media.
+") . _(" -v - verbose mode.
+", $VERSION );
+ exit(0);
+}
+
+sub parse_file {
+ my ($file)=@_;
+ my @list_hosts;
+ open( FILE, $file ) or die "load_text: missing file $file : $!";
+ while (<FILE>) {
+ chomp;
+ unshift(@list_hosts,$_);
+ }
+ close( FILE );
+ reverse @list_hosts;
+}
+
+sub log_it {
+ local *LOG;
+ open LOG, ">>/var/log/mdkupdate.log" or die "can't output to log file\n";
+ print LOG @_;
+}
+
+sub fatal {
+ my ($comment)=@_;
+ printf STDERR "%s\n", $comment; exit($_[0]);
+}