summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/PKGBUILD.5.txt5
-rw-r--r--doc/makepkg.8.txt20
-rw-r--r--doc/pacman.8.txt18
-rw-r--r--etc/Makefile.am2
-rw-r--r--etc/pacman.conf.in34
-rw-r--r--etc/pacman.d/.gitignore1
-rw-r--r--etc/pacman.d/Makefile.am17
-rw-r--r--etc/pacman.d/mirrorlist.in84
-rw-r--r--lib/libalpm/db.c2
-rw-r--r--lib/libalpm/deps.c4
-rw-r--r--lib/libalpm/trans.c2
-rw-r--r--lib/libalpm/util.c11
-rw-r--r--lib/libalpm/util.h1
-rw-r--r--pactest/tests/provision001.py (renamed from pactest/tests/sync500.py)2
-rw-r--r--pactest/tests/provision002.py (renamed from pactest/tests/sync501.py)4
-rw-r--r--pactest/tests/provision010.py (renamed from pactest/tests/add043.py)2
-rw-r--r--pactest/tests/provision011.py (renamed from pactest/tests/add044.py)4
-rw-r--r--pactest/tests/provision012.py (renamed from pactest/tests/add045.py)4
-rw-r--r--pactest/tests/provision020.py15
-rw-r--r--pactest/tests/provision021.py15
-rw-r--r--pactest/tests/provision022.py15
-rw-r--r--scripts/makepkg.sh.in32
-rw-r--r--scripts/repo-add.sh.in11
-rw-r--r--scripts/repo-remove.sh.in4
-rw-r--r--src/pacman/pacman.c4
-rw-r--r--src/pacman/remove.c3
26 files changed, 148 insertions, 168 deletions
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt
index 3ef9d04e..ac394729 100644
--- a/doc/PKGBUILD.5.txt
+++ b/doc/PKGBUILD.5.txt
@@ -145,8 +145,9 @@ Options and Directives
a package to provide dependencies other than its own package name. For
example, the dcron package can provide 'cron', which allows packages to
depend on 'cron' rather than 'dcron OR fcron'.
- Versioned provisions are also possible. For example, dcron can provide
- 'cron 2.0' to satisfy the 'cron>=2.0' dependency of other packages.
+ Versioned provisions are also possible, in the 'name=version' format.
+ For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
+ dependency of other packages.
*replaces (array)*::
An array of packages that this package should replace, and can be used
diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 689556d4..8f166a55 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -30,6 +30,11 @@ to use.
Options
-------
+*\--asroot*::
+ Allow makepkg to run as root. This is for security purposes as it is
+ normally dangerous to do so. This will also disable use of fakeroot and
+ sudo.
+
*-A, \--ignorearch*::
Ignore a missing or incomplete arch field in the build script. This is
for rebuilding packages from source when the PKGBUILD may be slightly
@@ -68,6 +73,11 @@ Options
default to the current directory. This allows the built package to be
overwritten.
+*-forcever*::
+ This is a hidden option that should *not* be used unless you really know
+ what you are doing. makepkg uses this internally when calling itself to
+ set the new development pkgver of the package.
+
*-g, \--geninteg*::
For each source file in the source array of PKGBUILD, download the file
if required and generate integrity checks. The integrity checks
@@ -78,6 +88,11 @@ Options
*-h, \--help*::
Output syntax and command line options.
+*\--holdver*::
+ Useful when building development versions of packages. Prevents makepkg
+ from automatically bumping the pkgver to the latest revision number in
+ the package's development tree.
+
*-i, \--install*::
Install or upgrade the package after a successful build using
linkman:pacman[8].
@@ -108,11 +123,6 @@ Options
dependencies are not found, pacman will try to resolve them. If
successful, the missing packages will be downloaded and installed.
-*\--asroot*::
- Allow makepkg to run as root. This is for security purposes as it is
- normally dangerous to do so. This will also disable use of fakeroot and
- sudo.
-
*\--source*::
Do not actually build the package, but build a source-only tarball. This
is useful for passing a single tarball to another program such as a
diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 0da83a67..c47af65e 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -120,9 +120,9 @@ Options
*\--cachedir* <'dir'>::
Specify an alternative package cache location (a typical default is
``/var/cache/pacman/pkg''). Multiple cache directories can be specified,
- and they are tried in the order they are passed to pacman. *NOTE*: if
- specified, this is an absolute path and the root path is not automatically
- prepended. This behavior changed in pacman 3.1.0.
+ and they are tried in the order they are passed to pacman. *NOTE*: this
+ is an absolute path, the root path is not automatically prepended. This
+ behavior changed in pacman 3.1.0.
*\--config* <'file'>::
Specify an alternate configuration file.
@@ -207,7 +207,8 @@ Remove Options[[RO]]
--------------------
*-c, \--cascade*::
Remove all target packages, as well as all packages that depend on one
- or more target packages. This operation is recursive.
+ or more target packages. This operation is recursive, and must be used
+ with care since it can remove many potentially needed packages.
*-k, \--keep*::
Removes the database entry only. Leaves all files in place.
@@ -218,10 +219,11 @@ Remove Options[[RO]]
file should be renamed with a ``.pacsave'' extension.
*-s, \--recursive*::
- Remove each target specified including all dependencies, provided that
- (A) they are not required by other packages; and (B) they were not
- explicitly installed by the user. This option is analogous to a
- backwards '\--sync' operation.
+ Remove each target specified including all of their dependencies, provided
+ that (A) they are not required by other packages; and (B) they were not
+ explicitly installed by the user. This operation is recursive and analogous
+ to a backwards '\--sync' operation, and helps keep a clean system without
+ orphans.
Sync Options[[SO]]
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 6fa7d98c..b4f4972e 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,5 +1,3 @@
-SUBDIRS = pacman.d
-
dist_sysconf_DATA = makepkg.conf pacman.conf
EXTRA_DIST = makepkg.conf.in pacman.conf.in
diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in
index a072db13..351d23f4 100644
--- a/etc/pacman.conf.in
+++ b/etc/pacman.conf.in
@@ -1,7 +1,7 @@
#
# @sysconfdir@/pacman.conf
#
-# See the pacman manpage for option directives
+# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
@@ -23,24 +23,24 @@ HoldPkg = pacman glibc
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
+# - URLs will have $repo replaced by the name of the current repo
+#
+# Repository entries are of the format:
+# [repo-name]
+# Server = ServerName
+# Include = IncludePath
+#
+# The header [repo-name] is crucial - it must be present and
+# uncommented to enable the repo.
#
-#[testing]
-#Include = @sysconfdir@/pacman.d/mirrorlist
-
-[core]
-# Add your preferred servers here, they will be used first
-Include = @sysconfdir@/pacman.d/mirrorlist
-
-[extra]
-# Add your preferred servers here, they will be used first
-Include = @sysconfdir@/pacman.d/mirrorlist
-
-[community]
-# Add your preferred servers here, they will be used first
-Include = @sysconfdir@/pacman.d/mirrorlist
-#[unstable]
-# Add your preferred servers here, they will be used first
+# An example of a disabled remote package repository with multiple servers
+# available. To enable, uncomment the following lines. You can add preferred
+# servers immediately after the header and they will be used before the
+# default mirrors.
+#[core]
+#Server = ftp://ftp.example.com/foobar/$repo/os/i686/
+# The file referenced here should contain a list of 'Server = ' lines.
#Include = @sysconfdir@/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
diff --git a/etc/pacman.d/.gitignore b/etc/pacman.d/.gitignore
deleted file mode 100644
index b47959b7..00000000
--- a/etc/pacman.d/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-mirrorlist
diff --git a/etc/pacman.d/Makefile.am b/etc/pacman.d/Makefile.am
deleted file mode 100644
index e1f33c76..00000000
--- a/etc/pacman.d/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-pkgsysconfdir = ${sysconfdir}/pacman.d
-dist_pkgsysconf_DATA = mirrorlist
-EXTRA_DIST = mirrorlist.in
-#
-# Files that should be removed, but which Automake does not know.
-MOSTLYCLEANFILES = $(dist_pkgsysconf_DATA)
-
-$(dist_pkgsysconf_DATA): Makefile
- rm -f $@ $@.tmp
- sed \
- -e 's|@CARCH[@]|$(CARCH)|g' \
- $(srcdir)/mirrorlist.in >$@.tmp
- mv $@.tmp $@
-
-mirrorlist: $(srcdir)/mirrorlist.in
-
-# vim:set ts=2 sw=2 noet:
diff --git a/etc/pacman.d/mirrorlist.in b/etc/pacman.d/mirrorlist.in
deleted file mode 100644
index fd2e41ce..00000000
--- a/etc/pacman.d/mirrorlist.in
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# $repo: Arch Linux @REPO@ repository
-#
-
-# United States
-Server = ftp://ftp.archlinux.org/$repo/os/@CARCH@
-Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/@CARCH@
-Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/@CARCH@
-Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp-linux.cc.gatech.edu/pub/linux/distributions/archlinux/$repo/os/@CARCH@
-Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/$repo/os/@CARCH@
-Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/$repo/os/@CARCH@
-Server = http://holmes.umflint.edu/archlinux/$repo/os/@CARCH@
-
-# South America
-# - Brazil
-Server = http://archlinux.c3sl.ufpr.br/$repo/os/@CARCH@
-Server = ftp://archlinux.c3sl.ufpr.br/archlinux/$repo/os/@CARCH@
-
-# Europe
-# - Austria
-Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/$repo/os/@CARCH@
-# - Belgium
-Server = ftp://ftp.belnet.be/mirror/archlinux.org/$repo/os/@CARCH@
-# - Czech Republic
-Server = ftp://ftp.sh.cvut.cz/MIRRORS/arch/$repo/os/@CARCH@
-# - Estonia
-Server = ftp://ftp.estpak.ee/pub/archlinux/$repo/os/@CARCH@
-# - Finland
-Server = ftp://ftp.sixnix.net/pub/archlinux/$repo/os/@CARCH@
-# - France
-Server = ftp://mir1.archlinuxfr.org/archlinux/$repo/os/@CARCH@
-Server = ftp://mir2.archlinuxfr.org/archlinux/$repo/os/@CARCH@
-Server = ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/$repo/os/@CARCH@
-Server = http://mir.archlinux.fr/$repo/os/@CARCH@
-Server = ftp://ftp.free.fr/mirrors/ftp.archlinux.org/$repo/os/@CARCH@
-# - Germany
-Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/@CARCH@
-Server = ftp://ftp.archlinuxppc.org/i686/$repo/os/@CARCH@
-# - Great Britain
-Server = http://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/@CARCH@
-# - Greece
-Server = ftp://ftp.ntua.gr/pub/linux/archlinux/$repo/os/@CARCH@
-# - Hungary
-Server = ftp://ftp.mfa.kfki.hu/pub/mirrors/ftp.archlinux.org/$repo/os/@CARCH@
-# - Ireland
-Server = ftp://ftp.heanet.ie/mirrors/ftp.archlinux.org/$repo/os/@CARCH@
-# - Italy
-Server = ftp://mi.mirror.garr.it/mirrors/archlinux/$repo/os/@CARCH@
-# - Netherlands
-Server = ftp://ftp.nluug.nl/pub/metalab/distributions/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/$repo/os/@CARCH@
-# - Poland
-Server = ftp://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/$repo/os/@CARCH@
-Server = ftp://mirror.icis.pcz.pl/archlinux/$repo/os/@CARCH@
-# - Portugal
-Server = ftp://cesium.di.uminho.pt/pub/archlinux/$repo/os/@CARCH@
-# - Romania
-Server = ftp://ftp.iasi.roedu.net/mirrors/archlinux.org/$repo/os/@CARCH@
-# - Russia
-Server = ftp://archlinux.org.ru/pub/archlinux/$repo/os/@CARCH@
-Server = ftp://mirror.yandex.ru/archlinux/$repo/os/@CARCH@
-Server = http://archlinux.freeside.ru/$repo/os/@CARCH@
-# - Sweden
-Server = ftp://ftp.ds.hj.se/pub/os/linux/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp.gigabit.nu/$repo/os/@CARCH@
-# - Switzerland
-Server = ftp://archlinux.puzzle.ch/$repo/os/@CARCH@
-# - Turkey
-Server = http://server.elsistech.com/archlinux/$repo/os/@CARCH@
-# - Ukraine
-Server = ftp://hell.org.ua/archlinux/$repo/os/@CARCH@
-Server = ftp://ftp.linux.kiev.ua/pub/Linux/ArchLinux/$repo/os/@CARCH@
-
-# Asia
-# - Israel
-Server = http://mirror.isoc.org.il/pub/archlinux/$repo/os/@CARCH@
-
-# Australia
-Server = ftp://mirror.pacific.net.au/linux/archlinux/$repo/os/@CARCH@
-Server = ftp://mirror.aarnet.edu.au/pub/archlinux/$repo/os/@CARCH@
-
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 54a31e95..3bddea65 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -648,7 +648,7 @@ int _alpm_prov_cmp(const void *provision, const void *needle)
char *tmpptr;
char *provname = strdup(provision);
int retval = 0;
- tmpptr = strchr(provname, ' ');
+ tmpptr = strchr(provname, '=');
if(tmpptr != NULL) { /* provision-version */
*tmpptr='\0';
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 46cdc0c3..12da6b09 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -343,10 +343,10 @@ int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
satisfy = (strcmp(pkgname, dep->name) == 0
&& dep_vercmp(pkgversion, dep->mod, dep->version));
- /* check provisions, format : "name version" */
+ /* check provisions, format : "name=version" */
for(i = alpm_pkg_get_provides(pkg); i && !satisfy; i = i->next) {
char *provname = strdup(i->data);
- char *provver = strchr(provname, ' ');
+ char *provver = strchr(provname, '=');
if(provver == NULL) { /* no provision version */
satisfy = (dep->mod == PM_DEP_MOD_ANY
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 292c7160..ecc40a0f 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -487,7 +487,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
/* creates a directory in $root/tmp/ for copying/extracting the scriptlet */
snprintf(tmpdir, PATH_MAX, "%stmp/", root);
if(stat(tmpdir, &buf)) {
- _alpm_makepath(tmpdir);
+ _alpm_makepath_mode(tmpdir, 01777);
}
snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", root);
if(mkdtemp(tmpdir) == NULL) {
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index d09b9b14..e1413a25 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -178,9 +178,14 @@ char* strsep(char** str, const char* delims)
}
#endif
-/* does the same thing as 'mkdir -p' */
int _alpm_makepath(const char *path)
{
+ return(_alpm_makepath_mode(path, 0755));
+}
+
+/* does the same thing as 'mkdir -p' */
+int _alpm_makepath_mode(const char *path, mode_t mode)
+{
char *orig, *str, *ptr;
char full[PATH_MAX] = "";
mode_t oldmask;
@@ -196,7 +201,7 @@ int _alpm_makepath(const char *path)
strcat(full, "/");
strcat(full, ptr);
if(stat(full, &buf)) {
- if(mkdir(full, 0755)) {
+ if(mkdir(full, mode)) {
FREE(orig);
umask(oldmask);
_alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s\n"),
@@ -399,6 +404,8 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
if(S_ISREG(st->st_mode)) {
archive_entry_set_mode(entry, 0644);
+ } else if(S_ISDIR(st->st_mode)) {
+ archive_entry_set_mode(entry, 0755);
}
if (fn && strcmp(fn, entryname)) {
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index 8db26350..4a06e3b0 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -51,6 +51,7 @@
#define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0)
int _alpm_makepath(const char *path);
+int _alpm_makepath_mode(const char *path, mode_t mode);
int _alpm_copyfile(const char *src, const char *dest);
char *_alpm_strtrim(char *str);
char *_alpm_strreplace(const char *str, const char *needle, const char *replace);
diff --git a/pactest/tests/sync500.py b/pactest/tests/provision001.py
index 36364c16..37e3d935 100644
--- a/pactest/tests/sync500.py
+++ b/pactest/tests/provision001.py
@@ -1,7 +1,7 @@
self.description = "-S provision"
sp = pmpkg("pkg1")
-sp.provides = ["provision 1.0-1"]
+sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp)
self.args = "-S provision"
diff --git a/pactest/tests/sync501.py b/pactest/tests/provision002.py
index fa5f3688..32bc4b8d 100644
--- a/pactest/tests/sync501.py
+++ b/pactest/tests/provision002.py
@@ -1,11 +1,11 @@
self.description = "-S provision"
sp = pmpkg("pkg1")
-sp.provides = ["provision 1.0-1"]
+sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp)
sp = pmpkg("pkg2")
-sp.provides = ["provision 1.0-1"]
+sp.provides = ["provision=1.0-1"]
self.addpkg2db("sync", sp)
self.args = "-S provision"
diff --git a/pactest/tests/add043.py b/pactest/tests/provision010.py
index 18f732ee..711a7319 100644
--- a/pactest/tests/add043.py
+++ b/pactest/tests/provision010.py
@@ -8,7 +8,7 @@ lp = pmpkg("pkg2", "1.0-2")
lp.provides = ["provision"]
self.addpkg2db("local", lp)
-self.args = "-A %s" % p.filename()
+self.args = "-U %s" % p.filename()
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
diff --git a/pactest/tests/add044.py b/pactest/tests/provision011.py
index cbc82e9d..96aac300 100644
--- a/pactest/tests/add044.py
+++ b/pactest/tests/provision011.py
@@ -5,10 +5,10 @@ p.depends = ["provision>=1.0-2"]
self.addpkg(p)
lp = pmpkg("pkg2", "1.0-2")
-lp.provides = ["provision 1.0-2"]
+lp.provides = ["provision=1.0-2"]
self.addpkg2db("local", lp)
-self.args = "-A %s" % p.filename()
+self.args = "-U %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
diff --git a/pactest/tests/add045.py b/pactest/tests/provision012.py
index b53e0906..f7ed2216 100644
--- a/pactest/tests/add045.py
+++ b/pactest/tests/provision012.py
@@ -5,10 +5,10 @@ p.depends = ["provision>=1.0-2"]
self.addpkg(p)
lp = pmpkg("pkg2", "1.0-2")
-lp.provides = ["provision 1.0-1"]
+lp.provides = ["provision=1.0-1"]
self.addpkg2db("local", lp)
-self.args = "-A %s" % p.filename()
+self.args = "-U %s" % p.filename()
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
diff --git a/pactest/tests/provision020.py b/pactest/tests/provision020.py
new file mode 100644
index 00000000..7cb0a01b
--- /dev/null
+++ b/pactest/tests/provision020.py
@@ -0,0 +1,15 @@
+self.description = "provision>=1.0-2 dependency"
+
+p = pmpkg("pkg1", "1.0-2")
+p.depends = ["provision>=1.0-2"]
+self.addpkg2db("sync", p)
+
+lp = pmpkg("pkg2", "1.0-2")
+lp.provides = ["provision"]
+self.addpkg2db("local", lp)
+
+self.args = "-S %s" % p.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/provision021.py b/pactest/tests/provision021.py
new file mode 100644
index 00000000..a98e1f33
--- /dev/null
+++ b/pactest/tests/provision021.py
@@ -0,0 +1,15 @@
+self.description = "provision>=1.0-2 dependency (2)"
+
+p = pmpkg("pkg1", "1.0-2")
+p.depends = ["provision>=1.0-2"]
+self.addpkg2db("sync", p)
+
+lp = pmpkg("pkg2", "1.0-2")
+lp.provides = ["provision=1.0-2"]
+self.addpkg2db("local", lp)
+
+self.args = "-S %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/pactest/tests/provision022.py b/pactest/tests/provision022.py
new file mode 100644
index 00000000..4883d428
--- /dev/null
+++ b/pactest/tests/provision022.py
@@ -0,0 +1,15 @@
+self.description = "provision>=1.0-2 dependency (3)"
+
+p = pmpkg("pkg1", "1.0-2")
+p.depends = ["provision>=1.0-2"]
+self.addpkg2db("sync", p)
+
+lp = pmpkg("pkg2", "1.0-2")
+lp.provides = ["provision=1.0-1"]
+self.addpkg2db("local", lp)
+
+self.args = "-S %s" % p.name
+
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("PKG_EXIST=pkg2")
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 45b625d4..219e2d17 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -57,6 +57,7 @@ REPKG=0
LOGGING=0
SOURCEONLY=0
IGNOREARCH=0
+HOLDVER=0
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
# when dealing with svn/cvs/etc PKGBUILDs.
@@ -979,6 +980,10 @@ install_package() {
devel_check() {
newpkgver=""
+ # Only update pkgver if --holdver is not set
+ if [ "$HOLDVER" = "1" ]; then
+ return
+ fi
if [ "$FORCE_VER" = "" ]; then
# Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so.
# This will only be used on the first call to makepkg; subsequent
@@ -1069,6 +1074,7 @@ usage() {
echo "$(gettext " -R, --repackage Repackage contents of pkg/ without building")"
echo "$(gettext " -s, --syncdeps Install missing dependencies with pacman")"
echo "$(gettext " --asroot Allow makepkg to run as root user")"
+ echo "$(gettext " --holdver Prevent automatic version bumping for development PKGBUILDs")"
echo "$(gettext " --source Do not build package; generate a source-only tarball")"
echo
echo "$(gettext "These options can be passed to pacman:")"
@@ -1116,8 +1122,8 @@ SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined
# Parse Command Line Options.
OPT_SHORT="AbcCdefFghiLmop:rRsSV"
-OPT_LONG="ignorearch,asroot,builddeps,clean,cleancache,nodeps,noextract,force,geninteg,help,install,log"
-OPT_LONG="$OPT_LONG,nocolor,nobuild,rmdeps,repackage,source,syncdeps,usesudo,version,forcever:"
+OPT_LONG="ignorearch,asroot,builddeps,clean,cleancache,nodeps,noextract,force,forcever:,geninteg,help,holdver"
+OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,source,syncdeps,usesudo,version"
# Pacman Options
OPT_LONG="$OPT_LONG,noconfirm,noprogressbar"
OPT_TEMP="$(getopt -o "$OPT_SHORT" -l "$OPT_LONG" -n "$(basename "$0")" -- "$@" || echo 'GETOPT GO BANG!')"
@@ -1143,8 +1149,11 @@ while true; do
-d|--nodeps) NODEPS=1 ;;
-e|--noextract) NOEXTRACT=1 ;;
-f|--force) FORCE=1 ;;
+ #hidden opt used by fakeroot call for svn/cvs/etc PKGBUILDs to set pkgver
+ --forcever) shift; FORCE_VER=$1;;
-F) INFAKEROOT=1 ;;
-g|--geninteg) GENINTEG=1 ;;
+ --holdver) HOLDVER=1 ;;
-i|--install) INSTALL=1 ;;
-L|--log) LOGGING=1 ;;
-m|--nocolor) USE_COLOR='n' ;;
@@ -1155,9 +1164,6 @@ while true; do
--source) SOURCEONLY=1 ;;
-s|--syncdeps) DEP_BIN=1 ;;
- # Hidden option used by fakeroot call for svn/cvs/etc PKGBUILDs to set the pkgver
- --forcever) shift; FORCE_VER=$1;;
-
# BEGIN DEPRECATED
-S|--usesudo)
warning "$(gettext "Sudo is used by default now. The --usesudo option is deprecated!")" ;;
@@ -1172,6 +1178,13 @@ while true; do
shift
done
+if [ "$HOLDVER" = "1" -a "$FORCE_VER" != "" ]; then
+ # The extra '--' is here to prevent gettext from thinking --holdver is
+ # an option
+ error "$(gettext -- "--holdver and --forcever cannot both be specified")"
+ exit 1
+fi
+
if [ "$CLEANCACHE" = "1" ]; then
#fix flyspray feature request #5223
if [ -n "$SRCDEST" -a "$SRCDEST" != "$startdir" ]; then
@@ -1311,11 +1324,15 @@ if [ "$install" -a ! -f "$install" ]; then
exit 1
fi
+# We need to run devel_update regardless of whether we are in the fakeroot
+# build process so that if the user runs makepkg --forcever manually, we
+# 1) output the correct pkgver, and 2) use the correct filename when
+# checking if the package file already exists - fixes FS #9194
devel_check
+devel_update
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
- -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" \
- -a "$FORCE_VER" = "" ]; then
+ -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" ]; then
if [ "$INSTALL" = "1" ]; then
warning "$(gettext "A package has already been built, installing existing package...")"
install_package
@@ -1332,7 +1349,6 @@ if [ "$INFAKEROOT" = "1" ]; then
if [ "$REPKG" = "1" ]; then
warning "$(gettext "Skipping build.")"
else
- devel_update
run_build
tidy_install
fi
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 98191b62..c37a12fa 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -28,6 +28,9 @@ confdir='@sysconfdir@'
FORCE=0
REPO_DB_FILE=""
+# ensure we have a sane umask set
+umask 0022
+
msg() {
local mesg=$1; shift
printf "==> ${mesg}\n" "$@" >&1
@@ -77,7 +80,7 @@ test_repo_db_file () {
return 0 # YES
fi
else
- return 0 # YES - No database file is also aloud.
+ return 0 # YES - No database file is also allowed
fi
return 1 # NO
@@ -138,7 +141,7 @@ db_write_entry()
startdir
local OLDIFS="$IFS"
- # IFS (field seperator) is only the newline character
+ # IFS (field separator) is only the newline character
IFS="
"
@@ -285,7 +288,7 @@ gstmpdir=$(mktemp -d /tmp/repo-add.XXXXXXXXXX) || (\
exit 1)
success=0
-# parse arguements
+# parse arguments
for arg in "$@"; do
if [ "$arg" == "--force" -o "$arg" == "-f" ]; then
FORCE=1
@@ -315,7 +318,7 @@ for arg in "$@"; do
fi
done
-# if all operations were a success, rezip database
+# if all operations were a success, re-zip database
if [ $success -eq 1 ]; then
msg "$(gettext "Creating updated database file %s")" "$REPO_DB_FILE"
pushd "$gstmpdir" 2>&1 >/dev/null
diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
index 6335c00f..05bec390 100644
--- a/scripts/repo-remove.sh.in
+++ b/scripts/repo-remove.sh.in
@@ -132,7 +132,7 @@ gstmpdir=$(mktemp -d /tmp/repo-remove.XXXXXXXXXX) || (\
exit 1)
success=0
-# parse arguements
+# parse arguments
for arg in "$@"; do
if [ -z "$REPO_DB_FILE" ]; then
REPO_DB_FILE=$(readlink -f "$arg")
@@ -154,7 +154,7 @@ for arg in "$@"; do
fi
done
-# if all operations were a success, rezip database
+# if all operations were a success, re-zip database
if [ $success -eq 1 ]; then
msg "$(gettext "Creating updated database file '%s'...")" "$REPO_DB_FILE"
pushd "$gstmpdir" 2>&1 >/dev/null
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 1aa29682..27130254 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -606,8 +606,8 @@ static int _parseconfig(const char *file, const char *givensection,
* follow the toupper() rules we may expect, e.g. tr_TR where i != I.
*/
upperkey = strtoupper(strdup(key));
- if(section == NULL && (strcmp(key, "Include") == 0 || strcmp(upperkey, "INCLUDE") == 0)) {
- pm_printf(PM_LOG_ERROR, _("config file %s, line %d: 'Include' directive must belong to a section.\n"),
+ if(section == NULL) {
+ pm_printf(PM_LOG_ERROR, _("config file %s, line %d: All directives must belong to a section.\n"),
file, linenum);
return(1);
}
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index fde5c737..56837fa2 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -155,8 +155,7 @@ int pacman_remove(alpm_list_t *targets)
list_display(_("Targets:"), lst);
FREELIST(lst);
/* get confirmation */
- if(!config->noconfirm
- && yesno(_("\nDo you want to remove these packages? [Y/n] ")) == 0) {
+ if(yesno(_("\nDo you want to remove these packages? [Y/n] ")) == 0) {
remove_cleanup();
FREELIST(finaltargs);
return(1);