public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 5/6] classes/dpkg: Properly update packages in the cache
Date: Tue, 29 Aug 2017 10:20:41 +0300	[thread overview]
Message-ID: <218c4e50-fd72-ba3f-fedb-110802137574@ilbers.de> (raw)
In-Reply-To: <20170828173233.010d4b0b@md1em3qc>

> This is another fixup of 1/6, fold it in.
> 

It's a good question if we want to keep development history. Because 
these patches reflect the real history of binary caching development.

> 
> Am Sun, 27 Aug 2017 18:13:38 +0300
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 
>> From: Frank Lenormand <lenormf@gmail.com>
>>
>> Before installing to cache, existing packages with the same name and
>> version have to be removed.
>>
>> Signed-off-by: Frank Lenormand <lenormf@gmail.com>
>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>> ---
>>   meta/classes/dpkg.bbclass | 46
>> +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43
>> insertions(+), 3 deletions(-)
>>
>> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
>> index 118ba2f..72ae79f 100644
>> --- a/meta/classes/dpkg.bbclass
>> +++ b/meta/classes/dpkg.bbclass
>> @@ -84,12 +84,52 @@ do_install_to_cache() {
>>               > "${DIR_CACHE}/conf/distributions"
>>       fi
>>   
>> +    print_field_value() {
>> +        awk "\$1 == \"${1}:\" { print \$2; }"
>> +    }
>> +
>> +    call_reprepro() {
>> +        reprepro --waitforlock 3 -b "${DIR_CACHE}" --dbdir
>> "${DIR_DB}" \
>> +            -C main "$@"
>> +    }
>> +
>>       # Add binary and source packages to the deb cache
>>       # If the cache doesn't exist yet, it will be created using the
>>       # `distributions` file generated above.
>> -    ls -1 "${BUILDROOT}"/*.deb "${BUILDROOT}"/*.dsc | while read -r
>> p; do
>> -        reprepro --waitforlock 3 -b "${DIR_CACHE}" --dbdir
>> "${DIR_DB}" \
>> -            -C main "include${p##*.}" "${DEBDISTRONAME}" "${p}"
>> +    ls -1 "${BUILDROOT}"/*.deb | while read -r p; do
>> +        name_package=$(dpkg -f "${p}" | print_field_value "Package")
>> +        version_package=$(dpkg -f "${p}" | print_field_value
>> "Version") +
>> +        # Remove all packages with the same version that were added
>> to the
>> +        # repository in previous builds
>> +        call_reprepro \
>> +            -A "${DISTRO_ARCH}" \
>> +            removefilter "${DEBDISTRONAME}" \
>> +            "Package (== ${name_package}), \
>> +            Version (== ${version_package})"
>> +        call_reprepro \
>> +            -A "${DISTRO_ARCH}" \
>> +            "include${p##*.}" \
>> +            "${DEBDISTRONAME}" \
>> +            "${p}"
>> +    done
>> +
>> +    ls -1 "${BUILDROOT}"/*.dsc | while read -r p; do
>> +        name_package=$(cat "${p}" | print_field_value "Source")
>> +        version_package=$(cat "${p}" | print_field_value "Version")
>> +
>> +        # Remove all source packages with the same version that were
>> added to
>> +        # the repository in previous builds
>> +        call_reprepro \
>> +            -A "source" \
>> +            removefilter "${DEBDISTRONAME}" \
>> +            "Package (== ${name_package}), \
>> +            Version (== ${version_package})"
>> +        call_reprepro \
>> +            -A "source" \
>> +            "include${p##*.}" \
>> +            "${DEBDISTRONAME}" \
>> +            "${p}"
>>       done
>>   }
>>   
> 

  reply	other threads:[~2017-08-29  7:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-27 15:13 [PATCH 0/6] Isar apt cache implementation Alexander Smirnov
2017-08-27 15:13 ` [PATCH 1/6] meta-isar-bin: Enable caching of deb packages Alexander Smirnov
2017-08-28 15:18   ` Henning Schild
2017-08-29  6:40     ` Alexander Smirnov
2017-08-29  7:51       ` Henning Schild
2017-08-29  8:20         ` Alexander Smirnov
2017-08-31 10:55     ` Claudius Heine
2017-08-31 11:20       ` Henning Schild
2017-08-31 12:08         ` Claudius Heine
2017-09-06 14:21   ` Henning Schild
2017-09-07 11:13     ` Claudius Heine
2017-08-27 15:13 ` [PATCH 2/6] classes/image: Provide /dev/null for Stretch apt Alexander Smirnov
2017-08-28 15:20   ` Henning Schild
2017-08-28 15:26     ` Henning Schild
2017-08-27 15:13 ` [PATCH 3/6] classes/dpkg: Split install for cache Alexander Smirnov
2017-08-28  8:00   ` Claudius Heine
2017-08-29  7:18     ` Alexander Smirnov
2017-08-30  8:54       ` Claudius Heine
2017-08-28 15:30   ` Henning Schild
2017-08-27 15:13 ` [PATCH 4/6] meta-isar-bin: Enable apt repo generation for amd64 Alexander Smirnov
2017-08-27 15:13 ` [PATCH 5/6] classes/dpkg: Properly update packages in the cache Alexander Smirnov
2017-08-28 15:32   ` Henning Schild
2017-08-29  7:20     ` Alexander Smirnov [this message]
2017-08-29  7:57       ` Henning Schild
2017-08-29 11:26         ` Jan Kiszka
2017-08-27 15:13 ` [PATCH 6/6] doc/technical_overview: Describe binary cache Alexander Smirnov
2017-08-28 15:36   ` Henning Schild
2017-08-29  7:29     ` Alexander Smirnov
2017-08-29  8:06       ` Henning Schild
2017-08-29 11:29     ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=218c4e50-fd72-ba3f-fedb-110802137574@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox