Imported from pacman-2.8.3.tar.gz

This commit is contained in:
Judd Vinet 2004-08-04 06:49:31 +00:00
parent 62913fba63
commit ad87360a71
15 changed files with 187 additions and 200 deletions

View file

@ -1,7 +1,14 @@
VERSION DESCRIPTION
-----------------------------------------------------------------------------
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
- Added "Include" directive to include repositories from
config files (inspired by Michael Baehr's patch)
- Added patch from Jason Chu:
- Even smarter file-conflict checking
2.8.2 - Fixed a segfault bug in file-conflict checks
- Made --confirm actually work. Go me.
- Made --noconfirm actually work. Go me.
2.8.1 - Added a HoldPkg option in pacman.conf, for the more
exploratory users who run things like "pacman -R pacman". It
will ask for confirmation before removing any packages listed

View file

@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
PACVER = 2.8.2
PACVER = 2.8.3
TOPDIR = @srcdir@
SRCDIR = $(TOPDIR)/src/
@ -105,6 +105,10 @@ install: pacman vercmp convertdb man
$(INSTALL) -D -m0644 $(MANSRC)makepkg.8 $(DESTDIR)$(MANDIR)/man8/makepkg.8
$(INSTALL) -D -m0644 etc/pacman.conf $(DESTDIR)/etc/pacman.conf
$(INSTALL) -D -m0644 etc/makepkg.conf $(DESTDIR)/etc/makepkg.conf
$(INSTALL) -D -m0644 etc/current $(DESTDIR)/etc/pacman.d/current
$(INSTALL) -D -m0644 etc/release $(DESTDIR)/etc/pacman.d/release
$(INSTALL) -D -m0644 etc/extra $(DESTDIR)/etc/pacman.d/extra
$(INSTALL) -D -m0644 etc/unstable $(DESTDIR)/etc/pacman.d/unstable
clean:
rm -f *~ $(OBJDIR)*.o $(MANSRC)*.8

View file

@ -1,4 +1,4 @@
.TH makepkg 8 "July 2, 2004" "makepkg #VERSION#" ""
.TH makepkg 8 "August 3, 2004" "makepkg #VERSION#" ""
.SH NAME
makepkg \- package build utility
.SH SYNOPSIS
@ -368,6 +368,9 @@ Disable color in output messages
.B "\-n, \-\-nostrip"
Do not strip binaries and libraries.
.TP
.B "\-o, \-\-nobuild"
Download and extract files only, do not build.
.TP
.B "\-p <buildscript>"
Read the package script \fI<buildscript>\fP instead of the default (\fIPKGBUILD\fP).
.TP

View file

@ -1,4 +1,4 @@
.TH pacman 8 "July 16, 2004" "pacman #VERSION#" ""
.TH pacman 8 "August 3, 2004" "pacman #VERSION#" ""
.SH NAME
pacman \- package manager utility
.SH SYNOPSIS
@ -99,6 +99,9 @@ a backwards --sync operation.
.B "\-v, \-\-verbose"
Output more status and error messages.
.TP
.B "\-\-config <path>"
Specify an alternate configuration file.
.TP
.B "\-\-noconfirm"
Bypass any and all "Are you sure?" messages. It's not a good to do this
unless you want to run pacman from a script.
@ -215,10 +218,7 @@ global options.
NoUpgrade = etc/passed etc/group etc/shadow
NoUpgrade = etc/fstab
[current]
Server = ftp://ftp.archlinux.org/current
Server = ftp://ftp.mirror.com/archlinux/current
Server = http://www.othermirror.com/arch/current
Include = /etc/pacman.d/current
[custom]
Server = file:///home/pkgs
@ -239,6 +239,10 @@ will ask for confirmation before proceeding.
Instructs pacman to ignore any upgrades for this package when performing a
\fB--sysupgrade\fP.
.TP
.B "Include = <path>"
Include another config file. This config file can include repositories or
general configuration options.
.TP
.B "ProxyServer = <host|ip>[:port]"
If set, pacman will use this proxy server for all ftp/http transfers.
.TP

18
etc/current Normal file
View file

@ -0,0 +1,18 @@
#
# CURRENT: Arch Linux core repository
#
[current]
Server = ftp://ftp.archlinux.org/current/os/i686
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/current/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current/os/i686
Server = http://archlinux.antesis.org/current/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current/os/i686
Server = ftp://ftp.kegep.tuc.gr/archlinux/current/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/current/os/i686
Server = ftp://archlinux.creativa.cl/current/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current/os/i686
Server = ftp://saule.mintis.lt/pub/linux/current/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/current/os/i686

18
etc/extra Normal file
View file

@ -0,0 +1,18 @@
#
# The Extra Repository
#
[extra]
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/extra/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/extra/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/extra/os/i686
Server = http://archlinux.antesis.org/extra/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/extra/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/extra/os/i686
Server = ftp://ftp.archlinux.org/extra/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/extra/os/i686
Server = ftp://ftp.kegep.tuc.gr/archlinux/extra/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/extra/os/i686
Server = ftp://archlinux.creativa.cl/extra/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/extra/os/i686
Server = ftp://saule.mintis.lt/pub/linux/extra/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/extra/os/i686

View file

@ -28,75 +28,17 @@ HoldPkg = pacman glibc
#
# REPOSITORIES
#
[current]
Server = ftp://ftp.archlinux.org/current/os/i686
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/current/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current/os/i686
Server = http://archlinux.antesis.org/current/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current/os/i686
Server = ftp://ftp.kegep.tuc.gr/archlinux/current/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/current/os/i686
Server = ftp://archlinux.creativa.cl/current/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current/os/i686
Server = ftp://saule.mintis.lt/pub/linux/current/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/current/os/i686
# - 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
#
# Uncomment this block to access the EXTRA package set
#
[extra]
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/extra/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/extra/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/extra/os/i686
Server = http://archlinux.antesis.org/extra/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/extra/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/extra/os/i686
Server = ftp://ftp.archlinux.org/extra/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/extra/os/i686
Server = ftp://ftp.kegep.tuc.gr/archlinux/extra/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/extra/os/i686
Server = ftp://archlinux.creativa.cl/extra/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/extra/os/i686
Server = ftp://saule.mintis.lt/pub/linux/extra/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/extra/os/i686
Include = /etc/pacman.d/current
# If you use the RELEASE tree, you should disable the CURRENT
# tree to avoid conflicts
#
#[release]
#Server = ftp://ftp.archlinux.org/release/os/i686
#Server = ftp://ftp.archlinux.de/pub/archlinux/release/os/i686
#Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/release/os/i686
#Server = http://archlinux.antesis.org/release/os/i686
#Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/release/os/i686
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/release/os/i686
#Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/release/os/i686
#Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/release/os/i686
#Server = ftp://ftp.kegep.tuc.gr/archlinux/release/os/i686
#Server = http://darkstar.ist.utl.pt/archlinux/release/os/i686
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/release/os/i686
#Server = ftp://saule.mintis.lt/pub/linux/release/os/i686
#Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/release/os/i686
Include = /etc/pacman.d/extra
# Uncomment this block to access the UNSTABLE package set
#
#[unstable]
#Server = ftp://ftp.archlinux.org/unstable/os/i686
#Server = ftp://ftp.archlinux.de/pub/archlinux/unstable/os/i686
#Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/unstable/os/i686
#Server = http://archlinux.antesis.org/unstable/os/i686
#Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/unstable/os/i686
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/unstable/os/i686
#Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/unstable/os/i686
#Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/unstable/os/i686
#Server = http://darkstar.ist.utl.pt/archlinux/unstable/os/i686
#Server = ftp://archlinux.creativa.cl/unstable/os/i686
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/unstable/os/i686
#Server = ftp://saule.mintis.lt/pub/linux/unstable/os/i686
#Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/unstable/os/i686
#Include = /etc/pacman.d/unstable
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.

21
etc/release Normal file
View file

@ -0,0 +1,21 @@
#
# The Release tree. This tree is a snapshot view of the Current (core)
# repository as it was when the last ISO was released.
#
# If you use the RELEASE tree, you should disable the CURRENT
# tree to avoid conflicts
#
[release]
Server = ftp://ftp.archlinux.org/release/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/release/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/release/os/i686
Server = http://archlinux.antesis.org/release/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/release/os/i686
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/release/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/release/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/release/os/i686
Server = ftp://ftp.kegep.tuc.gr/archlinux/release/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/release/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/release/os/i686
Server = ftp://saule.mintis.lt/pub/linux/release/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/release/os/i686

17
etc/unstable Normal file
View file

@ -0,0 +1,17 @@
#
# The Unstable tree. Contains unstable or development versions of packages.
#
[unstable]
Server = ftp://ftp.archlinux.org/unstable/os/i686
Server = ftp://ftp.archlinux.de/pub/archlinux/unstable/os/i686
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/unstable/os/i686
Server = http://archlinux.antesis.org/unstable/os/i686
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/unstable/os/i686
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/unstable/os/i686
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/unstable/os/i686
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/unstable/os/i686
Server = http://darkstar.ist.utl.pt/archlinux/unstable/os/i686
Server = ftp://archlinux.creativa.cl/unstable/os/i686
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/unstable/os/i686
Server = ftp://saule.mintis.lt/pub/linux/unstable/os/i686
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/unstable/os/i686

View file

@ -20,7 +20,7 @@
# USA.
#
myver='2.8.2'
myver='2.8.3'
usage() {
echo "gensync $myver"

View file

@ -20,7 +20,7 @@
# USA.
#
myver='2.8.2'
myver='2.8.3'
startdir=`pwd`
PKGDEST=$startdir
USE_COLOR="n"
@ -187,6 +187,7 @@ usage() {
echo " -j <jobs> Set MAKEFLAGS to \"-j<jobs>\" before building"
echo " -m, --nocolor Disable colorized output messages"
echo " -n, --nostrip Do not strip binaries/libraries"
echo " -o, --nobuild Download and extract files only"
echo " -p <buildscript> Use an alternate build script (instead of PKGBUILD)"
echo " -r, --rmdeps Remove installed dependencies after a successful build"
echo " -s, --syncdeps Install missing dependencies with pacman"
@ -209,6 +210,7 @@ NODEPS=0
FORCE=0
NOEXTRACT=0
NOSTRIP=0
NOBUILD=0
RMDEPS=0
BUILDSCRIPT="./PKGBUILD"
@ -225,6 +227,7 @@ while [ "$#" -ne "0" ]; do
--install) INSTALL=1 ;;
--force) FORCE=1 ;;
--nostrip) NOSTRIP=1 ;;
--nobuild) NOBUILD=1 ;;
--nocolor) USE_COLOR="n" ;;
--genmd5) GENMD5=1 ;;
--rmdeps) RMDEPS=1 ;;
@ -237,27 +240,28 @@ while [ "$#" -ne "0" ]; do
exit 1
;;
-*)
while getopts "cCsbdehifgj:mnrp:w:-" opt; do
while getopts "cCsbdehifgj:mnorp:w:-" opt; do
case $opt in
c) CLEANUP=1 ;;
C) CLEANCACHE=1 ;;
s) DEP_BIN=1 ;;
b) DEP_SRC=1 ;;
d) NODEPS=1 ;;
e) NOEXTRACT=1 ;;
i) INSTALL=1 ;;
g) GENMD5=1 ;;
f) FORCE=1 ;;
m) USE_COLOR="n" ;;
n) NOSTRIP=1 ;;
w) PKGDEST=$OPTARG ;;
p) BUILDSCRIPT=$OPTARG ;;
j) export MAKEFLAGS="-j$OPTARG" ;;
r) RMDEPS=1 ;;
g) GENMD5=1 ;;
h)
usage
exit 0
;;
i) INSTALL=1 ;;
j) export MAKEFLAGS="-j$OPTARG" ;;
m) USE_COLOR="n" ;;
n) NOSTRIP=1 ;;
o) NOBUILD=1 ;;
p) BUILDSCRIPT=$OPTARG ;;
r) RMDEPS=1 ;;
s) DEP_BIN=1 ;;
w) PKGDEST=$OPTARG ;;
-)
OPTIND=0
break
@ -283,7 +287,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
PKGDEST=`pwd`
cd -
cd $OLDPWD
if [ "$CLEANCACHE" = "1" ]; then
if [ "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
@ -538,6 +542,11 @@ if [ -d $startdir/pkg ]; then
fi
mkdir -p $startdir/pkg
if [ "$NOBUILD" = "1" ]; then
msg "Sources are ready."
exit 0
fi
# build
msg "Starting build()..."
build 2>&1

View file

@ -21,7 +21,7 @@
#
toplevel=`pwd`
version="2.8.2"
version="2.8.3"
usage() {
echo "makeworld version $version"

View file

@ -540,9 +540,8 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
char *filestr = NULL;
char path[PATH_MAX+1];
char *str = NULL;
struct stat buf;
struct stat buf, buf2;
PMList *conflicts = NULL;
char *sym = NULL, *symw = NULL, *symlink = NULL, *tempsym = NULL;
/* CHECK 1: check every db package against every target package */
/* XXX: I've disabled the database-against-targets check for now, as the
@ -623,88 +622,15 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
*/
/* Check if any part of the conflicting file's path is a symlink */
if(dbpkg && !ok) {
if(!sym) MALLOC(sym, PATH_MAX);
if(!symlink) MALLOC(symlink, PATH_MAX);
if(!tempsym) MALLOC(tempsym, PATH_MAX);
strncpy(sym, path, PATH_MAX);
symw = sym;
do {
/* Is it a symlink? */
if(!lstat(sym, &buf) && S_ISLNK(buf.st_mode)) {
memset(symlink, 0, PATH_MAX);
readlink(sym, symlink, PATH_MAX);
if(symlink[0] != '/') {
char *temp = strdup(sym);
strncpy(tempsym, symlink, PATH_MAX);
snprintf(symlink, PATH_MAX, "%s/%s", dirname(temp), tempsym);
FREE(temp);
}
/* If it's a directory, tack on a '/' */
if(!stat(symlink, &buf) && S_ISDIR(buf.st_mode)) {
strcat(symlink, "/");
}
if(strstr(symlink, root) == symlink) {
strncpy(tempsym, symlink+strlen(root), PATH_MAX-strlen(root));
/* If that part of the path used to exist in the package */
if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */
snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root));
if(is_in(tempsym, dbpkg->files)) {
ok = 1;
break;
}
}
strncpy(tempsym, symlink, PATH_MAX);
snprintf(symlink, PATH_MAX, "%s/", tempsym);
strncpy(tempsym, symlink+strlen(root), PATH_MAX-strlen(root));
/* If that part of the path (explicitly check for directory) used to exist in the package */
if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */
snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root));
if(is_in(tempsym, dbpkg->files)) {
ok = 1;
break;
}
}
}
}
symw = dirname(sym);
strncpy(sym, symw, PATH_MAX);
} while (strncmp(sym, root, PATH_MAX));
}
if(dbpkg && !ok) {
if(!sym) MALLOC(sym, PATH_MAX);
if(!symlink) MALLOC(symlink, PATH_MAX);
if(!tempsym) MALLOC(tempsym, PATH_MAX);
MALLOC(str, PATH_MAX);
for(k = dbpkg->files; k; k = k->next) {
snprintf(sym, PATH_MAX, "%s%s", root, (char *)k->data);
/* If the last part of the path is '/' then toss it */
if(rindex(sym, '/') == sym+strlen(sym)-1) {
sym[strlen(sym)-1] = '\0';
}
/* Is that a symlink? */
if(!lstat(sym, &buf) && S_ISLNK(buf.st_mode)) {
memset(symlink, 0, PATH_MAX);
readlink(sym, symlink, PATH_MAX);
/* It's not an absolute symlink, make it one */
if(symlink[0] != '/') {
strncpy(tempsym, symlink, PATH_MAX);
snprintf(symlink, PATH_MAX, "%s/%s", dirname(sym), tempsym);
}
/* Does the symlink point to a part of the conflicting path? */
if(strstr(path, symlink) == path)
{
/* Replace one with the other and check if it really did exist in the old package */
snprintf(tempsym, PATH_MAX, "%s%s", symlink, path+strlen(symlink));
if(!strncmp(tempsym, path, PATH_MAX)) {
ok = 1;
break;
}
}
snprintf(str, PATH_MAX, "%s%s", root, (char*)k->data);
stat(str, &buf2);
if(buf.st_ino == buf2.st_ino) {
ok = 1;
}
}
FREE(str);
}
/* Check if the conflicting file has been moved to another package/target */
if(!ok) {
@ -733,9 +659,6 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
FREEPKG(dbpkg);
}
if(sym) FREE(sym);
if(symlink) FREE(symlink);
if(tempsym) FREE(tempsym);
return(conflicts);
}

