[arch-dev-public] [arch-dev] [pacman-dev] [PATCH] repo-add: create relative DB symlinks
Dan McGee
dpmcgee at gmail.com
Wed Aug 18 15:07:46 EDT 2010
On Wed, Aug 18, 2010 at 1:57 PM, Pierre Schmitz <pierre at archlinux.de> wrote:
> On Wed, 18 Aug 2010 13:23:16 -0500, Dan McGee <dan at archlinux.org>
> wrote:
>> As noted in FS#20498, if an absolute path is used for specifying the
>> database when invoking repo-add, the symlink generated will point to the
>> absolute path instead of being relative to the directory. Fix this for
>> the two linking cases, but leave the copy untouched so that will still
>> work.
>>
>> Signed-off-by: Dan McGee <dan at archlinux.org>
>> ---
>> scripts/repo-add.sh.in | 5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
>> index 2838f81..283ad07 100644
>> --- a/scripts/repo-add.sh.in
>> +++ b/scripts/repo-add.sh.in
>> @@ -488,8 +488,9 @@ if (( success )); then
>> [[ -f $REPO_DB_FILE ]] && mv -f "$REPO_DB_FILE" "${REPO_DB_FILE}.old"
>> [[ -f $tmpdir/$filename ]] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
>> dblink="${REPO_DB_FILE%.tar.*}"
>> - ln -sf "$REPO_DB_FILE" "$dblink" 2>/dev/null || \
>> - ln -f "$REPO_DB_FILE" "$dblink" 2>/dev/null || \
>> + target=${REPO_DB_FILE##*/}
>> + ln -sf "$target" "$dblink" 2>/dev/null || \
>> + ln -f "$target" "$dblink" 2>/dev/null || \
>> cp "$REPO_DB_FILE" "$dblink"
>> else
>> msg "$(gettext "No packages modified, nothing to do.")"
>
> Maybe we could already apply this on gerolde. ATM we are pushing those
> broken links to the mirrors. (yes, this didn't happen with the old
> dbscripts)
No need for the private list.
And go ahead if you want, but since no program even uses these links
yet, it really isn't a rush at all. It is also going in 3.4.1 which
Allan and I want to release in the next week or so.
-Dan
More information about the arch-dev-public
mailing list