summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNathan Jones <nathanj@insightbb.com>2007-11-12 22:54:50 +0100
committerDan McGee <dan@archlinux.org>2007-11-13 07:13:21 +0100
commitc29209e7b6555b140794ffb6907fbd33f0d0aa88 (patch)
tree63e8f027832b633b174be7c007f816432923a9db /scripts
parent103c3ac5a789dc0ec9855c18800a0616940351b1 (diff)
downloadpacman-c29209e7b6555b140794ffb6907fbd33f0d0aa88.tar.gz
pacman-c29209e7b6555b140794ffb6907fbd33f0d0aa88.tar.xz
repo-add: Ensure only adding package's deltas.
repo-add was adding the delta files of any package that started with the same package name plus a hyphen. In this example, deltatest-libs delta files were added to the deltatest package: $ repo-add deltatest.db.tar.gz deltatest-1.0.2-1-i686.pkg.tar.gz ==> Extracting database to a temporary location... ==> Adding package 'deltatest-1.0.2-1-i686.pkg.tar.gz' -> Removing existing package 'deltatest-1.0.2-1'... -> Creating 'desc' db entry... -> Computing md5 checksums... -> Creating 'depends' db entry... -> Creating 'deltas' db entry... -> Added delta 'deltatest-1.0.2rc3-1_to_1.0.2-1-i686.delta' -> Added delta 'deltatest-libs-1.0.0-1_to_1.0.1-1-i686.delta' ==> Creating updated database file /tmp/deltatest.db.tar.gz Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/repo-add.sh.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 4dfedbe6..adcefc1d 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -218,7 +218,13 @@ db_write_entry()
# create deltas entry if there are delta files
for delta in $startdir/$pkgname-*-*_to_*-*-$arch.delta; do
- if [ -f "$delta" ]; then
+ # This for loop also pulls in all files that start with the current package
+ # name and are followed by a -whatever. For instance, running this loop for
+ # gcc would also grab gcc-libs. To guard against this, compare the package
+ # name of the delta to the current package name.
+ local filename=$(basename "$delta")
+ local dpkgname="$(echo "$filename" | sed -e 's/\(.*\)-.*-.*_to_.*-.*-.*.delta/\1/')"
+ if [ "$pkgname" = "$dpkgname" -a -f "$delta" ]; then
# create deltas file if it does not already exist
if [ ! -f "deltas" ]; then
msg2 "$(gettext "Creating 'deltas' db entry...")"