View file

@ -83,6 +83,7 @@ unsigned short pmo_s_clean = 0;
unsigned short pmo_group = 0;
/* configuration file options */
char *pmo_dbpath = NULL;
char *pmo_configfile = NULL;
char *pmo_logfile = NULL;
char *pmo_proxyhost = NULL;
unsigned short pmo_proxyport = 0;
@ -112,7 +113,6 @@ int main(int argc, char *argv[])
{
int ret = 0;
char *ptr = NULL;
char path[PATH_MAX];
pacdb_t *db_local = NULL;
char *cenv = NULL;
@ -132,6 +132,9 @@ int main(int argc, char *argv[])
/* default dbpath */
MALLOC(pmo_dbpath, PATH_MAX);
strcpy(pmo_dbpath, PKGDIR);
/* default configuration file */
MALLOC(pmo_configfile, PATH_MAX);
strcpy(pmo_configfile, PACCONF);
/* parse the command line */
ret = parseargs(PM_ADD, argc, argv);
@ -168,8 +171,7 @@ int main(int argc, char *argv[])
signal(SIGTERM, cleanup);
/* parse the system-wide config file */
snprintf(path, PATH_MAX, "/%s", PACCONF);
if(parseconfig(path)) {
if(parseconfig(pmo_configfile)) {
cleanup(1);
}
@ -2709,7 +2711,6 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
/* find the package in one of the repositories */
for(j = databases; !found && j; j = j->next) {
PMList *provides;
dbsync_t *dbs = (dbsync_t*)j->data;
/* check literals */
for(k = dbs->pkgcache; !found && k; k = k->next) {
@ -2721,17 +2722,19 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
sync->dbs = dbs;
}
}
}
for(j = databases; !found && j; j = j->next) {
PMList *provides;
dbsync_t *dbs = (dbsync_t*)j->data;
/* check provides */
if(!found) {
provides = whatprovides(dbs->db, miss->depend.name);
if(provides) {
found = 1;
/* re-fetch the package record with dependency info */
sync->pkg = db_scan(dbs->db, provides->data, INFRQ_DESC | INFRQ_DEPENDS);
sync->dbs = dbs;
}
list_free(provides);
provides = whatprovides(dbs->db, miss->depend.name);
if(provides) {
found = 1;
/* re-fetch the package record with dependency info */
sync->pkg = db_scan(dbs->db, provides->data, INFRQ_DESC | INFRQ_DEPENDS);
sync->dbs = dbs;
}
list_free(provides);
}
if(!found) {
fprintf(stderr, "error: cannot resolve dependencies for \"%s\":\n", miss->target);
@ -3257,7 +3260,8 @@ int parseargs(int op, int argc, char **argv)
{"cascade", no_argument, 0, 'c'},
{"recursive", no_argument, 0, 's'},
{"groups", no_argument, 0, 'g'},
{"noconfirm", no_argument, 0, 999},
{"noconfirm", no_argument, 0, 1000},
{"config", required_argument, 0, 1001},
{0, 0, 0, 0}
};
@ -3267,7 +3271,8 @@ int parseargs(int op, int argc, char **argv)
}
switch(opt) {
case 0: break;
case 999: pmo_noconfirm = 1; break;
case 1000: pmo_noconfirm = 1; break;
case 1001: strcpy(pmo_configfile, optarg); break;
case 'A': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_ADD); break;
case 'R': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_REMOVE); break;
case 'U': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_UPGRADE); break;
@ -3362,23 +3367,29 @@ int parseconfig(char *configfile)
return(1);
}
if(!strcmp(section, "local")) {
fprintf(stderr, "config: line %d: %s is reserved and cannot be used as a package tree\n",
fprintf(stderr, "config: line %d: '%s' is reserved and cannot be used as a package tree\n",
linenum, section);
return(1);
}
if(strcmp(section, "options")) {
/* start a new sync record */
MALLOC(sync, sizeof(sync_t));
sync->treename = strdup(section);
sync->servers = NULL;
pmc_syncs = list_add(pmc_syncs, sync);
PMList *i;
int found = 0;
for(i = pmc_syncs; i && !found; i = i->next) {
sync = (sync_t*)i->data;
if(!strcmp(sync->treename, section)) {
found = 1;
}
}
if(!found) {
/* start a new sync record */
MALLOC(sync, sizeof(sync_t));
sync->treename = strdup(section);
sync->servers = NULL;
pmc_syncs = list_add(pmc_syncs, sync);
}
}
} else {
/* directive */
if(!strlen(section)) {
fprintf(stderr, "config: line %d: all directives must belong to a section\n", linenum);
return(1);
}
ptr = line;
key = strsep(&ptr, "=");
if(key == NULL) {
@ -3387,6 +3398,10 @@ int parseconfig(char *configfile)
}
trim(key);
key = strtoupper(key);
if(!strlen(section) && strcmp(key, "INCLUDE")) {
fprintf(stderr, "config: line %d: all directives must belong to a section\n", linenum);
return(1);
}
if(ptr == NULL) {
if(!strcmp(key, "NOPASSIVEFTP")) {
pmo_nopassiveftp = 1;
@ -3400,7 +3415,12 @@ int parseconfig(char *configfile)
}
} else {
trim(ptr);
if(!strcmp(section, "options")) {
if(!strcmp(key, "INCLUDE")) {
char conf[PATH_MAX];
strncpy(conf, ptr, PATH_MAX);
vprint("config: including %s\n", conf);
parseconfig(conf);
} else if(!strcmp(section, "options")) {
if(!strcmp(key, "NOUPGRADE")) {
char *p = ptr;
char *q;
@ -3610,6 +3630,7 @@ void usage(int op, char *myname)
printf(" -w, --downloadonly download packages but do not install/upgrade anything\n");
printf(" -y, --refresh download fresh package databases from the server\n");
}
printf(" --config <path> set an alternate configuration file\n");
printf(" --noconfirm do not ask for any confirmation\n");
printf(" -v, --verbose be verbose\n");
printf(" -r, --root <path> set an alternate installation root\n");

View file

@ -22,7 +22,7 @@
#define _PAC_PACMAN_H
#ifndef PACVER
#define PACVER "2.8.2"
#define PACVER "2.8.3"
#endif
#ifndef PKGDIR
@ -30,7 +30,7 @@
#endif
#ifndef PACCONF
#define PACCONF "etc/pacman.conf"
#define PACCONF "/etc/pacman.conf"
#endif
#ifndef CACHEDIR