Imported from pacman-2.2.tar.gz

This commit is contained in:
Judd Vinet 2002-12-11 21:56:52 +00:00
parent 6a654187b6
commit 9d9b0e8d26
15 changed files with 125 additions and 66 deletions

View file

@ -1,5 +1,10 @@
VERSION DESCRIPTION
------------------------------------------------------------------
2.2 - More bugfixes
- Added --downloadonly switch to --sync
2.1 - Lots of bugfixes
- Added support for multiple respositories
- Improved the config file layout
- Improved dependency resolution and sorting
2.0 - Added dependency functionality
- Completely new database format, similar to FreeBSD

View file

@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
PACVER = 2.1
PACVER = 2.2
LIBTAR_VERSION = 1.2.5
TOPDIR = @srcdir@

5
README
View file

@ -55,3 +55,8 @@ licensed through the GNU General Public License (see COPYING).
pacman uses "libtar", a library for reading/writing tar-files. This
library is Copyright (c) 1998-2001 Mark D. Roth <roth@uiuc.edu> (see
libtar-X.X.X/COPYRIGHT for further details).
pacman uses "ftplib", a library for sending/receiving files via FTP. This
library is copyright (c) 1996-2000 Thomas Pfau, pfau@cnj.digex.net (see
libftp/ftplib.c for furthur details).

21
TODO
View file

@ -1,27 +1,30 @@
- add a way to clean /var/cache/pacman/src
- add other options to config file: db location, overwrite behaviour, etc.
- don't skip the db update when a package fails to upgrade - we lose the entry
- have "group" designations
- use 'set -e' in makepkg?
- if a package fails, ask before aborting the full operation
- ask, then remove conflicting packages with --sync
- use a provides tag (instead of an OR operator in depends)
? use 'set -e' in makepkg?
x if a package fails, ask before aborting the full operation
- can't -- further dependent packages may fail b/c of the first failure
? ask, then remove conflicting packages with --sync
? use a provides tag (instead of an OR operator in depends)
- add a freshen operation
- add a 'cascade' option to --remove that will remove a package and
all requiredby packages under it
- check $PACCONF env var
- ftp transfer progress bar breaks after ~42000 K
- use a 'trust pacman' config option for downgrading?
? use a 'trust pacman' config option for downgrading?
- instead of 'conflicts' use a ! operator in depends
- add a --pretend option
- add a consistency/sanity check operation
- add a --dbpath option
- build-time (source) dependencies in makepkg
? build-time (source) dependencies in makepkg
- auto-resolve dependencies in makepkg
- use package caches more for performance
+ add an "ignore package" option in either pacman.conf or in each package
record. this will prevent it from being upgraded from the sync set
- IgnorePkg option in pacman.conf to ignore updates from the sync repo
- if a package is removed with --nodeps and re-installed, the requiredby
fields of it's required packages are not updated
- duplicate dep checks occur with sync (one in sync, one in add)
- clean up output a bit (message queue?)
- run ldd on every executable in a newly built package to find required so's
? run ldd on every executable in a newly built package to find required so's
- use a files.cache gdbm (or whatever) for --owns and db_find_conflicts

View file

@ -1,4 +1,4 @@
.TH makepkg 8 "July 18, 2002" "makepkg #VERSION#" ""
.TH makepkg 8 "November 7, 2002" "makepkg #VERSION#" ""
.SH NAME
makepkg \- package build utility
.SH SYNOPSIS

View file

@ -1,4 +1,4 @@
.TH pacman 8 "August 18, 2002" "pacman #VERSION#" ""
.TH pacman 8 "November 7, 2002" "pacman #VERSION#" ""
.SH NAME
pacman \- package manager utility
.SH SYNOPSIS
@ -99,6 +99,9 @@ installed/upgraded if necessary.
This will search each package in the package list for names or descriptions
that contains <string>.
.TP
.B "\-w, \-\-downloadonly"
Retrieve all packages from the server, but do not install/upgrade anything.
.TP
.B "\-c, \-\-clean"
Remove packages from the cache. When pacman downloads packages,
it saves them in \fI/var/cache/pacman/pkg\fP. If you need to free up

View file

