[arch-projects] [archweb] [PATCH] Return different dep types under different keys in JSON results

2017-11-25 Thread Johannes Löthberg via arch-projects
Signed-off-by: Johannes Löthberg 
---
 packages/utils.py | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/packages/utils.py b/packages/utils.py
index 0f47f17..5e533b7 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -478,7 +478,7 @@ class PackageJSONEncoder(DjangoJSONEncoder):
 'installed_size', 'build_date', 'last_update', 'flag_date',
 'maintainers', 'packager']
 pkg_list_attributes = ['groups', 'licenses', 'conflicts',
-'provides', 'replaces', 'depends']
+'provides', 'replaces']
 
 def default(self, obj):
 if hasattr(obj, '__iter__'):
@@ -488,6 +488,10 @@ def default(self, obj):
 data = {attr: getattr(obj, attr) for attr in self.pkg_attributes}
 for attr in self.pkg_list_attributes:
 data[attr] = getattr(obj, attr).all()
+all_deps = obj.depends.all()
+for (deptype, name) in [('D', 'depends'), ('O', 'optdepends'),
+ ('M', 'makedepends'), ('C', 
'checkdepends')]:
+data[name] = all_deps.filter(deptype=deptype)
 return data
 if isinstance(obj, PackageFile):
 filename = obj.filename or ''
-- 
2.15.0


Re: [arch-projects] [devtools] Question about installing runtime dependencies at build time

2017-08-08 Thread Johannes Löthberg via arch-projects
Quoting Emil Velikov via arch-projects (2017-08-08 18:45:20)
> Hello Arch developers,
> 
> After an upstream issue reported by Laurent Carlier (aka lordheavy)
> Istarted wondering why builds fail on his end and not my (Arch)
> machine.
> The key difference seems to be that he's using devtools, whereas I do not.
> 
> After a further chat, I got the impression that devtools installs
> runtime dependencies before/alongside(?) as the PKGBUILD build/install
> target is issued.
> 
> This doesn't sound quite right to me. Shouldn't it be done, only on
> runtime scenarios - say the check target?
> 
> Of course, I could be missing something so if anyone has some pointers
> that will be appreciated.
> 

This is slightly confusingly written, but all packages listed in the 
depends and the makedepends arrays will always be installed before 
building a package.  makedepends should only list packages that are only 
required when building, not all packages required when building

-- 
Sincerely,
  Johannes Löthberg
  PGP Key ID: 0x50FB9B273A9D0BB5
  PGP Key FP: 5134 EF9E AF65 F95B 6BB1  608E 50FB 9B27 3A9D 0BB5
  https://theos.kyriasis.com/~kyrias/


[arch-projects] [dbscripts] [PATCH] config: add GPL3/LGPL3 to ALLOWED_LICENSES

2017-05-30 Thread Johannes Löthberg via arch-projects
Signed-off-by: Johannes Löthberg 
---
 config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config b/config
index 6d76ef3..92cc4a5 100644
--- a/config
+++ b/config
@@ -29,7 +29,7 @@ PKGEXT=".pkg.tar.?z"
 SRCEXT=".src.tar.gz"
 
 # Allowed licenses: get sourceballs only for licenses in this array
-ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1')
+ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'GPL3' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1' 
'LGPL3')
 
 # Override default config with config.local
 LOCAL_CONFIG=${DBSCRIPTS_CONFIG:-"$(dirname ${BASH_SOURCE[0]})/config.local"}
-- 
2.13.0


[arch-projects] [devtools] [PATCH] archbuild/makechrootpkg: Delete var/lib/machines under subvolume

2017-01-28 Thread Johannes Löthberg via arch-projects
Some packages end up creating subvolumes through systemd-tmpfiles, (e.g.
systemd-nspawn,) so we need to delete those as well, but there's no way
to reliably list subvolumes under a certain subvolume relative to the
filesystem, so we need a hard-coded list.

Signed-off-by: Johannes Löthberg 
---
 archbuild.in | 7 ++-
 makechrootpkg.in | 5 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/archbuild.in b/archbuild.in
index 9c5d706..d78ad09 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -54,7 +54,12 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" 
]]; then
lock 9 "$copy.lock" "Locking chroot copy '$copy'"
 
