From afc0d9a3c45b70edd948ce0be4a5e81d4da00c7e Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Mon, 23 Aug 2004 06:52:47 +0000 Subject: Imported from pacman-2.8.4.tar.gz --- ChangeLog | 8 ++ Makefile.in | 9 ++- TODO | 8 -- etc/pacman.conf | 7 +- scripts/gensync | 8 +- scripts/makepkg | 4 +- scripts/makeworld | 2 +- scripts/updatesync | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/db.c | 29 +------ src/list.c | 33 ++++++++ src/list.h | 7 ++ src/package.c | 6 +- src/pacman.c | 17 +++-- src/pacman.h | 2 +- src/util.c | 4 +- src/util.h | 2 +- 16 files changed, 309 insertions(+), 58 deletions(-) delete mode 100644 TODO create mode 100755 scripts/updatesync diff --git a/ChangeLog b/ChangeLog index 4118e4de..71d69b6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ VERSION DESCRIPTION ----------------------------------------------------------------------------- +2.8.4 - Added updatesync script from Jason Chu + - Changed the pacman binary to be dynamically linked + - Included a pacman.static binary as well + - Added fakeroot checks when seeing if we're root + - Fixed makepkg to use 'tail -n 1' instead of 'tail -1' + - Added patch from Kevin Piche: + - Cleanup db_loadpkgs(), add list_add_sorted() + - Fixed a memory leak in db_find_conflicts() 2.8.3 - Fixed a little makepkg bug with bash 3.0 - Fixed resolvedeps to always prefer literals over provisios - Added --config option to specify an alternate config file diff --git a/Makefile.in b/Makefile.in index 5168268d..d187db42 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -PACVER = 2.8.3 +PACVER = 2.8.4 TOPDIR = @srcdir@ SRCDIR = $(TOPDIR)/src/ @@ -45,7 +45,7 @@ SCRDIR = $(TOPDIR)/scripts/ CXX = @CC@ CXXFLAGS += @CFLAGS@ -g -Wall -pedantic -fno-exceptions \ -D_GNU_SOURCE -DPACVER=\"$(PACVER)\" -I. -Ilibftp -LDFLAGS += @LDFLAGS@ -static -Llibftp -lftp -ltar -lz +LDFLAGS += @LDFLAGS@ -Llibftp -lftp -ltar -lz SRCS = $(SRCDIR)pacman.c \ $(SRCDIR)db.c \ @@ -72,6 +72,7 @@ all: libftp.a pacman vercmp convertdb man pacman: $(OBJECTS) libftp.a $(CXX) $(OBJECTS) -o $@ $(LDFLAGS) + $(CXX) $(OBJECTS) -o $@.static -static $(LDFLAGS) vercmp: $(OBJDIR)vercmp.o $(OBJDIR)rpmvercmp.o $(CXX) $(OBJDIR)vercmp.o $(OBJDIR)rpmvercmp.o $(CXXFLAGS) -o $@ @@ -96,11 +97,13 @@ libftp.a: install: pacman vercmp convertdb man $(INSTALL) -D -m0755 pacman $(DESTDIR)$(BINDIR)/pacman + $(INSTALL) -D -m0755 pacman.static $(DESTDIR)$(BINDIR)/pacman.static $(INSTALL) -D -m0755 vercmp $(DESTDIR)$(BINDIR)/vercmp $(INSTALL) -D -m0755 convertdb $(DESTDIR)$(BINDIR)/convertdb $(INSTALL) -D -m0755 $(SCRDIR)makepkg $(DESTDIR)$(BINDIR)/makepkg $(INSTALL) -D -m0755 $(SCRDIR)makeworld $(DESTDIR)$(BINDIR)/makeworld $(INSTALL) -D -m0755 $(SCRDIR)gensync $(DESTDIR)$(BINDIR)/gensync + $(INSTALL) -D -m0755 $(SCRDIR)updatesync $(DESTDIR)$(BINDIR)/updatesync $(INSTALL) -D -m0644 $(MANSRC)pacman.8 $(DESTDIR)$(MANDIR)/man8/pacman.8 $(INSTALL) -D -m0644 $(MANSRC)makepkg.8 $(DESTDIR)$(MANDIR)/man8/makepkg.8 $(INSTALL) -D -m0644 etc/pacman.conf $(DESTDIR)/etc/pacman.conf @@ -115,7 +118,7 @@ clean: (cd libftp; make clobber) distclean: clean - rm -f pacman convertdb vercmp + rm -f pacman pacman.static convertdb vercmp rm -f Makefile rm -f config.h config.status config.log diff --git a/TODO b/TODO deleted file mode 100644 index 8cec3c94..00000000 --- a/TODO +++ /dev/null @@ -1,8 +0,0 @@ -- think about consolidating the -A/-U/-S options into one smart - install operation -- replaces code doesn't run with -U or -A -- when performing replaces, pacman should not remove old packages until - the conflict checks are passed -- handle version comparators in makepkg dep resolution (eg, glibc>=2.2.5) -- check $PACCONF env var -- add a --pretend option diff --git a/etc/pacman.conf b/etc/pacman.conf index ce10c3a9..21519138 100644 --- a/etc/pacman.conf +++ b/etc/pacman.conf @@ -30,12 +30,15 @@ HoldPkg = pacman glibc # REPOSITORIES # - can be defined here or included from another file # - pacman will search repositories in the order defined here. -# - local/custom mirrors can be added here, above the respective Include -# for that repository +# - local/custom mirrors can be added here or in separate files # +[current] +# Add your preferred servers here, they will be used first Include = /etc/pacman.d/current +[extra] +# Add your preferred servers here, they will be used first Include = /etc/pacman.d/extra #Include = /etc/pacman.d/unstable diff --git a/scripts/gensync b/scripts/gensync index a1e85f90..bdadc30b 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -20,7 +20,7 @@ # USA. # -myver='2.8.3' +myver='2.8.4' usage() { echo "gensync $myver" @@ -30,8 +30,8 @@ usage() { echo "from . gensync builds the database in a temporary directory" echo "and then compresses it to ." echo - echo "gensync will calculate md5sums of packages in , unless an" - echo "alternate [package_directory] is specified." + echo "gensync will calculate md5sums of packages in the same directory as" + echo ", unless an alternate [package_directory] is specified." echo echo "note: The name is important. It must be of the form" echo " {treename}.db.tar.gz where {treename} is the name of the custom" @@ -67,7 +67,7 @@ db_write_entry() unset groups replaces provides depends conflicts source $1 || return 1 cd $gstmpdir - mkdir $pkgname-$pkgver-$pkgrel + mkdir $pkgname-$pkgver-$pkgrel || return 1 cd $pkgname-$pkgver-$pkgrel # desc : >desc diff --git a/scripts/makepkg b/scripts/makepkg index 3497d16b..8f4103e5 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -20,7 +20,7 @@ # USA. # -myver='2.8.3' +myver='2.8.4' startdir=`pwd` PKGDEST=$startdir USE_COLOR="n" @@ -611,7 +611,7 @@ if [ "$PACKAGER" != "" ]; then else packager="Arch Linux (http://www.archlinux.org)" fi -size=`du -cb $startdir/pkg | tail -1 | awk '{print $1}'` +size=`du -cb $startdir/pkg | tail -n 1 | awk '{print $1}'` # write the .PKGINFO file msg "Generating .PKGINFO file..." diff --git a/scripts/makeworld b/scripts/makeworld index 45757977..249ae813 100755 --- a/scripts/makeworld +++ b/scripts/makeworld @@ -21,7 +21,7 @@ # toplevel=`pwd` -version="2.8.3" +version="2.8.4" usage() { echo "makeworld version $version" diff --git a/scripts/updatesync b/scripts/updatesync new file mode 100755 index 00000000..bc17addf --- /dev/null +++ b/scripts/updatesync @@ -0,0 +1,221 @@ +#!/bin/bash +# +# updatesync +# +# Copyright (c) 2004 by Jason Chu +# Derived from gensync (c) 2002-2004 Judd Vinet +# +# 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 of the License, 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. +# +# You should have received a copy of 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. +# + +myver='2.8.4' + +usage() { + echo "updatesync $myver" + echo "usage: $0