@ -7,42 +7,43 @@
# during an install/upgrade. (note: do not include the leading slash)
[options]
NoUpgrade = etc/passwd etc/group etc/shadow
NoUpgrade = etc/fstab
NoUpgrade = etc/fstab etc/rc.conf etc/rc.local
NoUpgrade = etc/lilo.conf
[current]
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current
Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/current
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current
Server = ftp://ftp2.archlinux.org/current
Server = ftp://ftp3.archlinux.org/current
Server = ftp://ftp.archlinux.org/current
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/current
Server = ftp://saule.mintis.lt/pub/linux/current
# Uncomment this block to access the 'unofficial' package set
#
#[unofficial]
#Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/unofficial
#Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/unofficial
#Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/unofficial
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/unofficial
#Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/unofficial
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/unofficial
#Server = ftp://ftp2.archlinux.org/unofficial
#Server = ftp://ftp3.archlinux.org/unofficial
#Server = ftp://ftp.archlinux.org/unofficial
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/unofficial
#Server = ftp://saule.mintis.lt/pub/linux/unofficial
# If you use the 'stable' tree, you should disable the 'current'
# tree to avoid conflicts
#
#[stable]
#Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/stable
#Server = ftp://ftp.webtrek.com/pub/mirrors/archlinux/stable
#Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/stable
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/stable
#Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/stable
#Server = ftp://ftp.archlinux.org/stable
#Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/stable
#Server = ftp://ftp2.archlinux.org/stable
#Server = ftp://ftp3.archlinux.org/stable
#Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/stable
#Server = ftp://saule.mintis.lt/pub/linux/stable
# This is a typical setup for a local package repository. To have pacman
# resolve dependencies and install your custom packages with the --sync

View file

@ -1,6 +1,6 @@
#!/bin/bash
myver='2.1'
myver='2.2'
ABS_ROOT=/usr/abs
usage() {

View file

@ -1,6 +1,6 @@
#!/bin/bash
myver='2.1'
myver='2.2'
usage() {
echo "gensync $myver"

View file

@ -1,6 +1,6 @@
#!/bin/bash
myver='2.1'
myver='2.2'
startdir=`pwd`
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
@ -138,6 +138,7 @@ for netfile in ${source[@]}; do
fi
mkdir -p /var/cache/pacman/src && cp $file /var/cache/pacman/src
fi
unset cmd
case $file in
*.tar.gz|*.tar.Z|*.tgz)
cmd="tar --use-compress-program=gzip -xf $file" ;;
@ -150,8 +151,10 @@ for netfile in ${source[@]}; do
*.gz)
cmd="gunzip $file" ;;
esac
if [ "$cmd" != "" ]; then
msg "==> $cmd"
$cmd
fi
done
# check for existing pkg directory

View file

@ -1,7 +1,7 @@
#!/bin/bash
toplevel=`pwd`
version="2.1"
version="2.2"
usage() {
echo "makeworld version $version"

View file

@ -62,11 +62,11 @@ pkginfo_t* load_pkg(char *pkgfile, unsigned short output)
/* parse the info file */
parse_descfile(descfile, info, &backup, output);
if(!strlen(info->name)) {
fprintf(stderr, "error: missing package name in description file.\n");
fprintf(stderr, "load_pkg: missing package name in %s.\n", pkgfile);
return(NULL);
}
if(!strlen(info->version)) {
fprintf(stderr, "error: missing package version in description file.\n");
fprintf(stderr, "load_pkg: missing package version in %s.\n", pkgfile);
return(NULL);
}
for(lp = backup; lp; lp = lp->next) {
@ -85,7 +85,9 @@ pkginfo_t* load_pkg(char *pkgfile, unsigned short output)
}
if(TH_ISREG(tar) && tar_skip_regfile(tar)) {
perror("bad package file");
char errorstr[255];
snprintf(errorstr, 255, "bad package file in %s", pkgfile);
perror(errorstr);
return(NULL);
}
expath = NULL;
@ -94,7 +96,7 @@ pkginfo_t* load_pkg(char *pkgfile, unsigned short output)
FREE(descfile);
if(!strlen(info->name) || !strlen(info->version)) {
fprintf(stderr, "Error: Missing .PKGINFO file in %s\n", pkgfile);
fprintf(stderr, "load_pkg: missing package info file in %s\n", pkgfile);
return(NULL);
}
@ -136,7 +138,8 @@ int parse_descfile(char *descfile, pkginfo_t *info, PMList **backup, int output)
ptr = line;
key = strsep(&ptr, "=");
if(key == NULL || ptr == NULL) {
fprintf(stderr, "Syntax error in description file line %d\n", linenum);
fprintf(stderr, "%s: syntax error in description file line %d\n",
info->name[0] != '\0' ? info->name : "error", linenum);
} else {
trim(key);
key = strtoupper(key);
@ -167,7 +170,8 @@ int parse_descfile(char *descfile, pkginfo_t *info, PMList **backup, int output)
char *s = strdup(ptr);
bak = list_add(bak, s);
} else {
fprintf(stderr, "Syntax error in description file line %d\n", linenum);
fprintf(stderr, "%s: syntax error in description file line %d\n",
info->name[0] != '\0' ? info->name : "error", linenum);
}
}
line[0] = '\0';