if [[ "$(stat -f -c %T "${copy}")" == btrfs ]]; then
-   { type -P btrfs && btrfs subvolume delete "${copy}"; } 
&>/dev/null
+   if type -P btrfs &>/dev/null; then
+   if [[ -d "$copy/var/lib/machines" ]]; then
+   btrfs subvolume delete 
"$copy/var/lib/machies" &>/dev/null
+   fi
+
+   btrfs subvolume delete "$copy" &>/dev/null
+   fi
fi
rm -rf --one-file-system "${copy}"
done
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 284d444..9612e7d 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -91,6 +91,11 @@ create_chroot() {
stat_busy "Creating clean working copy [$copy]"
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; 
then
if [[ -d $copydir ]]; then
+   if [[ -d "$copydir/var/lib/machines" ]]; then
+   btrfs subvolume delete 
"$copydir/var/lib/machies" &>/dev/null ||
+   die "Unable to delete subvolume 
%s" "$copydir/var/lib/machines"
+   fi
+
btrfs subvolume delete "$copydir" >/dev/null ||
die "Unable to delete subvolume %s" 
"$copydir"
fi
-- 
2.11.0


[arch-projects] [devtools] [PATCH] archbuild/makechrootpkg: Delete sub-subvolumes as well

2017-01-28 Thread Johannes Löthberg via arch-projects
Some packages end up creating subvolumes through systemd-tmpfiles, (e.g.
systemd-nspawn,) so we need to delete those as well.

Signed-off-by: Johannes Löthberg 
---
 archbuild.in | 10 +-
 makechrootpkg.in |  5 +
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/archbuild.in b/archbuild.in
index 9c5d706..159602b 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -54,7 +54,15 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" 
]]; then
lock 9 "$copy.lock" "Locking chroot copy '$copy'"
 
if [[ "$(stat -f -c %T "${copy}")" == btrfs ]]; then
-   { type -P btrfs && btrfs subvolume delete "${copy}"; } 
&>/dev/null
+   # Delete all subvolumes under the copy directory.  This 
is needed
+   # because some things, like systemd-nspawn, end up 
creating a btrfs
+   # subvolume through systemd-tmpfiles.
+   if type -P btrfs &>/dev/null; then
+   btrfs subvolume list --sort=-path -o "$copy" | \
+   sed 's|[^/]*||' | \
+   xargs btrfs subvolume delete &>/dev/null
+
+   btrfs subvolume delete "$copy" &>/dev/null
+   fi
fi
rm -rf --one-file-system "${copy}"
done
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 284d444..b89f33e 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -91,6 +91,11 @@ create_chroot() {
stat_busy "Creating clean working copy [$copy]"
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; 
then
if [[ -d $copydir ]]; then
+   btrfs subvolume list --sort=-path -o "$copydir" 
| \
+   sed 's|[^/]*||' | \
+   xargs btrfs subvolume delete >/dev/null 
||
+   die "Unable to delete 
subvolumes under %s" "$copydir"
+
btrfs subvolume delete "$copydir" >/dev/null ||
die "Unable to delete subvolume %s" 
"$copydir"
fi
-- 
2.11.0


Re: [arch-projects] [archweb][PATCH] Added security tracker into navbar

2017-01-22 Thread Johannes Löthberg via arch-projects

On 20/01, Jelle van der Waa wrote:

On 01/19/17 at 11:28pm, Morten Linderud wrote:

Signed-off-by: Morten Linderud 
---
 web/template/cgit/header.html | 1 +
 web/template/header.php   | 1 +


This patch should go to aur-...@archlinux.org, since it's touching the
AUR and not archweb. Archweb is the django website which is written in
Python :) [1]

[1] https://git.archlinux.org/archweb.git/



(Though the changes should happen in both.)

--
Sincerely,
 Johannes Löthberg
 PGP Key ID: 0x50FB9B273A9D0BB5
 https://theos.kyriasis.com/~kyrias/


signature.asc
Description: PGP signature


[arch-projects] [archweb] [PATCH] Fix auto-adoption

2016-11-10 Thread Johannes Löthberg via arch-projects
Look up the packager using the UserFinder class, and create a
PackageRelation.

Signed-off-by: Johannes Löthberg 
---
 devel/management/commands/reporead.py | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/devel/management/commands/reporead.py 
b/devel/management/commands/reporead.py
index 6e26710..3ebd45c 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -396,10 +396,13 @@ def db_update(archname, reponame, pkgs, force=False):
 with transaction.atomic():
 populate_pkg(dbpkg, pkg, timestamp=timestamp)
 Update.objects.log_update(None, dbpkg)
