Imported from pacman-2.9.8.tar.gz
This commit is contained in:
parent
1bcc87c3fe
commit
ec1fc664c9
30 changed files with 619 additions and 218 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,7 +1,21 @@
|
||||||
VERSION DESCRIPTION
|
VERSION DESCRIPTION
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
2.9.8 - Changed behaviour with original=X,current=Y,new=Z scenario
|
||||||
|
- keep old in place, install new as .pacnew
|
||||||
|
- Search package provides when finding matching targets with -S
|
||||||
|
- Frugalware: added -Qm option to find foreign packages
|
||||||
|
- Frugalware: added DistCC support to makepkg
|
||||||
|
- bugfix: before searching databases for a dependency, make sure
|
||||||
|
one of the packages in the final list doesn't already provide
|
||||||
|
that dependency
|
||||||
|
- fix for segfaults that occurred when propagating requiredby
|
||||||
|
fields to replaced packages where one package depended on
|
||||||
|
another replaced package
|
||||||
|
- a better fix for pacman-optimize integrity checks
|
||||||
|
- fix for regex searches with -Ss (Miklos Vajna)
|
||||||
|
- added a --noprogressbar for scripts to use
|
||||||
2.9.7 - fixed the dupe listings of packages when dealing w/ groups
|
2.9.7 - fixed the dupe listings of packages when dealing w/ groups
|
||||||
- patches from Miklos Vanja:
|
- patches from Miklos Vajna:
|
||||||
- add regexp search support for -Qs and -Ss
|
- add regexp search support for -Qs and -Ss
|
||||||
- fixed md5sums on x86_64
|
- fixed md5sums on x86_64
|
||||||
- add --sudosync to makepkg
|
- add --sudosync to makepkg
|
||||||
|
|
|
@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
|
||||||
PACVER = 2.9.7
|
PACVER = 2.9.8
|
||||||
|
|
||||||
TOPDIR = @srcdir@
|
TOPDIR = @srcdir@
|
||||||
SRCDIR = $(TOPDIR)/src/
|
SRCDIR = $(TOPDIR)/src/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH makepkg 8 "August 3, 2004" "makepkg #VERSION#" ""
|
.TH makepkg 8 "January 30, 2006" "makepkg #VERSION#" ""
|
||||||
.SH NAME
|
.SH NAME
|
||||||
makepkg \- package build utility
|
makepkg \- package build utility
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -236,9 +236,26 @@ This is the release number specific to Arch Linux packages.
|
||||||
This should be a brief description of the package and its functionality.
|
This should be a brief description of the package and its functionality.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B force
|
.B options
|
||||||
This is used to force the package to be upgraded by \fB--sysupgrade\fP, even
|
This array allows you to override some of makepkg's default behaviour
|
||||||
|
when building packages. To set an option, just include the option name
|
||||||
|
in the \fBoptions\fP array.
|
||||||
|
.TP
|
||||||
|
.RS
|
||||||
|
\fIAvailable Options:\fP
|
||||||
|
.RS
|
||||||
|
.TP
|
||||||
|
.B FORCE
|
||||||
|
force the package to be upgraded by \fB--sysupgrade\fP, even
|
||||||
if its an older version.
|
if its an older version.
|
||||||
|
.TP
|
||||||
|
.B KEEPDOCS
|
||||||
|
do not remove /usr/share/doc and /usr/share/info directories.
|
||||||
|
.TP
|
||||||
|
.B NOSTRIP
|
||||||
|
do not strip debugging symbols from binaries and libraries.
|
||||||
|
.RE
|
||||||
|
.RE
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B url
|
.B url
|
||||||
|
@ -247,8 +264,17 @@ being packaged. This is typically the project's website.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B license
|
.B license
|
||||||
Sets the license type (eg, "GPL", "BSD", "NON-FREE"). (\fBNote\fP: This
|
This field specifies the license(s) that apply to the package. Commonly-used
|
||||||
option is still in development and may change in the future)
|
licenses are typically found in \fI/usr/share/licenses/common\fP. If you
|
||||||
|
see the package's license there, simply reference it in the license field
|
||||||
|
(eg, \fBlicense="GPL"\fP). If the package provides a license not found in
|
||||||
|
\fI/usr/share/licenses/common\fP, then you should include the license in
|
||||||
|
the package itself and set \fBlicense="custom"\fP or \fBlicense="custom:LicenseName"\fP.
|
||||||
|
The license itself should be placed in a directory called
|
||||||
|
\fI$startdir/pkg/usr/share/licenses/$pkgname\fP.
|
||||||
|
.TP
|
||||||
|
.RE
|
||||||
|
If multiple licenses are applied, use the array form: \fBlicenses=('GPL' 'FDL')\fP
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B install
|
.B install
|
||||||
|
@ -271,7 +297,7 @@ If this field is present, it should contain an MD5 hash for every source file
|
||||||
specified in the \fIsource\fP array (in the same order). makepkg will use
|
specified in the \fIsource\fP array (in the same order). makepkg will use
|
||||||
this to verify source file integrity during subsequent builds. To easily
|
this to verify source file integrity during subsequent builds. To easily
|
||||||
generate md5sums, first build using the PKGBUILD then run
|
generate md5sums, first build using the PKGBUILD then run
|
||||||
\fBmakepkg -g >>PKGBILD\fP. Then you can edit the PKGBUILD and move the
|
\fBmakepkg -g >>PKGBUILD\fP. Then you can edit the PKGBUILD and move the
|
||||||
\fImd5sums\fP line from the bottom to an appropriate location.
|
\fImd5sums\fP line from the bottom to an appropriate location.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -400,6 +426,15 @@ build as root to use dependency auto-resolution.
|
||||||
.B "\-w <destdir>"
|
.B "\-w <destdir>"
|
||||||
Write the resulting package file to the directory \fI<destdir>\fP instead of the
|
Write the resulting package file to the directory \fI<destdir>\fP instead of the
|
||||||
current working directory.
|
current working directory.
|
||||||
|
.TP
|
||||||
|
.B "\-\-noconfirm"
|
||||||
|
When calling pacman to resolve dependencies or conflicts, makepkg can pass
|
||||||
|
the \fI--noconfirm\fP option to it so it does not wait for any user
|
||||||
|
input before proceeding with operations.
|
||||||
|
.TP
|
||||||
|
.B "\-\-noprogressbar"
|
||||||
|
When calling pacman, makepkg can pass the \fI--noprogressbar\fP option to it.
|
||||||
|
This is useful if one is directing makepkg's output to a non-terminal (ie, a file).
|
||||||
|
|
||||||
.SH CONFIGURATION
|
.SH CONFIGURATION
|
||||||
Configuration options are stored in \fI/etc/makepkg.conf\fP. This file is parsed
|
Configuration options are stored in \fI/etc/makepkg.conf\fP. This file is parsed
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH pacman 8 "July 6, 2005" "pacman #VERSION#" ""
|
.TH pacman 8 "January 21, 2006" "pacman #VERSION#" ""
|
||||||
.SH NAME
|
.SH NAME
|
||||||
pacman \- package manager utility
|
pacman \- package manager utility
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -83,6 +83,10 @@ Specify an alternate configuration file.
|
||||||
.B "\-\-noconfirm"
|
.B "\-\-noconfirm"
|
||||||
Bypass any and all "Are you sure?" messages. It's not a good idea to do this
|
Bypass any and all "Are you sure?" messages. It's not a good idea to do this
|
||||||
unless you want to run pacman from a script.
|
unless you want to run pacman from a script.
|
||||||
|
.TP
|
||||||
|
.B "\-\-noprogressbar"
|
||||||
|
Do not show a progress bar when downloading files. This can be useful for
|
||||||
|
scripts that call pacman and capture the output.
|
||||||
.SH SYNC OPTIONS
|
.SH SYNC OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B "\-c, \-\-clean"
|
.B "\-c, \-\-clean"
|
||||||
|
@ -174,6 +178,10 @@ option then the .PKGINFO file will be printed.
|
||||||
List all files owned by <package>. Multiple packages can be specified on
|
List all files owned by <package>. Multiple packages can be specified on
|
||||||
the command line.
|
the command line.
|
||||||
.TP
|
.TP
|
||||||
|
.B "\-m, \-\-foreign"
|
||||||
|
List all packages that were not found in the sync database(s). Typically these
|
||||||
|
are packages that were downloaded manually and installed with --add.
|
||||||
|
.TP
|
||||||
.B "\-o, \-\-owns <file>"
|
.B "\-o, \-\-owns <file>"
|
||||||
Search for the package that owns <file>.
|
Search for the package that owns <file>.
|
||||||
.TP
|
.TP
|
||||||
|
@ -210,9 +218,9 @@ original=\fBX\fP, current=\fBY\fP, new=\fBY\fP
|
||||||
The new one is identical to the current one. Win win. Install the new file.
|
The new one is identical to the current one. Win win. Install the new file.
|
||||||
.TP
|
.TP
|
||||||
original=\fBX\fP, current=\fBY\fP, new=\fBZ\fP
|
original=\fBX\fP, current=\fBY\fP, new=\fBZ\fP
|
||||||
All three files are different. So we install the new file, but back up the
|
All three files are different, so we install the new file with a .pacnew
|
||||||
old one to a .pacsave extension. This way the user can move the old configuration
|
extension and warn the user, so she can manually move the file into place
|
||||||
file back into place if he wishes.
|
after making any necessary customizations.
|
||||||
.SH CONFIGURATION
|
.SH CONFIGURATION
|
||||||
pacman will attempt to read \fI/etc/pacman.conf\fP each time it is invoked. This
|
pacman will attempt to read \fI/etc/pacman.conf\fP each time it is invoked. This
|
||||||
configuration file is divided into sections or \fIrepositories\fP. Each section
|
configuration file is divided into sections or \fIrepositories\fP. Each section
|
||||||
|
|
|
@ -2,35 +2,58 @@
|
||||||
# /etc/makepkg.conf
|
# /etc/makepkg.conf
|
||||||
#
|
#
|
||||||
|
|
||||||
# The FTP/HTTP download utility that makepkg should use to acquire sources
|
#########################################################################
|
||||||
export FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3"
|
# SOURCE ACQUISITION
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
|
#-- The FTP/HTTP download utility that makepkg should use to acquire sources
|
||||||
|
export FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate"
|
||||||
#export FTPAGENT="/usr/bin/snarf"
|
#export FTPAGENT="/usr/bin/snarf"
|
||||||
#export FTPAGENT="/usr/bin/lftpget -c"
|
#export FTPAGENT="/usr/bin/lftpget -c"
|
||||||
|
|
||||||
|
#########################################################################
|
||||||
|
# ARCHITECTURE, COMPILE FLAGS
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
export CARCH="i686"
|
export CARCH="i686"
|
||||||
export CHOST="i686-pc-linux-gnu"
|
export CHOST="i686-pc-linux-gnu"
|
||||||
|
#-- Exclusive: will only run on i686 or higher (P6, Athlon)
|
||||||
# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon exclusive (binaries
|
|
||||||
# will use the P6 instruction set and only run on P6+ systems)
|
|
||||||
export CFLAGS="-march=i686 -O2 -pipe"
|
export CFLAGS="-march=i686 -O2 -pipe"
|
||||||
export CXXFLAGS="-march=i686 -O2 -pipe"
|
export CXXFLAGS="-march=i686 -O2 -pipe"
|
||||||
# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon optimized (but binaries
|
#-- Optimized: will run on any x86, but optimized for i686
|
||||||
# will run on any x86 system)
|
#export CFLAGS="-mcpu=i686 -O2 -pipe"
|
||||||
#export CFLAGS="-mtune=i686 -O2 -pipe"
|
#export CXXFLAGS="-mcpu=i686 -O2 -pipe"
|
||||||
#export CXXFLAGS="-mtune=i686 -O2 -pipe"
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
|
|
||||||
# SMP Systems
|
|
||||||
#export MAKEFLAGS="-j2"
|
#export MAKEFLAGS="-j2"
|
||||||
|
|
||||||
# Enable fakeroot for building packages as a non-root user
|
#########################################################################
|
||||||
|
# BUILD ENVIRONMENT
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
|
#-- Fakeroot: for building packages as a non-root user
|
||||||
export USE_FAKEROOT="y"
|
export USE_FAKEROOT="y"
|
||||||
|
#-- DistCC: a distributed C/C++/ObjC compiler (modify MAKEFLAGS too)
|
||||||
# Enable colorized output messages
|
export DISTCC="n"
|
||||||
|
#-- A space-delimited list of hosts running in the DistCC cluster
|
||||||
|
export DISTCC_HOSTS=""
|
||||||
|
#-- Colorized output messages
|
||||||
export USE_COLOR="y"
|
export USE_COLOR="y"
|
||||||
|
|
||||||
# Specify a fixed directory where all packages will be placed
|
#########################################################################
|
||||||
#export PKGDEST=/home/packages
|
# GLOBAL PACKAGE OPTIONS
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
|
#-- Don't strip symbols from binaries/libraries
|
||||||
|
#export NOSTRIP="1"
|
||||||
|
#-- Keep doc and info directories
|
||||||
|
#export KEEPDOCS="1"
|
||||||
|
|
||||||
# If you want your name to show up in the packages you build, set this.
|
#########################################################################
|
||||||
|
# PACKAGE OUTPUT
|
||||||
|
#########################################################################
|
||||||
|
#
|
||||||
|
#-- Destination: specify a fixed directory where all packages will be placed
|
||||||
|
#export PKGDEST=/home/packages
|
||||||
|
#-- Packager: name/email of the person or organization building packages
|
||||||
#export PACKAGER="John Doe <john@doe.com>"
|
#export PACKAGER="John Doe <john@doe.com>"
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
[options]
|
[options]
|
||||||
LogFile = /var/log/pacman.log
|
LogFile = /var/log/pacman.log
|
||||||
NoUpgrade = etc/passwd etc/group etc/shadow etc/sudoers
|
NoUpgrade = etc/passwd etc/group etc/shadow etc/sudoers
|
||||||
NoUpgrade = etc/fstab etc/raidtab etc/ld.so.conf
|
NoUpgrade = etc/fstab etc/raidtab etc/mdadm.conf etc/ld.so.conf
|
||||||
NoUpgrade = etc/rc.conf etc/rc.local
|
NoUpgrade = etc/inittab etc/rc.conf etc/rc.local
|
||||||
NoUpgrade = etc/modprobe.conf etc/modules.conf
|
NoUpgrade = etc/modprobe.conf etc/modules.conf
|
||||||
NoUpgrade = etc/lilo.conf boot/grub/menu.lst
|
NoUpgrade = etc/lilo.conf boot/grub/menu.lst etc/mkinitrd.conf
|
||||||
HoldPkg = pacman glibc
|
HoldPkg = pacman glibc
|
||||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||||
|
|
||||||
|
|
24
scripts/aurbuild
Executable file
24
scripts/aurbuild
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo $*
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" == "" ]; then
|
||||||
|
echo "usage: aurbuild <package_name>"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pkgname=$1
|
||||||
|
[ -d $pkgname ] && die "Directory '$pkgname' already exists"
|
||||||
|
[ -f $pkgname ] && die "File '$pkgname' already exists"
|
||||||
|
|
||||||
|
echo "Downloading $pkgname.tar.gz"
|
||||||
|
wget -q http://aur.archlinux.org/packages/$pkgname/$pkgname.tar.gz || die "Failed to fetch $1.pkg.tar.gz"
|
||||||
|
|
||||||
|
tar zxf $pkgname.tar.gz || die "Extraction failed"
|
||||||
|
rm -f $pkgname.tar.gz
|
||||||
|
cd $pkgname || die "Failed to cwd"
|
||||||
|
makepkg
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# gensync
|
# gensync
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "gensync $myver"
|
echo "gensync $myver"
|
||||||
|
@ -51,6 +51,18 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
get_md5checksum()
|
get_md5checksum()
|
||||||
{
|
{
|
||||||
if [ "$pkgdir" != "" ]; then
|
if [ "$pkgdir" != "" ]; then
|
||||||
|
@ -69,7 +81,7 @@ get_md5checksum()
|
||||||
db_write_entry()
|
db_write_entry()
|
||||||
{
|
{
|
||||||
unset pkgname pkgver pkgrel pkgdesc force
|
unset pkgname pkgver pkgrel pkgdesc force
|
||||||
unset groups replaces provides depends conflicts
|
unset groups replaces provides depends conflicts options
|
||||||
source $1 || return 1
|
source $1 || return 1
|
||||||
cd $gstmpdir
|
cd $gstmpdir
|
||||||
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
||||||
|
@ -107,7 +119,7 @@ db_write_entry()
|
||||||
done
|
done
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
if [ "$force" = "y" -o "$force" = "Y" ]; then
|
if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
|
||||||
echo "%FORCE%" >>desc
|
echo "%FORCE%" >>desc
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
|
@ -140,7 +152,7 @@ db_write_entry()
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||||
|
@ -169,12 +181,14 @@ for file in `find $rootdir/* -name PKGBUILD`; do
|
||||||
else
|
else
|
||||||
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
|
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
|
||||||
fi
|
fi
|
||||||
[ -f $pkgfile ] || die "missing package file: $pkgfile"
|
if [ -f $pkgfile ]; then
|
||||||
csize=`du -b $pkgfile | cut -f1`
|
csize=`du -b $pkgfile | cut -f1`
|
||||||
pkgmd5sum=`get_md5checksum $pkgfile`
|
pkgmd5sum=`get_md5checksum $pkgfile`
|
||||||
[ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
|
[ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
|
||||||
db_write_entry $file
|
db_write_entry $file || die "error writing entry for $file"
|
||||||
[ $? -gt 0 ] && die "error writing entry for $file"
|
else
|
||||||
|
echo "gensync: missing package: $pkgfile" >&2
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "gensync: compressing to $destfile..." >&2
|
echo "gensync: compressing to $destfile..." >&2
|
||||||
|
|
127
scripts/makepkg
127
scripts/makepkg
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# makepkg
|
# makepkg
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,11 +20,31 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
startdir=`pwd`
|
startdir=`pwd`
|
||||||
PKGDEST=$startdir
|
PKGDEST=$startdir
|
||||||
USE_COLOR="n"
|
USE_COLOR="n"
|
||||||
|
|
||||||
|
# Options
|
||||||
|
BUILDSCRIPT="./PKGBUILD"
|
||||||
|
CLEANUP=0
|
||||||
|
CLEANCACHE=0
|
||||||
|
DEP_BIN=0
|
||||||
|
DEP_SRC=0
|
||||||
|
DEP_SUDO=0
|
||||||
|
FORCE=0
|
||||||
|
GENMD5=0
|
||||||
|
INSTALL=0
|
||||||
|
KEEPDOCS=0
|
||||||
|
NOBUILD=0
|
||||||
|
NOCCACHE=0
|
||||||
|
NODEPS=0
|
||||||
|
NOEXTRACT=0
|
||||||
|
NOSTRIP=0
|
||||||
|
RMDEPS=0
|
||||||
|
|
||||||
|
PACMAN_OPTS=
|
||||||
|
|
||||||
# source Arch's abs.conf if it's present
|
# source Arch's abs.conf if it's present
|
||||||
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
[ -f /etc/abs/abs.conf ] && source /etc/abs/abs.conf
|
||||||
|
|
||||||
|
@ -72,11 +92,25 @@ strip_url() {
|
||||||
echo $1 | sed 's|^.*://.*/||g'
|
echo $1 | sed 's|^.*://.*/||g'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
checkdeps() {
|
checkdeps() {
|
||||||
local missdep=""
|
local missdep=""
|
||||||
local deplist=""
|
local deplist=""
|
||||||
|
|
||||||
missdep=`pacman -T $*`
|
[ $# -gt 0 ] || return
|
||||||
|
|
||||||
|
missdep=`pacman $PACMAN_OPTS -T $*`
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ "$ret" != "0" ]; then
|
if [ "$ret" != "0" ]; then
|
||||||
if [ "$ret" = "127" ]; then
|
if [ "$ret" = "127" ]; then
|
||||||
|
@ -116,7 +150,7 @@ handledeps() {
|
||||||
if [ "$DEP_BIN" = "1" ]; then
|
if [ "$DEP_BIN" = "1" ]; then
|
||||||
# install missing deps from binary packages (using pacman -S)
|
# install missing deps from binary packages (using pacman -S)
|
||||||
msg "Installing missing dependencies..."
|
msg "Installing missing dependencies..."
|
||||||
pacman -D $deplist
|
pacman $PACMAN_OPTS -D $deplist
|
||||||
if [ "$?" = "127" ]; then
|
if [ "$?" = "127" ]; then
|
||||||
error "Failed to install missing dependencies."
|
error "Failed to install missing dependencies."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -131,9 +165,9 @@ handledeps() {
|
||||||
FAKEROOTKEY2=$FAKEROOTKEY
|
FAKEROOTKEY2=$FAKEROOTKEY
|
||||||
unset FAKEROOTKEY
|
unset FAKEROOTKEY
|
||||||
fi
|
fi
|
||||||
sudo pacman -D $deplist
|
sudo pacman $PACMAN_OPTS -D $deplist
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
FAKEROOTKEY=$FAKEROOTKEY2
|
export FAKEROOTKEY=$FAKEROOTKEY2
|
||||||
unset FAKEROOTKEY2
|
unset FAKEROOTKEY2
|
||||||
fi
|
fi
|
||||||
if [ "$?" = "127" ]; then
|
if [ "$?" = "127" ]; then
|
||||||
|
@ -192,8 +226,10 @@ handledeps() {
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "makepkg version $myver"
|
echo "makepkg version $myver"
|
||||||
echo "usage: $0 [options]"
|
echo
|
||||||
echo "options:"
|
echo "Usage: $0 [options]"
|
||||||
|
echo
|
||||||
|
echo "Options:"
|
||||||
echo " -b, --builddeps Build missing dependencies from source"
|
echo " -b, --builddeps Build missing dependencies from source"
|
||||||
echo " -B, --noccache Do not use ccache during build"
|
echo " -B, --noccache Do not use ccache during build"
|
||||||
echo " -c, --clean Clean up work files after build"
|
echo " -c, --clean Clean up work files after build"
|
||||||
|
@ -214,33 +250,23 @@ usage() {
|
||||||
echo " -S, --sudosync Install missing dependencies with pacman and sudo"
|
echo " -S, --sudosync Install missing dependencies with pacman and sudo"
|
||||||
echo " -w <destdir> Write package to <destdir> instead of the working dir"
|
echo " -w <destdir> Write package to <destdir> instead of the working dir"
|
||||||
echo
|
echo
|
||||||
echo " if -p is not specified, makepkg will look for a PKGBUILD"
|
echo "These options can be passed to pacman:"
|
||||||
echo " file in the current directory."
|
echo
|
||||||
|
echo " --noconfirm Do not ask for confirmation when resolving dependencies"
|
||||||
|
echo " --noprogressbar Do not show a progress bar when downloading files"
|
||||||
|
echo
|
||||||
|
echo "If -p is not specified, makepkg will look for ./PKGBUILD"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Options
|
|
||||||
BUILDSCRIPT="./PKGBUILD"
|
|
||||||
CLEANUP=0
|
|
||||||
CLEANCACHE=0
|
|
||||||
DEP_BIN=0
|
|
||||||
DEP_SRC=0
|
|
||||||
DEP_SUDO=0
|
|
||||||
FORCE=0
|
|
||||||
GENMD5=0
|
|
||||||
INSTALL=0
|
|
||||||
NOBUILD=0
|
|
||||||
NOCCACHE=0
|
|
||||||
NODEPS=0
|
|
||||||
NOEXTRACT=0
|
|
||||||
NOSTRIP=0
|
|
||||||
RMDEPS=0
|
|
||||||
|
|
||||||
ARGLIST=$@
|
ARGLIST=$@
|
||||||
|
|
||||||
while [ "$#" -ne "0" ]; do
|
while [ "$#" -ne "0" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
# pacman
|
||||||
|
--noconfirm) PACMAN_OPTS="$PACMAN_OPTS --noconfirm" ;;
|
||||||
|
--noprogressbar) PACMAN_OPTS="$PACMAN_OPTS --noprogressbar" ;;
|
||||||
|
# makepkg
|
||||||
--clean) CLEANUP=1 ;;
|
--clean) CLEANUP=1 ;;
|
||||||
--cleancache) CLEANCACHE=1 ;;
|
--cleancache) CLEANCACHE=1 ;;
|
||||||
--syncdeps) DEP_BIN=1 ;;
|
--syncdeps) DEP_BIN=1 ;;
|
||||||
|
@ -335,6 +361,9 @@ fi
|
||||||
|
|
||||||
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
|
unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force
|
||||||
unset replaces depends conflicts backup source install build makedepends
|
unset replaces depends conflicts backup source install build makedepends
|
||||||
|
unset options
|
||||||
|
# some applications (eg, blackbox) will not build with some languages
|
||||||
|
unset LC_ALL LANG
|
||||||
umask 0022
|
umask 0022
|
||||||
|
|
||||||
if [ ! -f $BUILDSCRIPT ]; then
|
if [ ! -f $BUILDSCRIPT ]; then
|
||||||
|
@ -361,7 +390,8 @@ fi
|
||||||
if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" -a "$GENMD5" = "0" ]; then
|
if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" -a "$GENMD5" = "0" ]; then
|
||||||
if [ "$INSTALL" = "1" ]; then
|
if [ "$INSTALL" = "1" ]; then
|
||||||
warning "a package has already been built, installing existing package."
|
warning "a package has already been built, installing existing package."
|
||||||
pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
echo pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
|
pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
error "a package has already been built. (use -f to overwrite)"
|
error "a package has already been built. (use -f to overwrite)"
|
||||||
|
@ -506,7 +536,7 @@ if [ "$GENMD5" = "0" ]; then
|
||||||
case $file in
|
case $file in
|
||||||
*.tar.gz|*.tar.Z|*.tgz)
|
*.tar.gz|*.tar.Z|*.tgz)
|
||||||
cmd="tar --use-compress-program=gzip -xf $file" ;;
|
cmd="tar --use-compress-program=gzip -xf $file" ;;
|
||||||
*.tar.bz2)
|
*.tar.bz2|*.tbz2)
|
||||||
cmd="tar --use-compress-program=bzip2 -xf $file" ;;
|
cmd="tar --use-compress-program=bzip2 -xf $file" ;;
|
||||||
*.tar)
|
*.tar)
|
||||||
cmd="tar -xf $file" ;;
|
cmd="tar -xf $file" ;;
|
||||||
|
@ -571,7 +601,6 @@ else
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "`id -u`" = "0" ]; then
|
if [ "`id -u`" = "0" ]; then
|
||||||
# chown all source files to root.root
|
# chown all source files to root.root
|
||||||
chown -R root.root $startdir/src
|
chown -R root.root $startdir/src
|
||||||
|
@ -589,6 +618,15 @@ if [ "$NOBUILD" = "1" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# use distcc if requested
|
||||||
|
if [ "$DISTCC" = "y" ]; then
|
||||||
|
[ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH
|
||||||
|
if [ "$INCHROOT" = "1" ]; then
|
||||||
|
[ -d /var/tmp/fst/.distcc ] || mkdir /var/tmp/fst/.distcc
|
||||||
|
export DISTCC_DIR=/var/tmp/fst/.distcc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# use ccache if it's available
|
# use ccache if it's available
|
||||||
if [ "$NOCCACHE" = "0" ]; then
|
if [ "$NOCCACHE" = "0" ]; then
|
||||||
[ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH
|
[ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH
|
||||||
|
@ -602,11 +640,14 @@ if [ $? -gt 0 ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! "`check_option KEEPDOCS`" -a "$KEEPDOCS" = "0" ]; then
|
||||||
# remove info/doc files
|
# remove info/doc files
|
||||||
|
msg "Removing info/doc files..."
|
||||||
cd $startdir
|
cd $startdir
|
||||||
rm -rf pkg/usr/info pkg/usr/share/info
|
rm -rf pkg/usr/info pkg/usr/share/info
|
||||||
rm -rf pkg/usr/doc pkg/usr/share/doc
|
rm -rf pkg/usr/doc pkg/usr/share/doc
|
||||||
rm -rf pkg/{usr,opt/gnome}/share/gtk-doc
|
rm -rf pkg/{usr,opt/gnome}/share/gtk-doc
|
||||||
|
fi
|
||||||
|
|
||||||
# move /usr/share/man files to /usr/man
|
# move /usr/share/man files to /usr/man
|
||||||
if [ -d pkg/usr/share/man ]; then
|
if [ -d pkg/usr/share/man ]; then
|
||||||
|
@ -641,7 +682,7 @@ done
|
||||||
cd $startdir
|
cd $startdir
|
||||||
|
|
||||||
# strip binaries
|
# strip binaries
|
||||||
if [ "$NOSTRIP" = "0" ]; then
|
if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
|
||||||
msg "Stripping debugging symbols from libraries..."
|
msg "Stripping debugging symbols from libraries..."
|
||||||
find pkg/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name "*.exe" \
|
find pkg/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name "*.exe" \
|
||||||
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
|
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
|
||||||
|
@ -652,6 +693,18 @@ if [ "$NOSTRIP" = "0" ]; then
|
||||||
| grep -v "No such file" | grep -v "format not recognized"
|
| grep -v "No such file" | grep -v "format not recognized"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove libtool (.la) files
|
||||||
|
if [ "`check_option NOLIBTOOL`" ]; then
|
||||||
|
msg "Removing libtool .la files..."
|
||||||
|
find pkg -type f -name "*.la" -exec rm -f -- '{}' \;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove empty directories
|
||||||
|
if [ "`check_option NOEMPTYDIRS`" ]; then
|
||||||
|
msg "Removing empty directories..."
|
||||||
|
find pkg -mindepth 1 -type d -empty -exec rmdir {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
# get some package meta info
|
# get some package meta info
|
||||||
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
|
builddate=`LC_ALL= ; LANG= ; date -u "+%a %b %e %H:%M:%S %Y"`
|
||||||
if [ "$PACKAGER" != "" ]; then
|
if [ "$PACKAGER" != "" ]; then
|
||||||
|
@ -729,16 +782,16 @@ fi
|
||||||
|
|
||||||
if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then
|
if [ "$RMDEPS" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then
|
||||||
msg "Removing installed dependencies..."
|
msg "Removing installed dependencies..."
|
||||||
pacman -R $makedeplist $deplist
|
pacman $PACMAN_OPTS -R $makedeplist $deplist
|
||||||
elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then
|
elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then
|
||||||
msg "Removing installed dependencies..."
|
msg "Removing installed dependencies..."
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
FAKEROOTKEY2=$FAKEROOTKEY
|
FAKEROOTKEY2=$FAKEROOTKEY
|
||||||
unset FAKEROOTKEY
|
unset FAKEROOTKEY
|
||||||
fi
|
fi
|
||||||
sudo pacman -R $makedeplist $deplist
|
sudo pacman $PACMAN_OPTS -R $makedeplist $deplist
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
FAKEROOTKEY=$FAKEROOTKEY2
|
export FAKEROOTKEY=$FAKEROOTKEY2
|
||||||
unset FAKEROOTKEY2
|
unset FAKEROOTKEY2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -746,8 +799,8 @@ fi
|
||||||
msg "Finished making: $pkgname (`date`)"
|
msg "Finished making: $pkgname (`date`)"
|
||||||
|
|
||||||
if [ "$INSTALL" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
|
if [ "$INSTALL" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
|
||||||
msg "Running pacman --upgrade..."
|
msg "Installing package with pacman -U..."
|
||||||
pacman --upgrade $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
pacman $PACMAN_OPTS -U $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# makeworld
|
# makeworld
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,13 +20,15 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
version="2.9.7"
|
version="2.9.8"
|
||||||
toplevel=`pwd`
|
toplevel=`pwd`
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "makeworld version $version"
|
echo "makeworld version $version"
|
||||||
echo "usage: $0 [options] <destdir> <category> [category] ..."
|
echo
|
||||||
echo "options:"
|
echo "Usage: $0 [options] <destdir> <category> [category] ..."
|
||||||
|
echo
|
||||||
|
echo "Options:"
|
||||||
echo " -b, --builddeps Build missing dependencies from source"
|
echo " -b, --builddeps Build missing dependencies from source"
|
||||||
echo " -c, --clean Clean up work files after build"
|
echo " -c, --clean Clean up work files after build"
|
||||||
echo " -d, --nodeps Skip all dependency checks"
|
echo " -d, --nodeps Skip all dependency checks"
|
||||||
|
@ -36,10 +38,15 @@ usage() {
|
||||||
echo " -r, --rmdeps Remove installed dependencies after a successful build"
|
echo " -r, --rmdeps Remove installed dependencies after a successful build"
|
||||||
echo " -s, --syncdeps Install missing dependencies with pacman"
|
echo " -s, --syncdeps Install missing dependencies with pacman"
|
||||||
echo
|
echo
|
||||||
echo " where <category> is one or more directory names under the ABS root"
|
echo "These options can be passed to pacman:"
|
||||||
|
echo
|
||||||
|
echo " --noconfirm Do not ask for confirmation when resolving dependencies"
|
||||||
|
echo " --noprogressbar Do not show a progress bar when downloading files"
|
||||||
|
echo
|
||||||
|
echo "Where <category> is one or more directory names under the ABS root"
|
||||||
echo "eg: makeworld -c /packages base lib editors"
|
echo "eg: makeworld -c /packages base lib editors"
|
||||||
echo
|
echo
|
||||||
echo " this should be run from the toplevel directory of ABS (usually /var/abs)"
|
echo "This should be run from the toplevel directory of ABS (usually /var/abs)"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
|
@ -50,6 +57,10 @@ fi
|
||||||
MAKEPKG_OPTS=
|
MAKEPKG_OPTS=
|
||||||
for arg in $*; do
|
for arg in $*; do
|
||||||
case $arg in
|
case $arg in
|
||||||
|
# pacman
|
||||||
|
--noconfirm) MAKEPKG_OPTS="$MAKEPKG_OPTS --noconfirm" ;;
|
||||||
|
--noprogressbar) MAKEPKG_OPTS="$MAKEPKG_OPTS --noprogressbar" ;;
|
||||||
|
# makepkg
|
||||||
--clean) MAKEPKG_OPTS="$MAKEPKG_OPTS -c" ;;
|
--clean) MAKEPKG_OPTS="$MAKEPKG_OPTS -c" ;;
|
||||||
--install) MAKEPKG_OPTS="$MAKEPKG_OPTS -i" ;;
|
--install) MAKEPKG_OPTS="$MAKEPKG_OPTS -i" ;;
|
||||||
--syncdeps) MAKEPKG_OPTS="$MAKEPKG_OPTS -s" ;;
|
--syncdeps) MAKEPKG_OPTS="$MAKEPKG_OPTS -s" ;;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# pacman-optimize
|
# pacman-optimize
|
||||||
#
|
#
|
||||||
# Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
# Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "pacman-optimize $myver"
|
echo "pacman-optimize $myver"
|
||||||
|
@ -77,7 +77,7 @@ touch /tmp/pacman.lck
|
||||||
|
|
||||||
# step 1: sum the old db
|
# step 1: sum the old db
|
||||||
echo "==> md5sum'ing the old database..."
|
echo "==> md5sum'ing the old database..."
|
||||||
tar --same-order -c $dbroot 2>/dev/null | md5sum >/tmp/pacsums.old
|
find $dbroot -type f | sort | xargs md5sum >/tmp/pacsums.old
|
||||||
|
|
||||||
# step 1: copy the entire db directory to a new one
|
# step 1: copy the entire db directory to a new one
|
||||||
echo "==> copying $dbroot..."
|
echo "==> copying $dbroot..."
|
||||||
|
@ -87,7 +87,7 @@ cp -a $dbroot $dbroot.new || die_r "error copying $dbroot"
|
||||||
echo "==> md5sum'ing the new database..."
|
echo "==> md5sum'ing the new database..."
|
||||||
mv $dbroot $dbroot.bak || die_r "error renaming $dbroot"
|
mv $dbroot $dbroot.bak || die_r "error renaming $dbroot"
|
||||||
mv $dbroot.new $dbroot || die_r "error renaming $dbroot.new"
|
mv $dbroot.new $dbroot || die_r "error renaming $dbroot.new"
|
||||||
tar --same-order -c $dbroot 2>/dev/null | md5sum >/tmp/pacsums.new
|
find $dbroot -type f | sort | xargs md5sum >/tmp/pacsums.new
|
||||||
|
|
||||||
# step 3: compare sums
|
# step 3: compare sums
|
||||||
echo "==> checking integrity..."
|
echo "==> checking integrity..."
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# updatesync
|
# updatesync
|
||||||
#
|
#
|
||||||
# Copyright (c) 2004 by Jason Chu <jason@archlinux.org>
|
# Copyright (c) 2004 by Jason Chu <jason@archlinux.org>
|
||||||
# Derived from gensync (c) 2002-2005 Judd Vinet <jvinet@zeroflux.org>
|
# Derived from gensync (c) 2002-2006 Judd Vinet <jvinet@zeroflux.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.9.7'
|
myver='2.9.8'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "updatesync $myver"
|
echo "updatesync $myver"
|
||||||
|
@ -54,6 +54,18 @@ die()
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_option() {
|
||||||
|
local i
|
||||||
|
for i in ${options[@]}; do
|
||||||
|
local uc=`echo $i | tr [:lower:] [:upper:]`
|
||||||
|
local lc=`echo $i | tr [:upper:] [:lower:]`
|
||||||
|
if [ "$uc" = "$1" -o "$lc" = "$1" ]; then
|
||||||
|
echo $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
get_md5checksum()
|
get_md5checksum()
|
||||||
{
|
{
|
||||||
if [ "$pkgdir" != "" ]; then
|
if [ "$pkgdir" != "" ]; then
|
||||||
|
@ -72,7 +84,7 @@ get_md5checksum()
|
||||||
db_write_entry()
|
db_write_entry()
|
||||||
{
|
{
|
||||||
unset pkgname pkgver pkgrel pkgdesc force
|
unset pkgname pkgver pkgrel pkgdesc force
|
||||||
unset groups replaces provides depends conflicts
|
unset groups replaces provides depends conflicts options
|
||||||
source $1 || return 1
|
source $1 || return 1
|
||||||
cd $ustmpdir
|
cd $ustmpdir
|
||||||
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
mkdir $pkgname-$pkgver-$pkgrel || return 1
|
||||||
|
@ -110,7 +122,7 @@ db_write_entry()
|
||||||
done
|
done
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
if [ "$force" = "y" -o "$force" = "Y" ]; then
|
if [ "$force" = "y" -o "$force" = "Y" -o "`check_option FORCE`" ]; then
|
||||||
echo "%FORCE%" >>desc
|
echo "%FORCE%" >>desc
|
||||||
echo "" >>desc
|
echo "" >>desc
|
||||||
fi
|
fi
|
||||||
|
@ -157,7 +169,7 @@ delete_entry()
|
||||||
|
|
||||||
if [ $# -lt 3 ]; then
|
if [ $# -lt 3 ]; then
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||||
|
@ -210,12 +222,15 @@ if [ "$action" = "upd" ]; then
|
||||||
else
|
else
|
||||||
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
|
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz"
|
||||||
fi
|
fi
|
||||||
[ -f $pkgfile ] || die "missing package file: $pkgfile"
|
if [ -f $pkgfile ]; then
|
||||||
csize=`du -b $pkgfile | cut -f1`
|
csize=`du -b $pkgfile | cut -f1`
|
||||||
pkgmd5sum=`get_md5checksum $pkgfile`
|
pkgmd5sum=`get_md5checksum $pkgfile`
|
||||||
[ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
|
[ -z $pkgmd5sum ] && die "error generating checksum for $pkgfile"
|
||||||
echo "updatesync: creating entry for $option" >&2
|
echo "updatesync: creating entry for $option" >&2
|
||||||
db_write_entry $option || die "error writing entry for $option"
|
db_write_entry $option || die "error writing entry for $option"
|
||||||
|
else
|
||||||
|
echo "updatesync: missing package: $pkgfile" >&2
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# DELETE
|
# DELETE
|
||||||
delete_entry $option
|
delete_entry $option
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* convertdb.c
|
* convertdb.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
6
src/db.c
6
src/db.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* db.c
|
* db.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -651,14 +651,12 @@ void db_search(pacdb_t *db, PMList *cache, const char *treename, PMList *needles
|
||||||
|
|
||||||
for(i = needles; i; i = i->next) {
|
for(i = needles; i; i = i->next) {
|
||||||
char *targ = strdup(i->data);
|
char *targ = strdup(i->data);
|
||||||
strtoupper(targ);
|
|
||||||
for(j = cache; j; j = j->next) {
|
for(j = cache; j; j = j->next) {
|
||||||
pkginfo_t *pkg = (pkginfo_t*)j->data;
|
pkginfo_t *pkg = (pkginfo_t*)j->data;
|
||||||
char *haystack;
|
char *haystack;
|
||||||
int match = 0;
|
int match = 0;
|
||||||
/* check name */
|
/* check name */
|
||||||
haystack = strdup(pkg->name);
|
haystack = strdup(pkg->name);
|
||||||
strtoupper(haystack);
|
|
||||||
if(reg_match(haystack, targ)) {
|
if(reg_match(haystack, targ)) {
|
||||||
match = 1;
|
match = 1;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +665,6 @@ void db_search(pacdb_t *db, PMList *cache, const char *treename, PMList *needles
|
||||||
/* check description */
|
/* check description */
|
||||||
if(!match) {
|
if(!match) {
|
||||||
haystack = strdup(pkg->desc);
|
haystack = strdup(pkg->desc);
|
||||||
strtoupper(haystack);
|
|
||||||
if(reg_match(haystack, targ)) {
|
if(reg_match(haystack, targ)) {
|
||||||
match = 1;
|
match = 1;
|
||||||
}
|
}
|
||||||
|
@ -681,7 +678,6 @@ void db_search(pacdb_t *db, PMList *cache, const char *treename, PMList *needles
|
||||||
if(info != NULL) {
|
if(info != NULL) {
|
||||||
for(m = info->provides; m; m = m->next) {
|
for(m = info->provides; m; m = m->next) {
|
||||||
haystack = strdup(m->data);
|
haystack = strdup(m->data);
|
||||||
strtoupper(haystack);
|
|
||||||
if(reg_match(haystack, targ)) {
|
if(reg_match(haystack, targ)) {
|
||||||
match = 1;
|
match = 1;
|
||||||
}
|
}
|
||||||
|
|
2
src/db.h
2
src/db.h
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* db.h
|
* db.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* list.c
|
* list.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* list.h
|
* list.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
24
src/md5.c
24
src/md5.c
|
@ -23,6 +23,7 @@ These notices must be retained in any copies of any part of this
|
||||||
documentation and/or software.
|
documentation and/or software.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
|
|
||||||
/* Constants for MD5Transform routine.
|
/* Constants for MD5Transform routine.
|
||||||
|
@ -48,8 +49,8 @@ documentation and/or software.
|
||||||
static void MD5Transform(UINT4 [4], unsigned char [64]);
|
static void MD5Transform(UINT4 [4], unsigned char [64]);
|
||||||
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
||||||
static void Decode(UINT4 *, unsigned char *, unsigned int);
|
static void Decode(UINT4 *, unsigned char *, unsigned int);
|
||||||
static void MD5_memcpy(POINTER, POINTER, unsigned int);
|
/* static void MD5_memcpy(POINTER, POINTER, unsigned int); */
|
||||||
static void MD5_memset(POINTER, int, unsigned int);
|
/* static void MD5_memset(POINTER, int, unsigned int); */
|
||||||
|
|
||||||
static unsigned char PADDING[64] = {
|
static unsigned char PADDING[64] = {
|
||||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
@ -132,8 +133,7 @@ unsigned int inputLen; /* length of input block */
|
||||||
/* Transform as many times as possible.
|
/* Transform as many times as possible.
|
||||||
*/
|
*/
|
||||||
if (inputLen >= partLen) {
|
if (inputLen >= partLen) {
|
||||||
MD5_memcpy
|
memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||||
((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
|
||||||
MD5Transform (context->state, context->buffer);
|
MD5Transform (context->state, context->buffer);
|
||||||
|
|
||||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||||
|
@ -145,9 +145,7 @@ unsigned int inputLen; /* length of input block */
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
/* Buffer remaining input */
|
/* Buffer remaining input */
|
||||||
MD5_memcpy
|
memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
|
||||||
((POINTER)&context->buffer[index], (POINTER)&input[i],
|
|
||||||
inputLen-i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||||
|
@ -177,7 +175,7 @@ MD5_CTX *context; /* context */
|
||||||
|
|
||||||
/* Zeroize sensitive information.
|
/* Zeroize sensitive information.
|
||||||
*/
|
*/
|
||||||
MD5_memset ((POINTER)context, 0, sizeof (*context));
|
memset ((POINTER)context, 0, sizeof (*context));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MD5 basic transformation. Transforms state based on block.
|
/* MD5 basic transformation. Transforms state based on block.
|
||||||
|
@ -271,7 +269,7 @@ unsigned char block[64];
|
||||||
/* Zeroize sensitive information.
|
/* Zeroize sensitive information.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
MD5_memset ((POINTER)x, 0, sizeof (x));
|
memset ((POINTER)x, 0, sizeof (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||||
|
@ -310,7 +308,7 @@ unsigned int len;
|
||||||
/* Note: Replace "for loop" with standard memcpy if possible.
|
/* Note: Replace "for loop" with standard memcpy if possible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void MD5_memcpy (output, input, len)
|
/* static void MD5_memcpy (output, input, len)
|
||||||
POINTER output;
|
POINTER output;
|
||||||
POINTER input;
|
POINTER input;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
@ -321,10 +319,10 @@ unsigned int len;
|
||||||
|
|
||||||
output[i] = input[i];
|
output[i] = input[i];
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/* Note: Replace "for loop" with standard memset if possible.
|
/* Note: Replace "for loop" with standard memset if possible.
|
||||||
*/
|
*/
|
||||||
static void MD5_memset (output, value, len)
|
/* static void MD5_memset (output, value, len)
|
||||||
POINTER output;
|
POINTER output;
|
||||||
int value;
|
int value;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
@ -334,5 +332,5 @@ unsigned int len;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
((char *)output)[i] = (char)value;
|
((char *)output)[i] = (char)value;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* pacconf.h
|
* pacconf.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
#define _PAC_PACCONF_H
|
#define _PAC_PACCONF_H
|
||||||
|
|
||||||
#ifndef PACVER
|
#ifndef PACVER
|
||||||
#define PACVER "2.9.7"
|
#define PACVER "2.9.8"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PACDBDIR
|
#ifndef PACDBDIR
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* package.c
|
* package.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -63,21 +63,28 @@ pkginfo_t* load_pkg(char *pkgfile)
|
||||||
}
|
}
|
||||||
if(!strcmp(th_get_pathname(tar), ".PKGINFO")) {
|
if(!strcmp(th_get_pathname(tar), ".PKGINFO")) {
|
||||||
char *descfile;
|
char *descfile;
|
||||||
|
int fd;
|
||||||
|
|
||||||
/* extract this file into /tmp. it has info for us */
|
/* extract this file into /tmp. it has info for us */
|
||||||
descfile = strdup("/tmp/pacman_XXXXXX");
|
descfile = strdup("/tmp/pacman_XXXXXX");
|
||||||
mkstemp(descfile);
|
fd = mkstemp(descfile);
|
||||||
tar_extract_file(tar, descfile);
|
tar_extract_file(tar, descfile);
|
||||||
/* parse the info file */
|
/* parse the info file */
|
||||||
parse_descfile(descfile, info, &backup, 0);
|
parse_descfile(descfile, info, &backup, 0);
|
||||||
if(!strlen(info->name)) {
|
if(!strlen(info->name)) {
|
||||||
fprintf(stderr, "load_pkg: missing package name in %s.\n", pkgfile);
|
fprintf(stderr, "load_pkg: missing package name in %s.\n", pkgfile);
|
||||||
FREEPKG(info);
|
FREEPKG(info);
|
||||||
|
unlink(descfile);
|
||||||
|
FREE(descfile);
|
||||||
|
close(fd);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
if(!strlen(info->version)) {
|
if(!strlen(info->version)) {
|
||||||
fprintf(stderr, "load_pkg: missing package version in %s.\n", pkgfile);
|
fprintf(stderr, "load_pkg: missing package version in %s.\n", pkgfile);
|
||||||
FREEPKG(info);
|
FREEPKG(info);
|
||||||
|
unlink(descfile);
|
||||||
|
FREE(descfile);
|
||||||
|
close(fd);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
for(lp = backup; lp; lp = lp->next) {
|
for(lp = backup; lp; lp = lp->next) {
|
||||||
|
@ -86,7 +93,9 @@ pkginfo_t* load_pkg(char *pkgfile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
config = 1;
|
config = 1;
|
||||||
|
unlink(descfile);
|
||||||
FREE(descfile);
|
FREE(descfile);
|
||||||
|
close(fd);
|
||||||
continue;
|
continue;
|
||||||
} else if(!strcmp(th_get_pathname(tar), "._install") || !strcmp(th_get_pathname(tar), ".INSTALL")) {
|
} else if(!strcmp(th_get_pathname(tar), "._install") || !strcmp(th_get_pathname(tar), ".INSTALL")) {
|
||||||
info->scriptlet = 1;
|
info->scriptlet = 1;
|
||||||
|
@ -96,10 +105,11 @@ pkginfo_t* load_pkg(char *pkgfile)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *fn;
|
char *fn;
|
||||||
char *str;
|
char *str;
|
||||||
|
int fd;
|
||||||
|
|
||||||
MALLOC(str, PATH_MAX);
|
MALLOC(str, PATH_MAX);
|
||||||
fn = strdup("/tmp/pacman_XXXXXX");
|
fn = strdup("/tmp/pacman_XXXXXX");
|
||||||
mkstemp(fn);
|
fd = mkstemp(fn);
|
||||||
tar_extract_file(tar, fn);
|
tar_extract_file(tar, fn);
|
||||||
fp = fopen(fn, "r");
|
fp = fopen(fn, "r");
|
||||||
while(!feof(fp)) {
|
while(!feof(fp)) {
|
||||||
|
@ -115,6 +125,7 @@ pkginfo_t* load_pkg(char *pkgfile)
|
||||||
fprintf(stderr, "warning: could not remove tempfile %s\n", fn);
|
fprintf(stderr, "warning: could not remove tempfile %s\n", fn);
|
||||||
}
|
}
|
||||||
FREE(fn);
|
FREE(fn);
|
||||||
|
close(fd);
|
||||||
filelist = 1;
|
filelist = 1;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* package.h
|
* package.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
242
src/pacman.c
242
src/pacman.c
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* pacman.c
|
* pacman.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -64,11 +64,13 @@ unsigned short pmo_upgrade = 0;
|
||||||
unsigned short pmo_freshen = 0;
|
unsigned short pmo_freshen = 0;
|
||||||
unsigned short pmo_nosave = 0;
|
unsigned short pmo_nosave = 0;
|
||||||
unsigned short pmo_noconfirm = 0;
|
unsigned short pmo_noconfirm = 0;
|
||||||
|
unsigned short pmo_noprogressbar = 0;
|
||||||
unsigned short pmo_d_vertest = 0;
|
unsigned short pmo_d_vertest = 0;
|
||||||
unsigned short pmo_d_resolve = 0;
|
unsigned short pmo_d_resolve = 0;
|
||||||
unsigned short pmo_q_isfile = 0;
|
unsigned short pmo_q_isfile = 0;
|
||||||
unsigned short pmo_q_info = 0;
|
unsigned short pmo_q_info = 0;
|
||||||
unsigned short pmo_q_list = 0;
|
unsigned short pmo_q_list = 0;
|
||||||
|
unsigned short pmo_q_foreign = 0;
|
||||||
unsigned short pmo_q_orphans = 0;
|
unsigned short pmo_q_orphans = 0;
|
||||||
unsigned short pmo_q_owns = 0;
|
unsigned short pmo_q_owns = 0;
|
||||||
unsigned short pmo_q_search = 0;
|
unsigned short pmo_q_search = 0;
|
||||||
|
@ -256,8 +258,10 @@ int main(int argc, char *argv[])
|
||||||
pm_packages = db_loadpkgs(db_local);
|
pm_packages = db_loadpkgs(db_local);
|
||||||
|
|
||||||
/* the operation requires at least one target */
|
/* the operation requires at least one target */
|
||||||
if (list_count(pm_targets) == 0 && !(pmo_op == PM_QUERY || (pmo_op == PM_SYNC && (pmo_s_sync || pmo_s_upgrade || pmo_s_clean || pmo_group || pmo_q_list))))
|
if(list_count(pm_targets) == 0 && !(pmo_op == PM_QUERY || (pmo_op == PM_SYNC && (pmo_s_sync || pmo_s_upgrade || pmo_s_clean || pmo_group || pmo_q_list)))) {
|
||||||
|
fprintf(stderr, "error: no targets specified\n");
|
||||||
usage(pmo_op, (char*)basename(argv[0]));
|
usage(pmo_op, (char*)basename(argv[0]));
|
||||||
|
}
|
||||||
|
|
||||||
/* start the requested operation */
|
/* start the requested operation */
|
||||||
switch(pmo_op) {
|
switch(pmo_op) {
|
||||||
|
@ -267,10 +271,16 @@ int main(int argc, char *argv[])
|
||||||
case PM_QUERY: ret = pacman_query(db_local, pm_targets); break;
|
case PM_QUERY: ret = pacman_query(db_local, pm_targets); break;
|
||||||
case PM_SYNC: ret = pacman_sync(db_local, pm_targets); break;
|
case PM_SYNC: ret = pacman_sync(db_local, pm_targets); break;
|
||||||
case PM_DEPTEST: ret = pacman_deptest(db_local, pm_targets); break;
|
case PM_DEPTEST: ret = pacman_deptest(db_local, pm_targets); break;
|
||||||
case PM_MAIN: ret = 0; break;
|
case PM_MAIN: /* fallthrough */
|
||||||
default: fprintf(stderr, "error: no operation specified (use -h for help)\n\n");
|
default:
|
||||||
|
ret = 0;
|
||||||
|
if(list_count(pm_targets) > 0) {
|
||||||
|
fprintf(stderr, "error: no operation specified\n");
|
||||||
|
usage(pmo_op, (char*)basename(argv[0]));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
db_close(db_local);
|
db_close(db_local);
|
||||||
cleanup(ret);
|
cleanup(ret);
|
||||||
/* not reached */
|
/* not reached */
|
||||||
|
@ -827,6 +837,36 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!found) {
|
||||||
|
/* target was not found: check provides */
|
||||||
|
for(j = databases; !found && j; j = j->next) {
|
||||||
|
dbsync_t *dbs = (dbsync_t*)j->data;
|
||||||
|
PMList *p = whatprovides(dbs->db, targ);
|
||||||
|
if(p) {
|
||||||
|
/* we only take the first one in the list */
|
||||||
|
pkginfo_t *pkg = (pkginfo_t*)p->data;
|
||||||
|
if(treename == NULL ||
|
||||||
|
(treename && !strcmp(treename, dbs->sync->treename))) {
|
||||||
|
found = 1;
|
||||||
|
sync->dbs = dbs;
|
||||||
|
/* re-fetch the package record with dependency info */
|
||||||
|
sync->pkg = db_scan(sync->dbs->db, pkg->name, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
if(sync->pkg == NULL) {
|
||||||
|
found = 0;
|
||||||
|
}
|
||||||
|
if(pmo_d_resolve) {
|
||||||
|
/* looks like we're being called from 'makepkg -s' so these are all deps */
|
||||||
|
sync->pkg->reason = REASON_DEPEND;
|
||||||
|
} else {
|
||||||
|
/* this package was explicitly requested */
|
||||||
|
sync->pkg->reason = REASON_EXPLICIT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p->data = NULL;
|
||||||
|
FREELIST(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(!found) {
|
if(!found) {
|
||||||
if(treename == NULL) {
|
if(treename == NULL) {
|
||||||
/* target not found: check if it's a group */
|
/* target not found: check if it's a group */
|
||||||
|
@ -1338,6 +1378,44 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
depmissing_t* miss = (depmissing_t*)j->data;
|
depmissing_t* miss = (depmissing_t*)j->data;
|
||||||
syncpkg_t *s = find_pkginsync(miss->depend.name, final);
|
syncpkg_t *s = find_pkginsync(miss->depend.name, final);
|
||||||
if(s == NULL) {
|
if(s == NULL) {
|
||||||
|
int pfound = 0;
|
||||||
|
/* If miss->depend.name depends on something that miss->target and a
|
||||||
|
* package in final both provide, then it's okay... */
|
||||||
|
pkginfo_t *leavingp = db_scan(db, miss->target, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
pkginfo_t *conflictp = db_scan(db, miss->depend.name, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
if(!leavingp || !conflictp) {
|
||||||
|
fprintf(stderr, "error: something has gone horribly wrong\n");
|
||||||
|
allgood = 0;
|
||||||
|
goto sync_cleanup;
|
||||||
|
}
|
||||||
|
/* Look through the upset package's dependencies and try to match one up
|
||||||
|
* to a provisio from the package we want to remove */
|
||||||
|
for(k = conflictp->depends; k && !pfound; k = k->next) {
|
||||||
|
PMList *m;
|
||||||
|
for(m = leavingp->provides; m && !pfound; m = m->next) {
|
||||||
|
if(!strcmp(k->data, m->data)) {
|
||||||
|
/* Found a match -- now look through final for a package that
|
||||||
|
* provides the same thing. If none are found, then it truly
|
||||||
|
* is an unresolvable conflict. */
|
||||||
|
PMList *n, *o;
|
||||||
|
for(n = final; n && !pfound; n = n->next) {
|
||||||
|
syncpkg_t *sp = (syncpkg_t*)n->data;
|
||||||
|
for(o = sp->pkg->provides; o && !pfound; o = o->next) {
|
||||||
|
if(!strcmp(m->data, o->data)) {
|
||||||
|
/* found matching provisio -- we're good to go */
|
||||||
|
vprint("Found a matching provides (%s) in %s, conflict aborted\n",
|
||||||
|
(char*)o->data, sp->pkg->name);
|
||||||
|
pfound = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FREEPKG(conflictp);
|
||||||
|
FREEPKG(leavingp);
|
||||||
|
|
||||||
|
if(!pfound) {
|
||||||
if(allgood) {
|
if(allgood) {
|
||||||
fprintf(stderr, "error: this will break the following dependencies:\n");
|
fprintf(stderr, "error: this will break the following dependencies:\n");
|
||||||
allgood = 0;
|
allgood = 0;
|
||||||
|
@ -1345,6 +1423,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
printf(" %s: is required by %s\n", miss->target, miss->depend.name);
|
printf(" %s: is required by %s\n", miss->target, miss->depend.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FREELIST(i);
|
FREELIST(i);
|
||||||
FREELISTPKGS(rmtargs_p);
|
FREELISTPKGS(rmtargs_p);
|
||||||
}
|
}
|
||||||
|
@ -1401,7 +1480,6 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
allgood = !pacman_upgrade(db, files, dependonly);
|
allgood = !pacman_upgrade(db, files, dependonly);
|
||||||
}
|
}
|
||||||
/* propagate replaced packages' requiredby fields to their new owners */
|
/* propagate replaced packages' requiredby fields to their new owners */
|
||||||
/* XXX: segfault */
|
|
||||||
if(allgood) {
|
if(allgood) {
|
||||||
for(i = final; i; i = i->next) {
|
for(i = final; i; i = i->next) {
|
||||||
syncpkg_t *sync = (syncpkg_t*)i->data;
|
syncpkg_t *sync = (syncpkg_t*)i->data;
|
||||||
|
@ -1420,6 +1498,13 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
/* replace old's name with new's name in the requiredby's dependency list */
|
/* replace old's name with new's name in the requiredby's dependency list */
|
||||||
PMList *m;
|
PMList *m;
|
||||||
pkginfo_t *depender = db_scan(db, k->data, INFRQ_DEPENDS);
|
pkginfo_t *depender = db_scan(db, k->data, INFRQ_DEPENDS);
|
||||||
|
if(depender == NULL) {
|
||||||
|
/* If the depending package no longer exists in the local db,
|
||||||
|
* then it must have ALSO conflicted with sync->pkg. If
|
||||||
|
* that's the case, then we don't have anything to propagate
|
||||||
|
* here. */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for(m = depender->depends; m; m = m->next) {
|
for(m = depender->depends; m; m = m->next) {
|
||||||
if(!strcmp(m->data, old->name)) {
|
if(!strcmp(m->data, old->name)) {
|
||||||
FREE(m->data);
|
FREE(m->data);
|
||||||
|
@ -1866,17 +1951,21 @@ int pacman_add(pacdb_t *db, PMList *targets, PMList *dependonly)
|
||||||
|
|
||||||
if(nb) {
|
if(nb) {
|
||||||
char *temp;
|
char *temp;
|
||||||
|
int fd;
|
||||||
char *md5_local, *md5_pkg;
|
char *md5_local, *md5_pkg;
|
||||||
|
|
||||||
md5_local = MDFile(expath);
|
|
||||||
/* extract the package's version to a temporary file and md5 it */
|
/* extract the package's version to a temporary file and md5 it */
|
||||||
temp = strdup("/tmp/pacman_XXXXXX");
|
temp = strdup("/tmp/pacman_XXXXXX");
|
||||||
mkstemp(temp);
|
fd = mkstemp(temp);
|
||||||
if(tar_extract_file(tar, temp)) {
|
if(tar_extract_file(tar, temp)) {
|
||||||
logaction(stderr, "could not extract %s: %s", pathname, strerror(errno));
|
logaction(stderr, "could not extract %s: %s", pathname, strerror(errno));
|
||||||
errors++;
|
errors++;
|
||||||
|
unlink(temp);
|
||||||
|
FREE(temp);
|
||||||
|
close(fd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
md5_local = MDFile(expath);
|
||||||
md5_pkg = MDFile(temp);
|
md5_pkg = MDFile(temp);
|
||||||
/* append the new md5 hash to it's respective entry in info->backup
|
/* append the new md5 hash to it's respective entry in info->backup
|
||||||
* (it will be the new orginal)
|
* (it will be the new orginal)
|
||||||
|
@ -1938,15 +2027,10 @@ int pacman_add(pacdb_t *db, PMList *targets, PMList *dependonly)
|
||||||
vprint(" action: installing new file\n");
|
vprint(" action: installing new file\n");
|
||||||
installnew = 1;
|
installnew = 1;
|
||||||
} else {
|
} else {
|
||||||
char newpath[PATH_MAX];
|
vprint(" action: leaving file in place, installing new one as .pacnew\n");
|
||||||
vprint(" action: saving current file and installing new one\n");
|
strncat(expath, ".pacnew", PATH_MAX);
|
||||||
|
logaction(stderr, "warning: extracting %s%s as %s", pmo_root, pathname, expath);
|
||||||
installnew = 1;
|
installnew = 1;
|
||||||
snprintf(newpath, PATH_MAX, "%s.pacsave", expath);
|
|
||||||
if(rename(expath, newpath)) {
|
|
||||||
logaction(stderr, "error: could not rename %s: %s", expath, strerror(errno));
|
|
||||||
} else {
|
|
||||||
logaction(stderr, "warning: %s saved as %s", expath, newpath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(installnew) {
|
if(installnew) {
|
||||||
|
@ -1963,6 +2047,7 @@ int pacman_add(pacdb_t *db, PMList *targets, PMList *dependonly)
|
||||||
FREE(md5_orig);
|
FREE(md5_orig);
|
||||||
unlink(temp);
|
unlink(temp);
|
||||||
FREE(temp);
|
FREE(temp);
|
||||||
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
if(!notouch) {
|
if(!notouch) {
|
||||||
/*vprint(" %s\n", expath);*/
|
/*vprint(" %s\n", expath);*/
|
||||||
|
@ -2254,12 +2339,13 @@ int pacman_remove(pacdb_t *db, PMList *targets, PMList *skiplist)
|
||||||
info = (pkginfo_t*)targ->data;
|
info = (pkginfo_t*)targ->data;
|
||||||
|
|
||||||
if(!pmo_upgrade) {
|
if(!pmo_upgrade) {
|
||||||
printf("removing %s... ", info->name);
|
|
||||||
neednl = 1;
|
|
||||||
fflush(stdout);
|
|
||||||
/* run the pre-remove scriptlet if it exists */
|
/* run the pre-remove scriptlet if it exists */
|
||||||
snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", pmo_root, pmo_dbpath, db->treename, info->name, info->version);
|
snprintf(pm_install, PATH_MAX, "%s%s/%s/%s-%s/install", pmo_root, pmo_dbpath, db->treename, info->name, info->version);
|
||||||
runscriptlet(pm_install, "pre_remove", info->version, NULL);
|
runscriptlet(pm_install, "pre_remove", info->version, NULL);
|
||||||
|
|
||||||
|
printf("removing %s... ", info->name);
|
||||||
|
neednl = 1;
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pmo_r_dbonly) {
|
if(!pmo_r_dbonly) {
|
||||||
|
@ -2404,8 +2490,33 @@ int pacman_query(pacdb_t *db, PMList *targets)
|
||||||
char *package = NULL;
|
char *package = NULL;
|
||||||
char path[PATH_MAX+1];
|
char path[PATH_MAX+1];
|
||||||
pkginfo_t *info = NULL;
|
pkginfo_t *info = NULL;
|
||||||
PMList *targ, *lp, *q;
|
PMList *targ, *lp, *q, *databases = NULL;
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
PMList *i, *j;
|
||||||
|
|
||||||
|
if(pmo_q_foreign)
|
||||||
|
{
|
||||||
|
/* open sync db(s) */
|
||||||
|
PMList *dbp;
|
||||||
|
for(dbp = pmc_syncs; dbp; dbp = dbp->next) {
|
||||||
|
pacdb_t *db_sync = NULL;
|
||||||
|
dbsync_t *dbs = NULL;
|
||||||
|
sync_t *sync = (sync_t*)dbp->data;
|
||||||
|
|
||||||
|
db_sync = db_open(pmo_root, pmo_dbpath, sync->treename);
|
||||||
|
if(db_sync == NULL) {
|
||||||
|
fprintf(stderr, "error: could not open sync database: %s\n", sync->treename);
|
||||||
|
fprintf(stderr, " have you used --refresh yet?\n");
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
MALLOC(dbs, sizeof(dbsync_t));
|
||||||
|
dbs->sync = sync;
|
||||||
|
dbs->db = db_sync;
|
||||||
|
/* cache packages */
|
||||||
|
dbs->pkgcache = db_loadpkgs(db_sync);
|
||||||
|
databases = list_add(databases, dbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(pmo_q_search) {
|
if(pmo_q_search) {
|
||||||
db_search(db, pm_packages, "local", targets);
|
db_search(db, pm_packages, "local", targets);
|
||||||
|
@ -2512,7 +2623,7 @@ int pacman_query(pacdb_t *db, PMList *targets)
|
||||||
/* no target */
|
/* no target */
|
||||||
for(lp = pm_packages; lp; lp = lp->next) {
|
for(lp = pm_packages; lp; lp = lp->next) {
|
||||||
pkginfo_t *tmpp = (pkginfo_t*)lp->data;
|
pkginfo_t *tmpp = (pkginfo_t*)lp->data;
|
||||||
if(pmo_q_list || pmo_q_orphans) {
|
if(pmo_q_list || pmo_q_orphans || pmo_q_foreign) {
|
||||||
info = db_scan(db, tmpp->name, INFRQ_ALL);
|
info = db_scan(db, tmpp->name, INFRQ_ALL);
|
||||||
if(info == NULL) {
|
if(info == NULL) {
|
||||||
/* something weird happened */
|
/* something weird happened */
|
||||||
|
@ -2528,6 +2639,29 @@ int pacman_query(pacdb_t *db, PMList *targets)
|
||||||
printf("%s %s\n", tmpp->name, tmpp->version);
|
printf("%s %s\n", tmpp->name, tmpp->version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(pmo_q_foreign) {
|
||||||
|
int match = 0;
|
||||||
|
for(i = databases; i; i = i->next) {
|
||||||
|
dbsync_t *dbs = (dbsync_t*)i->data;
|
||||||
|
for(j = dbs->pkgcache; j; j = j->next) {
|
||||||
|
pkginfo_t *pkg = (pkginfo_t*)j->data;
|
||||||
|
char *haystack;
|
||||||
|
char *needle;
|
||||||
|
haystack = strdup(pkg->name);
|
||||||
|
strtoupper(haystack);
|
||||||
|
needle = strdup(info->name);
|
||||||
|
strtoupper(needle);
|
||||||
|
if(strstr(haystack, needle)) {
|
||||||
|
match = 1;
|
||||||
|
}
|
||||||
|
FREE(haystack);
|
||||||
|
FREE(needle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(match==0) {
|
||||||
|
printf("%s %s\n", tmpp->name, tmpp->version);
|
||||||
|
}
|
||||||
|
}
|
||||||
FREEPKG(info);
|
FREEPKG(info);
|
||||||
} else {
|
} else {
|
||||||
printf("%s %s\n", tmpp->name, tmpp->version);
|
printf("%s %s\n", tmpp->name, tmpp->version);
|
||||||
|
@ -2592,6 +2726,33 @@ int pacman_query(pacdb_t *db, PMList *targets)
|
||||||
if(info->requiredby == NULL) {
|
if(info->requiredby == NULL) {
|
||||||
printf("%s %s\n", info->name, info->version);
|
printf("%s %s\n", info->name, info->version);
|
||||||
}
|
}
|
||||||
|
} else if(pmo_q_foreign) {
|
||||||
|
int match = 0;
|
||||||
|
info = db_scan(db, package, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
if(info == NULL) {
|
||||||
|
fprintf(stderr, "Package \"%s\" was not found.\n", package);
|
||||||
|
return(2);
|
||||||
|
}
|
||||||
|
for(i = databases; i; i = i->next) {
|
||||||
|
dbsync_t *dbs = (dbsync_t*)i->data;
|
||||||
|
for(j = dbs->pkgcache; j; j = j->next) {
|
||||||
|
pkginfo_t *pkg = (pkginfo_t*)j->data;
|
||||||
|
char *haystack;
|
||||||
|
char *needle;
|
||||||
|
haystack = strdup(pkg->name);
|
||||||
|
strtoupper(haystack);
|
||||||
|
needle = strdup(info->name);
|
||||||
|
strtoupper(needle);
|
||||||
|
if(strstr(haystack, needle)) {
|
||||||
|
match = 1;
|
||||||
|
}
|
||||||
|
FREE(haystack);
|
||||||
|
FREE(needle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(match==0) {
|
||||||
|
printf("%s %s\n", info->name, info->version);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
info = db_scan(db, package, INFRQ_DESC);
|
info = db_scan(db, package, INFRQ_DESC);
|
||||||
if(info == NULL) {
|
if(info == NULL) {
|
||||||
|
@ -2802,10 +2963,28 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
|
||||||
return(1);
|
return(1);
|
||||||
} else*/
|
} else*/
|
||||||
if(miss->type == DEPEND) {
|
if(miss->type == DEPEND) {
|
||||||
|
int provisio_match = 0;
|
||||||
syncpkg_t *sync = NULL;
|
syncpkg_t *sync = NULL;
|
||||||
MALLOC(sync, sizeof(syncpkg_t));
|
MALLOC(sync, sizeof(syncpkg_t));
|
||||||
sync->replaces = NULL;
|
sync->replaces = NULL;
|
||||||
|
|
||||||
|
/* check if one of the packages in *list already provides this dependency */
|
||||||
|
for(j = list; j; j = j->next) {
|
||||||
|
syncpkg_t *sp = (syncpkg_t*)j->data;
|
||||||
|
if(sp == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for(k = sp->pkg->provides; k; k = k->next) {
|
||||||
|
if(!strcmp(miss->depend.name, k->data)) {
|
||||||
|
vprint("resolvedeps: %s provides dependency %s\n", sp->pkg->name, miss->depend.name);
|
||||||
|
provisio_match = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(provisio_match) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* find the package in one of the repositories */
|
/* find the package in one of the repositories */
|
||||||
for(j = databases; !found && j; j = j->next) {
|
for(j = databases; !found && j; j = j->next) {
|
||||||
dbsync_t *dbs = (dbsync_t*)j->data;
|
dbsync_t *dbs = (dbsync_t*)j->data;
|
||||||
|
@ -2853,7 +3032,7 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
|
||||||
FREE(sync);
|
FREE(sync);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
vprint("resolving %s\n", sync->pkg->name);
|
vprint("resolvedeps: resolving %s\n", sync->pkg->name);
|
||||||
found = 0;
|
found = 0;
|
||||||
for(j = trail; j; j = j->next) {
|
for(j = trail; j; j = j->next) {
|
||||||
syncpkg_t *tmp = (syncpkg_t*)j->data;
|
syncpkg_t *tmp = (syncpkg_t*)j->data;
|
||||||
|
@ -2886,7 +3065,7 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
|
||||||
if(resolvedeps(local, databases, sync, list, trail)) {
|
if(resolvedeps(local, databases, sync, list, trail)) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
vprint("adding %s-%s\n", sync->pkg->name, sync->pkg->version);
|
vprint("resolvedeps: adding %s-%s\n", sync->pkg->name, sync->pkg->version);
|
||||||
list = list_add(list, sync);
|
list = list_add(list, sync);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "error: cannot resolve dependencies for \"%s\"\n", miss->target);
|
fprintf(stderr, "error: cannot resolve dependencies for \"%s\"\n", miss->target);
|
||||||
|
@ -2894,7 +3073,7 @@ int resolvedeps(pacdb_t *local, PMList *databases, syncpkg_t *syncpkg, PMList *l
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* cycle detected -- skip it */
|
/* cycle detected -- skip it */
|
||||||
vprint("dependency cycle detected: %s\n", sync->pkg->name);
|
vprint("resolvedeps: dependency cycle detected: %s\n", sync->pkg->name);
|
||||||
FREEPKG(sync->pkg);
|
FREEPKG(sync->pkg);
|
||||||
FREE(sync);
|
FREE(sync);
|
||||||
}
|
}
|
||||||
|
@ -3014,11 +3193,15 @@ PMList* checkdeps(pacdb_t *db, unsigned short op, PMList *targets)
|
||||||
|
|
||||||
/* CONFLICTS */
|
/* CONFLICTS */
|
||||||
for(j = tp->conflicts; j; j = j->next) {
|
for(j = tp->conflicts; j; j = j->next) {
|
||||||
|
if(!strcmp(tp->name, j->data)) {
|
||||||
|
/* a package cannot conflict with itself -- that's just not nice */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/* check targets against database */
|
/* check targets against database */
|
||||||
for(k = pm_packages; k; k = k->next) {
|
for(k = pm_packages; k; k = k->next) {
|
||||||
int conflict = 0;
|
int conflict = 0;
|
||||||
pkginfo_t *dp = (pkginfo_t*)k->data;
|
pkginfo_t *dp = (pkginfo_t*)k->data;
|
||||||
if(!strcmp(dp->name, tp->name)) {
|
if(!strcmp(tp->name, dp->name)) {
|
||||||
/* a package cannot conflict with itself -- that's just not nice */
|
/* a package cannot conflict with itself -- that's just not nice */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3468,6 +3651,7 @@ int parseargs(int op, int argc, char **argv)
|
||||||
{"dbonly", no_argument, 0, 'k'},
|
{"dbonly", no_argument, 0, 'k'},
|
||||||
{"list", no_argument, 0, 'l'},
|
{"list", no_argument, 0, 'l'},
|
||||||
{"nosave", no_argument, 0, 'n'},
|
{"nosave", no_argument, 0, 'n'},
|
||||||
|
{"foreign", no_argument, 0, 'm'},
|
||||||
{"owns", no_argument, 0, 'o'},
|
{"owns", no_argument, 0, 'o'},
|
||||||
{"file", no_argument, 0, 'p'},
|
{"file", no_argument, 0, 'p'},
|
||||||
{"print-uris", no_argument, 0, 'p'},
|
{"print-uris", no_argument, 0, 'p'},
|
||||||
|
@ -3479,12 +3663,13 @@ int parseargs(int op, int argc, char **argv)
|
||||||
{"downloadonly", no_argument, 0, 'w'},
|
{"downloadonly", no_argument, 0, 'w'},
|
||||||
{"refresh", no_argument, 0, 'y'},
|
{"refresh", no_argument, 0, 'y'},
|
||||||
{"noconfirm", no_argument, 0, 1000},
|
{"noconfirm", no_argument, 0, 1000},
|
||||||
|
{"noprogressbar", no_argument, 0, 1003},
|
||||||
{"config", required_argument, 0, 1001},
|
{"config", required_argument, 0, 1001},
|
||||||
{"ignore", required_argument, 0, 1002},
|
{"ignore", required_argument, 0, 1002},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
while((opt = getopt_long(argc, argv, "ARUFQSTDYr:b:vkhscVfnoldepiuwyg", opts, &option_index))) {
|
while((opt = getopt_long(argc, argv, "ARUFQSTDYr:b:vkhscVfmnoldepiuwyg", opts, &option_index))) {
|
||||||
if(opt < 0) {
|
if(opt < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3493,6 +3678,7 @@ int parseargs(int op, int argc, char **argv)
|
||||||
case 1000: pmo_noconfirm = 1; break;
|
case 1000: pmo_noconfirm = 1; break;
|
||||||
case 1001: strcpy(pmo_configfile, optarg); break;
|
case 1001: strcpy(pmo_configfile, optarg); break;
|
||||||
case 1002: pmo_s_ignore = list_add(pmo_s_ignore, strdup(optarg)); break;
|
case 1002: pmo_s_ignore = list_add(pmo_s_ignore, strdup(optarg)); break;
|
||||||
|
case 1003: pmo_noprogressbar = 1; break;
|
||||||
case 'A': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_ADD); 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 'R': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_REMOVE); break;
|
||||||
case 'U': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_UPGRADE); break;
|
case 'U': pmo_op = (pmo_op != PM_MAIN ? 0 : PM_UPGRADE); break;
|
||||||
|
@ -3514,6 +3700,7 @@ int parseargs(int op, int argc, char **argv)
|
||||||
case 'k': pmo_r_dbonly = 1; break;
|
case 'k': pmo_r_dbonly = 1; break;
|
||||||
case 'l': pmo_q_list = 1; break;
|
case 'l': pmo_q_list = 1; break;
|
||||||
case 'n': pmo_nosave = 1; break;
|
case 'n': pmo_nosave = 1; break;
|
||||||
|
case 'm': pmo_q_foreign = 1; break;
|
||||||
case 'p': pmo_q_isfile = 1; pmo_s_printuris = 1; break;
|
case 'p': pmo_q_isfile = 1; pmo_s_printuris = 1; break;
|
||||||
case 'o': pmo_q_owns = 1; break;
|
case 'o': pmo_q_owns = 1; break;
|
||||||
case 'r': if(realpath(optarg, pmo_root) == NULL) {
|
case 'r': if(realpath(optarg, pmo_root) == NULL) {
|
||||||
|
@ -3853,6 +4040,7 @@ void usage(int op, char *myname)
|
||||||
printf(" -g, --groups view all members of a package group\n");
|
printf(" -g, --groups view all members of a package group\n");
|
||||||
printf(" -i, --info view package information (use -ii for more)\n");
|
printf(" -i, --info view package information (use -ii for more)\n");
|
||||||
printf(" -l, --list list the contents of the queried package\n");
|
printf(" -l, --list list the contents of the queried package\n");
|
||||||
|
printf(" -m, --foreign list all packages that were not found in the sync db(s)\n");
|
||||||
printf(" -o, --owns <file> query the package that owns <file>\n");
|
printf(" -o, --owns <file> query the package that owns <file>\n");
|
||||||
printf(" -p, --file pacman will query the package file [package] instead of\n");
|
printf(" -p, --file pacman will query the package file [package] instead of\n");
|
||||||
printf(" looking in the database\n");
|
printf(" looking in the database\n");
|
||||||
|
@ -3875,6 +4063,7 @@ void usage(int op, char *myname)
|
||||||
}
|
}
|
||||||
printf(" --config <path> set an alternate configuration file\n");
|
printf(" --config <path> set an alternate configuration file\n");
|
||||||
printf(" --noconfirm do not ask for any confirmation\n");
|
printf(" --noconfirm do not ask for any confirmation\n");
|
||||||
|
printf(" --noprogressbar do not show a progress bar when downloading files\n");
|
||||||
printf(" -v, --verbose be verbose\n");
|
printf(" -v, --verbose be verbose\n");
|
||||||
printf(" -r, --root <path> set an alternate installation root\n");
|
printf(" -r, --root <path> set an alternate installation root\n");
|
||||||
printf(" -b, --dbpath <path> set an alternate database location\n");
|
printf(" -b, --dbpath <path> set an alternate database location\n");
|
||||||
|
@ -3887,7 +4076,7 @@ void version(void)
|
||||||
{
|
{
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" .--. Pacman v%s\n", PACVER);
|
printf(" .--. Pacman v%s\n", PACVER);
|
||||||
printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2005 Judd Vinet <jvinet@zeroflux.org>\n");
|
printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2006 Judd Vinet <jvinet@zeroflux.org>\n");
|
||||||
printf("\\ '-. '-' '-' '-' \n");
|
printf("\\ '-. '-' '-' '-' \n");
|
||||||
printf(" '--' This program may be freely redistributed under\n");
|
printf(" '--' This program may be freely redistributed under\n");
|
||||||
printf(" the terms of the GNU General Public License\n\n");
|
printf(" the terms of the GNU General Public License\n\n");
|
||||||
|
@ -4029,6 +4218,7 @@ void cleanup(int signum)
|
||||||
FREE(pmo_logfile);
|
FREE(pmo_logfile);
|
||||||
FREE(pmo_proxyhost);
|
FREE(pmo_proxyhost);
|
||||||
FREE(pmo_xfercommand);
|
FREE(pmo_xfercommand);
|
||||||
|
FREE(pmo_configfile);
|
||||||
|
|
||||||
FREELIST(pm_targets);
|
FREELIST(pm_targets);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* pacman.h
|
* pacman.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* pacsync.c
|
* pacsync.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -52,6 +52,7 @@ extern char *pmo_xfercommand;
|
||||||
|
|
||||||
extern unsigned short pmo_proxyport;
|
extern unsigned short pmo_proxyport;
|
||||||
extern unsigned short pmo_nopassiveftp;
|
extern unsigned short pmo_nopassiveftp;
|
||||||
|
extern unsigned short pmo_noprogressbar;
|
||||||
extern unsigned short pmo_chomp;
|
extern unsigned short pmo_chomp;
|
||||||
|
|
||||||
/* sync servers */
|
/* sync servers */
|
||||||
|
@ -483,6 +484,10 @@ static int log_progress(netbuf *ctl, int xfered, void *arg)
|
||||||
static unsigned short mouth;
|
static unsigned short mouth;
|
||||||
static unsigned int lastcur = 0;
|
static unsigned int lastcur = 0;
|
||||||
|
|
||||||
|
if(pmo_noprogressbar) {
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
gettimeofday(&t1, NULL);
|
gettimeofday(&t1, NULL);
|
||||||
if(xfered+offset == fsz) {
|
if(xfered+offset == fsz) {
|
||||||
t = t0;
|
t = t0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* pacsync.h
|
* pacsync.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* rpmvercmp.c
|
* rpmvercmp.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* rpmvercmp.h
|
* rpmvercmp.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* util.c
|
* util.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -433,7 +433,11 @@ int reg_match(char *string, char *pattern)
|
||||||
int result;
|
int result;
|
||||||
regex_t reg;
|
regex_t reg;
|
||||||
|
|
||||||
regcomp(®, pattern, REG_EXTENDED | REG_NOSUB);
|
if (regcomp(®, pattern, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "error: %s is not a valid regular expression.\n", pattern);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
result = regexec(®, string, 0, 0, 0);
|
result = regexec(®, string, 0, 0, 0);
|
||||||
regfree(®);
|
regfree(®);
|
||||||
return(!(result));
|
return(!(result));
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* util.h
|
* util.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* vercmp.c
|
* vercmp.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
Loading…
Add table
Reference in a new issue