View file

@ -69,6 +69,7 @@ unsigned short pmo_q_info = 0;
unsigned short pmo_q_list = 0;
unsigned short pmo_q_owns = 0;
unsigned short pmo_s_upgrade = 0;
unsigned short pmo_s_downloadonly = 0;
unsigned short pmo_s_sync = 0;
unsigned short pmo_s_search = 0;
unsigned short pmo_s_clean = 0;
@ -382,13 +383,27 @@ int pacman_sync(pacdb_t *db, PMList *targets)
/* versions are identical */
continue;
} else {
PMList *lp = NULL;
int found = 0;
/* re-fetch the package record with dependency info */
sync->pkg = db_scan(sync->dbs->db, sync->pkg->name, INFRQ_DESC | INFRQ_DEPENDS);
/* add to the targets list */
if(!list_isin(final, sync)) {
for(found = 0, lp = final; lp && !found; lp = lp->next) {
syncpkg_t *s = (syncpkg_t*)lp->data;
if(s && !strcmp(s->pkg->name, sync->pkg->name)) {
found = 1;
}
}
if(!found) {
allgood = !resolvedeps(db, databases, sync, final, trail);
/* check again, as resolvedeps could have added our target for us */
if(!list_isin(final, sync)) {
for(found = 0, lp = final; lp && !found; lp = lp->next) {
syncpkg_t *s = (syncpkg_t*)lp->data;
if(s && !strcmp(s->pkg->name, sync->pkg->name)) {
found = 1;
}
}
if(!found) {
final = list_add(final, sync);
}
}
@ -407,7 +422,6 @@ int pacman_sync(pacdb_t *db, PMList *targets)
MALLOC(sync, sizeof(syncpkg_t));
local = db_scan(db, (char*)i->data, INFRQ_DESC);
//sync = db_scan(db_sync, (char*)i->data, INFRQ_DESC | INFRQ_DEPENDS);
for(j = databases; !found && j; j = j->next) {
dbsync_t *dbs = (dbsync_t*)j->data;
for(k = dbs->pkgcache; !found && k; k = k->next) {
@ -479,6 +493,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
list = list_add(list, s->pkg);
}
}
deps = checkdeps(db, PM_UPGRADE, list);
if(deps) {
fprintf(stderr, "error: unresolvable conflicts/dependencies:\n");
@ -538,9 +553,13 @@ int pacman_sync(pacdb_t *db, PMList *targets)
/* get confirmation */
confirm = 0;
if(allgood && final && final->data) {
if(pmo_s_downloadonly) {
confirm = yesno("\nDo you want to download these packages? [Y/n] ");
} else {
confirm = yesno("\nDo you want to install/upgrade these packages? [Y/n] ");
}
}
}
if(allgood && confirm && final && final->data) {
char ldir[PATH_MAX];
@ -625,6 +644,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
list_free(files);
files = NULL;
}
if(!pmo_s_downloadonly) {
/* install targets */
for(i = final; allgood && i; i = i->next) {
char *str;
@ -638,8 +659,9 @@ int pacman_sync(pacdb_t *db, PMList *targets)
if(allgood) {
pacman_upgrade(db, files);
}
}
if(!varcache) {
if(!varcache && !pmo_s_downloadonly) {
/* delete packages */
for(i = files; i; i = i->next) {
unlink(i->data);
@ -688,7 +710,8 @@ int pacman_add(pacdb_t *db, PMList *targets)
return(0);
}
vprint("Loading all target data...\n");
printf("loading package data... ");
fflush(stdout);
for(targ = targets; targ; targ = targ->next) {
/* Populate the package struct */
vprint(" %s\n", (char*)targ->data);
@ -699,9 +722,10 @@ int pacman_add(pacdb_t *db, PMList *targets)
alltargs = list_add(alltargs, info);
filenames = list_add(filenames, strdup(targ->data));
}
printf("done.\n");
if(!pmo_nodeps) {
vprint("Checking dependencies...\n");
vprint("checking dependencies...\n");
lp = checkdeps(db, (pmo_upgrade ? PM_UPGRADE : PM_ADD), alltargs);
if(lp) {
fprintf(stderr, "error: unsatisfied dependencies:\n");
@ -1516,9 +1540,15 @@ PMList* checkdeps(pacdb_t *db, unsigned short op, PMList *targets)
pkginfo_t *p;
found = 0;
if((p = db_scan(db, j->data, INFRQ_DESC | INFRQ_DEPENDS)) == NULL) {
/* hmmm... package isn't installed.. */
continue;
}
if(is_pkgin(p, targets)) {
/* this package is also in the upgrade list, so don't worry about it */
continue;
}
for(k = p->depends; k && !found; k = k->next) {
/* find the dependency info in p->depends */
if(splitdep(k->data, &depend)) {
continue;
}
@ -1527,6 +1557,7 @@ PMList* checkdeps(pacdb_t *db, unsigned short op, PMList *targets)
}
}
if(found == 0) {
/* not found */
continue;
}
found = 0;

View file

@ -22,7 +22,7 @@
#define _PAC_PACMAN_H
#ifndef PACVER
#define PACVER "2.1"
#define PACVER "2.2"
#endif
#ifndef PKGDIR

View file

@ -55,6 +55,7 @@ extern unsigned short pmo_s_sync;
extern unsigned short pmo_s_search;
extern unsigned short pmo_s_clean;
extern unsigned short pmo_s_upgrade;
extern unsigned short pmo_s_downloadonly;
extern PMList *pmo_noupgrade;
extern PMList *pmc_syncs;
@ -156,11 +157,12 @@ int parseargs(int op, int argc, char **argv)
{"file", no_argument, 0, 'p'},
{"info", no_argument, 0, 'i'},
{"sysupgrade", no_argument, 0, 'u'},
{"downloadonly", no_argument, 0, 'w'},
{"refresh", no_argument, 0, 'y'},
{0, 0, 0, 0}
};
while((opt = getopt_long(argc, argv, "ARUQSTYr:vhscVfnoldpiuy", opts, &option_index))) {
while((opt = getopt_long(argc, argv, "ARUQSTYr:vhscVfnoldpiuwy", opts, &option_index))) {
if(opt < 0) {
break;
}
@ -184,6 +186,7 @@ int parseargs(int op, int argc, char **argv)
case 'i': pmo_q_info = 1; break;
case 'o': pmo_q_owns = 1; break;
case 'u': pmo_s_upgrade = 1; break;
case 'w': pmo_s_downloadonly = 1; break;
case 'y': pmo_s_sync = 1; break;
case 's': pmo_s_search = 1; break;
case 'c': pmo_s_clean = 1; break;
@ -515,6 +518,7 @@ void usage(int op, char *myname)
printf(" -d, --nodeps skip dependency checks\n");
printf(" -y, --refresh download a fresh package sync database from the server\n");
printf(" -u, --sysupgrade upgrade all packages that are out of date\n");
printf(" -w, --downloadonly download packages, but do not install/upgrade anything\n");
printf(" -c, --clean remove packages from cache directory to free up diskspace\n");
}
printf(" -v, --verbose be verbose\n");