-prel = PackageRelation(pkgbase=dbpkg.pkgbase,
-   user=dbpkg.packager,
-   type=PackageRelation.MAINTAINER)
-prel.save()
+
+packager = finder.find(pkg.packager)
+if packager:
+prel = PackageRelation(pkgbase=dbpkg.pkgbase,
+   user=packager,
+   type=PackageRelation.MAINTAINER)
+prel.save()
 
 
 except IntegrityError:
-- 
2.10.2


[arch-projects] [archweb] [PATCH] mirrors: api: Add ISOs information to JSON output

2016-08-01 Thread Johannes Löthberg via arch-projects
Signed-off-by: Johannes Löthberg 
---
 mirrors/views/api.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mirrors/views/api.py b/mirrors/views/api.py
index b72585e..581a0d5 100644
--- a/mirrors/views/api.py
+++ b/mirrors/views/api.py
@@ -26,6 +26,7 @@ def default(self, obj):
 country = obj.country
 data['country'] = unicode(country.name)
 data['country_code'] = country.code
+data['isos'] = obj.mirror.isos
 return data
 if isinstance(obj, MirrorProtocol):
 return unicode(obj)
-- 
2.9.2


Re: [arch-projects] [devtools] [PATCH 1/2] makechrootpkg: specify makepkg.conf with -M

2016-07-19 Thread Johannes Löthberg via arch-projects

On 19/07, Alad Wenter wrote:

PKGDEST and other variables can be set in /etc/makepkg.conf and local
correspondents in $HOME, with the file in /etc taking precedence.
Specifying a default makepkg.conf on the command line (similar to
makepkg) allows to change the directory where build products are moved
(move_products), without the need to modify the system configuration
in /etc/makepkg.conf or rely on sudoers policy.



Aah, /etc/makepkg.conf shouldn't take precedence, that's a bug.

--
Sincerely,
 Johannes Löthberg
 PGP Key ID: 0x50FB9B273A9D0BB5
 https://theos.kyriasis.com/~kyrias/


signature.asc
Description: PGP signature


[arch-projects] [devtools] [PATCH v2] makechrootpkg: Use XDG_CONFIG_HOME for makepkg.conf

2016-06-12 Thread Johannes Löthberg via arch-projects
Implemented the same way as in makepkg.

Signed-off-by: Johannes Löthberg 
---
Changes since v1:

Accidentally used $HOME instead of $USER_HOME in the elif statement.

 makechrootpkg.in | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 709e824..6f80384 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -306,7 +306,12 @@ fi
 
 umask 0022
 
-load_vars "$USER_HOME/.makepkg.conf"
+XDG_PACMAN_DIR="${XDG_CONFIG_HOME:-$USER_HOME/.config}/pacman"
+if [[ -r "$XDG_PACMAN_DIR/makepkg.conf" ]]; then
+   load_vars "$XDG_PACMAN_DIR/makepkg.conf"
+elif [[ -r "$USER_HOME/.makepkg.conf" ]]; then
+   load_vars "$USER_HOME/.makepkg.conf"
+fi
 load_vars /etc/makepkg.conf
 
 # Use PKGBUILD directory if these don't exist
-- 
2.8.3


[arch-projects] [devtools] [PATCH] makechrootpkg: Use XDG_CONFIG_HOME for makepkg.conf

2016-06-02 Thread Johannes Löthberg via arch-projects
Implemented the same way as in makepkg.

Signed-off-by: Johannes Löthberg 
---
 makechrootpkg.in | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 709e824..cca3af0 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -306,7 +306,12 @@ fi
 
 umask 0022
 
-load_vars "$USER_HOME/.makepkg.conf"
+XDG_PACMAN_DIR="${XDG_CONFIG_HOME:-$USER_HOME/.config}/pacman"
+if [[ -r "$XDG_PACMAN_DIR/makepkg.conf" ]]; then
+   load_vars "$XDG_PACMAN_DIR/makepkg.conf"
+elif [[ -r "$HOME/.makepkg.conf" ]]; then
+   load_vars "$USER_HOME/.makepkg.conf"
+fi
 load_vars /etc/makepkg.conf
 
 # Use PKGBUILD directory if these don't exist
-- 
2.8.3