Presentazione specialisti ICT-- NewsLetter 08/2018.

2018-12-10 Thread Programs and Projects Consulting Srl
se non visualizza correttamente il messaggio clicchi qui

La selezione del personale informatico non e' mai stata cosi' semplice
Quale lunghissima trafila solitamente seguite per la selezione e 
l'identificazione dei profili informatici da inserire sui progetti? Ora potrete 
dimenticarla! Grazie ai nostri strumenti potete individuare i profili migliori 
ed al miglior prezzo con un solo click !
Consulenza ITC

La Programs & Projects Consulting e' il partner ideale per le aziende.

Proponiamo un'offerta di servizi completa ed integrata, dalla consulenza nella 
progettazione di sistemi informatici custom alla selezione e valorizzazione 
delle risorse umane, alla vendita di sistemi CRM scalabili completamente 
personalizzabili.

Time & Material

Oltre tre lustri di esperienza e professionalita' al vostro servizio.

Disponiamo di una vasta rosa di tecnici altamente specializzati distribuiti su 
tutto il territorio nazionale, adatti ad ogni vostra esigenza. Tutti i 
professionisti sono inquadrati come dipendenti diretti della nostra azienda.

Sviluppo Software

La Programs & Projects Consulting e' il tassello che ti manca.

Qualsiasi sia la vostra attivita', avere un Partner altamente specializzato che 
possa supportarvi dalla fase di progettazione alla messa in produzione, 
equivale a gettare delle solide fondamenta per il proprio futuro aziendale.

I
Via Cesare Brivio, 23 - IT
20158 Milano (MI)
Tel. +39.02.66809530
Fax +39.02.700531632
infomil...@p-pconsulting.com

I
Via Catania, 13 - IT
10093 Collegno (TO)
Tel. +39.02.84.179.298
Fax +39 0110441941
infotor...@p-pconsulting.com

I
C.da Coste Anitra, 8 - IT
83020 Aiello Del Sabato (AV)
Tel. +39.02.84.179.298
Fax. +39 08251681364
infoavell...@p-pconsulting.com

Programs & Projects Consulting S.r.L.
Azienda certificata ISO 9001
P.IVA/C.F. 02236340648 -- REA 144018

Nota Importante:
La P. & P. Consulting nel rispetto della privacy fa presente che se la 
comunicazione in oggetto dovesse risultare non gradita, ci scusiamo vivamente 
precisando in ogni caso che questa newsletter non e' riconducibile a spamming. 
Qualora non si desideri ricevere piu' questo tipo d'informazione clicchi qui.
body{ text-align: center; background: #00ECB9; font-family: sans-serif; 
font-weight: 100; } h1{ color: #396; font-weight: 100; font-size: 40px; margin: 
40px 0px 20px; }  

Re: [arch-projects] [arch-devops] [dbscripts] [PATCH 2/4] Add reproducible archive of packages.

2018-12-05 Thread Florian Pritz via arch-projects
On Tue, Dec 04, 2018 at 01:15:20PM -0500, Eli Schwartz via arch-devops 
 wrote:
> On 12/4/18 1:09 PM, Eli Schwartz wrote:
> > Whenever adding new package files to the pool of distributed packages,
> > hardlink a copy of every package it was built with, into a
> > "reproducible" pool, and log which file required it.
> 
> The question becomes, where can I store these? As-is, this will burden
> the mirror network as well. Unsure how to handle this. Could this be
> configurable by the mirror, as ISOs are now? Should we exclusively
> self-host this, and if so, where?

I'm not a fan of adding this pool to the mirror root for multiple
reasons:

 - Most mirrors would likely want to avoid mirroring it because it can
   become quite large and we told them that we only need around 100GB.
   If everyone wants to exclude it that requires action by every admin.
   Not ideal.

 - I'm not sure if all of our mirrors have hardlink support. We don't
   currently ask for it even though we suggest the -H rsync option. Also
   the current repos use symlinks for the packages instead of hardlinks.
   That said, I'm not even sure if rsync can detect hardlinks across
   directories. It can't even detect renames/moves across directories...

 - I don't expect that we need to mirror it because we don't even get
   that many requests to our current archive. If we ever need to mirror
   it, we can worry about that later I'd say since moving it to the
   mirror root should be rather simple.

I'd suggest to make the base path of the repro pool configurable so that
we can keep it out of the mirror root. For now I'd suggest something
like this:

REPRO_BASE="/srv/reproducible-archive/"
pkgname="foo"
pkgfile="foo-1.0-1.pkg.tar.xz"
dest="$REPRO_BASE/packages/${pkgname:0:1}/$pkgname/$pkgfile"
ln .. "$dest"

Also note that this does intentionally not include $PKGPOOL any more
even though you include it in your patch. The archive doesn't have it
and I don't think it really helps anyone. It will just cause confusion
if packages are moved between repos and it makes using the archive more
difficult because the user would have to check all possible pool names
or know which one to check.

Ideally I'd like to later extend this to also include the current
archive's features and from the looks of it, storing the packages like
this is the first step. Then we just need to copy the repos (dbs and pkg
symlinks) once a day and archive the ISOs.

Also thinking about this, it would be great if we could skip the pkg
symlinks for each day's archive and only copy the db itself. All we'd
need is to have a dedicated PackageServer= setting (like Server=, but
only for packages, not for the database) for pacman to find the
packages, but I'm not sure if Allan would like that. That setting would
also have to support the pkgname substring and the pkgname obviously.

Comments/thoughts/patches/... welcome.

Florian


signature.asc
Description: PGP signature


Re: [arch-projects] [dbscripts] [PATCH 2/4] Add reproducible archive of packages.

2018-12-04 Thread Eli Schwartz via arch-projects
On 12/4/18 1:09 PM, Eli Schwartz wrote:
> Whenever adding new package files to the pool of distributed packages,
> hardlink a copy of every package it was built with, into a
> "reproducible" pool, and log which file required it.

The question becomes, where can I store these? As-is, this will burden
the mirror network as well. Unsure how to handle this. Could this be
configurable by the mirror, as ISOs are now? Should we exclusively
self-host this, and if so, where?

archive.archlinux.org is managed by another service with its own
exclusively writable location.

> Signed-off-by: Eli Schwartz 
> ---
>  config |  1 +
>  config.local.svn-community |  1 +
>  config.local.svn-packages  |  1 +
>  db-functions   | 49 +++---
>  db-update  |  4 
>  5 files changed, 48 insertions(+), 8 deletions(-)
> 
> diff --git a/config b/config
> index 1cfe11f4..5144fca7 100644
> --- a/config
> +++ b/config
> @@ -3,6 +3,7 @@
>  FTP_BASE="/srv/ftp"
>  PKGREPOS=()
>  PKGPOOL=''
> +EXTRA_PKGPOOLS=()
>  SRCPOOL=''
>  TESTING_REPO=''
>  STABLE_REPOS=()
> diff --git a/config.local.svn-community b/config.local.svn-community
> index 5d61b5ea..15bcc17f 100644
> --- a/config.local.svn-community
> +++ b/config.local.svn-community
> @@ -2,6 +2,7 @@
>  
>  PKGREPOS=('community' 'community-testing' 'community-staging' 'multilib' 
> 'multilib-testing' 'multilib-staging')
>  PKGPOOL='pool/community'
> +EXTRA_PKGPOOLS=('pool/packages')
>  SRCPOOL='sources/community'
>  SVNREPO='file:///srv/repos/svn-community/svn'
>  SVNUSER='svn-community'
> diff --git a/config.local.svn-packages b/config.local.svn-packages
> index 34aab35c..75986b65 100644
> --- a/config.local.svn-packages
> +++ b/config.local.svn-packages
> @@ -2,6 +2,7 @@
>  
>  PKGREPOS=('core' 'extra' 'testing' 'staging' 'kde-unstable' 'gnome-unstable')
>  PKGPOOL='pool/packages'
> +EXTRA_PKGPOOLS=('pool/community')
>  SRCPOOL='sources/packages'
>  SVNREPO='file:///srv/repos/svn-packages/svn'
>  SVNUSER='svn-packages'
> diff --git a/db-functions b/db-functions
> index 7aeedced..2b1ae87a 100644
> --- a/db-functions
> +++ b/db-functions
> @@ -165,20 +165,23 @@ repo_unlock () { #repo_unlock  
>   fi
>  }
>  
> +# usage: _grep_all_info pkgfile infofile key
> +_grep_all_info() {
> + local _ret=()
> +
> + mapfile -t _ret < <(/usr/bin/bsdtar -xOqf "$1" "${2}" | grep "^${3} = ")
> +
> + printf '%s\n' "${_ret[@]#${3} = }"
> +}
> +
>  # usage: _grep_pkginfo pkgfile pattern
>  _grep_pkginfo() {
> - local _ret
> -
> - _ret="$(/usr/bin/bsdtar -xOqf "$1" .PKGINFO | grep "^${2} = " | tail 
> -1)"
> - echo "${_ret#${2} = }"
> + _grep_all_info "${1}" .PKGINFO "${2}" | tail -1
>  }
>  
>  # usage: _grep_buildinfo pkgfile pattern
>  _grep_buildinfo() {
> - local _ret
> -
> - _ret="$(/usr/bin/bsdtar -xOqf "$1" .BUILDINFO | grep "^${2} = " | tail 
> -1)"
> - echo "${_ret#${2} = }"
> + _grep_all_info "${1}" .BUILDINFO "${2}" | tail -1
>  }
>  
>  # Get the package base or name as fallback
> @@ -444,4 +447,34 @@ arch_repo_modify() {
>   REPO_MODIFIED=1
>  }
>  
> +# Build an index of dependent packages needed by a given pkgfile
> +# usage: make_reproducible pkgfile [check]
> +make_reproducible() {
> + local pkg dir pkgs=() pkgfile pkgfiles=()
> +
> + mapfile -t pkgs < <(_grep_all_info "${1}" .BUILDINFO installed)
> +
> + for pkg in "${pkgs[@]}"; do
> + for dir in "${FTP_BASE}/${PKGPOOL}" 
> "${EXTRA_PKGPOOLS[@]/#/${FTP_BASE}/}" "${STAGING}"/**/; do
> + if pkgfile="$(getpkgfile "${dir}/${pkg}"${PKGEXTS} 
> 2>/dev/null)"; then
> + pkgfiles+=("${pkgfile}")
> + continue 2
> + fi
> + done
> + error "could not find existing package for %s" "${pkg}"
> + return 1
> + done
> +
> + if [[ ${2} = check ]]; then
> + return 0
> + fi
> +
> + for pkg in "${pkgfiles[@]}"; do
> + if [[ ! -f ${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/} ]]; 
> then
> + ln -L "${pkg}" 
> "${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/}"
> + fi
> + echo "${1}" >> 
> "${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/}.buildlinks"
> + done
> +}
> +
>  . "$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/db-functions-${VCS}"
> diff --git a/db-update b/db-update
> index 313fb999..11ec185f 100755
> --- a/db-update
> +++ b/db-update
> @@ -61,6 +61,9 @@ for repo in "${repos[@]}"; do
>   if ! check_builddir "${pkg}"; then
>   die "Package %s was not built in a chroot" 
> "$repo/${pkg##*/}"
>   fi
> + if ! make_reproducible "${pkg}" "check"; then
> + die "Package %s is not reproducible" "${pkg}"
> + fi
>   done
>   if ! 

[arch-projects] [dbscripts] [PATCH 3/4] ftpdir-cleanup: remove useless loop and make clean_pkg take a targetdir

2018-12-04 Thread Eli Schwartz via arch-projects
This is never ever called for multiple packages at once, and if it was,
it would be named clean_pkgs. Meanwhile, it was implied that this could
take a variable target, but that was never-used code. Make it useful
because we might (will) use it.

Signed-off-by: Eli Schwartz 
---
 cron-jobs/ftpdir-cleanup | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 9df5f99a..74b771cd 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -4,21 +4,19 @@
 . "$(dirname "$(readlink -e "$0")")/../db-functions"
 
 clean_pkg() {
-   local pkg
-   local target
+   local pkg=${1}
+   local targetdir=${2:-${CLEANUP_DESTDIR}}
 
if [[ $CLEANUP_DRYRUN != true ]]; then
-   for pkg in "$@"; do
-   if [[ -h $pkg ]]; then
-   rm -f "$pkg" "$pkg.sig"
-   else
-   mv_acl "$pkg" "$CLEANUP_DESTDIR/${pkg##*/}"
-   if [[ -e $pkg.sig ]]; then
-   mv_acl "$pkg.sig" 
"$CLEANUP_DESTDIR/${pkg##*/}.sig"
-   fi
-   touch "${CLEANUP_DESTDIR}/${pkg##*/}"
+   if [[ -h ${pkg} ]]; then
+   rm -f "${pkg}" "${pkg}.sig"
+   else
+   mv_acl "${pkg}" "${targetdir}/${pkg##*/}"
+   if [[ -e ${pkg}.sig ]]; then
+   mv_acl "${pkg}.sig" 
"${targetdir}/${pkg##*/}.sig"
fi
-   done
+   touch "${targetdir}/${pkg##*/}"
+   fi
fi
 }
 
-- 
2.19.2


[arch-projects] [dbscripts] [PATCH 2/4] Add reproducible archive of packages.

2018-12-04 Thread Eli Schwartz via arch-projects
Whenever adding new package files to the pool of distributed packages,
hardlink a copy of every package it was built with, into a
"reproducible" pool, and log which file required it.

Signed-off-by: Eli Schwartz 
---
 config |  1 +
 config.local.svn-community |  1 +
 config.local.svn-packages  |  1 +
 db-functions   | 49 +++---
 db-update  |  4 
 5 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/config b/config
index 1cfe11f4..5144fca7 100644
--- a/config
+++ b/config
@@ -3,6 +3,7 @@
 FTP_BASE="/srv/ftp"
 PKGREPOS=()
 PKGPOOL=''
+EXTRA_PKGPOOLS=()
 SRCPOOL=''
 TESTING_REPO=''
 STABLE_REPOS=()
diff --git a/config.local.svn-community b/config.local.svn-community
index 5d61b5ea..15bcc17f 100644
--- a/config.local.svn-community
+++ b/config.local.svn-community
@@ -2,6 +2,7 @@
 
 PKGREPOS=('community' 'community-testing' 'community-staging' 'multilib' 
'multilib-testing' 'multilib-staging')
 PKGPOOL='pool/community'
+EXTRA_PKGPOOLS=('pool/packages')
 SRCPOOL='sources/community'
 SVNREPO='file:///srv/repos/svn-community/svn'
 SVNUSER='svn-community'
diff --git a/config.local.svn-packages b/config.local.svn-packages
index 34aab35c..75986b65 100644
--- a/config.local.svn-packages
+++ b/config.local.svn-packages
@@ -2,6 +2,7 @@
 
 PKGREPOS=('core' 'extra' 'testing' 'staging' 'kde-unstable' 'gnome-unstable')
 PKGPOOL='pool/packages'
+EXTRA_PKGPOOLS=('pool/community')
 SRCPOOL='sources/packages'
 SVNREPO='file:///srv/repos/svn-packages/svn'
 SVNUSER='svn-packages'
diff --git a/db-functions b/db-functions
index 7aeedced..2b1ae87a 100644
--- a/db-functions
+++ b/db-functions
@@ -165,20 +165,23 @@ repo_unlock () { #repo_unlock  
fi
 }
 
+# usage: _grep_all_info pkgfile infofile key
+_grep_all_info() {
+   local _ret=()
+
+   mapfile -t _ret < <(/usr/bin/bsdtar -xOqf "$1" "${2}" | grep "^${3} = ")
+
+   printf '%s\n' "${_ret[@]#${3} = }"
+}
+
 # usage: _grep_pkginfo pkgfile pattern
 _grep_pkginfo() {
-   local _ret
-
-   _ret="$(/usr/bin/bsdtar -xOqf "$1" .PKGINFO | grep "^${2} = " | tail 
-1)"
-   echo "${_ret#${2} = }"
+   _grep_all_info "${1}" .PKGINFO "${2}" | tail -1
 }
 
 # usage: _grep_buildinfo pkgfile pattern
 _grep_buildinfo() {
-   local _ret
-
-   _ret="$(/usr/bin/bsdtar -xOqf "$1" .BUILDINFO | grep "^${2} = " | tail 
-1)"
-   echo "${_ret#${2} = }"
+   _grep_all_info "${1}" .BUILDINFO "${2}" | tail -1
 }
 
 # Get the package base or name as fallback
@@ -444,4 +447,34 @@ arch_repo_modify() {
REPO_MODIFIED=1
 }
 
+# Build an index of dependent packages needed by a given pkgfile
+# usage: make_reproducible pkgfile [check]
+make_reproducible() {
+   local pkg dir pkgs=() pkgfile pkgfiles=()
+
+   mapfile -t pkgs < <(_grep_all_info "${1}" .BUILDINFO installed)
+
+   for pkg in "${pkgs[@]}"; do
+   for dir in "${FTP_BASE}/${PKGPOOL}" 
"${EXTRA_PKGPOOLS[@]/#/${FTP_BASE}/}" "${STAGING}"/**/; do
+   if pkgfile="$(getpkgfile "${dir}/${pkg}"${PKGEXTS} 
2>/dev/null)"; then
+   pkgfiles+=("${pkgfile}")
+   continue 2
+   fi
+   done
+   error "could not find existing package for %s" "${pkg}"
+   return 1
+   done
+
+   if [[ ${2} = check ]]; then
+   return 0
+   fi
+
+   for pkg in "${pkgfiles[@]}"; do
+   if [[ ! -f ${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/} ]]; 
then
+   ln -L "${pkg}" 
"${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/}"
+   fi
+   echo "${1}" >> 
"${FTP_BASE}/${PKGPOOL}-reproducible/${pkg##*/}.buildlinks"
+   done
+}
+
 . "$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/db-functions-${VCS}"
diff --git a/db-update b/db-update
index 313fb999..11ec185f 100755
--- a/db-update
+++ b/db-update
@@ -61,6 +61,9 @@ for repo in "${repos[@]}"; do
if ! check_builddir "${pkg}"; then
die "Package %s was not built in a chroot" 
"$repo/${pkg##*/}"
fi
+   if ! make_reproducible "${pkg}" "check"; then
+   die "Package %s is not reproducible" "${pkg}"
+   fi
done
if ! check_splitpkgs "${repo}" "${pkgs[@]}"; then
die "Missing split packages for %s" "$repo"
@@ -82,6 +85,7 @@ for repo in "${repos[@]}"; do
# any packages might have been moved by the previous run
if [[ -f ${pkg} ]]; then
mv "${pkg}" "$FTP_BASE/${PKGPOOL}"
+   make_reproducible 
"${FTP_BASE}/${PKGPOOL}${pkg##*/}"
fi
ln -s "../../../${PKGPOOL}/${pkgfile}" 
"$FTP_BASE/$repo/os/${pkgarch}"

[arch-projects] [dbscripts] [PATCH 4/4] ftpdir-cleanup: handle removal of reproducible archives as well

2018-12-04 Thread Eli Schwartz via arch-projects
This reuses the same logic used for normally deleting packages, but
cleanup of the reproducible archive happens in a subdirectory of
${CLEANUP_DESTDIR} while still subject to the same timeouts.

Signed-off-by: Eli Schwartz 
---
 cron-jobs/ftpdir-cleanup | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 74b771cd..87af2486 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -58,6 +58,7 @@ for repo in "${PKGREPOS[@]}"; do
for old_pkg in "${old_pkgs[@]}"; do
msg2 '%s' "${old_pkg}"
clean_pkg 
"${FTP_BASE}/${repo}/os/${arch}/${old_pkg}"
+   find "${FTP_BASE}/${PKGPOOL}-reproducible/" 
-name "*.buildlinks" -exec sed -i "/${old_pkg%${PKGEXTS}}/d" {} +
done
fi
done
@@ -79,20 +80,29 @@ if (( ${#old_pkgs[@]} >= 1 )); then
done
 fi
 
+mapfile -td '' old_reproducible_pkgs < <(find 
"${FTP_BASE}/${PKGPOOL}-reproducible/" -name '*.buildlinks' -empty -printf 
'%f\0')
+if (( ${#old_reproducible_pkgs[@]} >= 1 )); then
+   msg "Removing old packages from reproducible pool..."
+   for old_pkg in "${old_reproducible_pkgs[@]}"; do
+   msg2 '%s' "${old_pkg}"
+   clean_pkg "${FTP_BASE}/${PKGPOOL}-reproducible/${old_pkg}" 
"${CLEANUP_DESTDIR}/reproducible"
+   done
+fi
+
 unset old_pkgs
 touch -d "${CLEANUP_KEEP} days ago"  "${WORKDIR}/cleanup_timestamp"
 for f in "${CLEANUP_DESTDIR}"/**/*${PKGEXTS}; do
if [[ ${WORKDIR}/cleanup_timestamp -nt $f ]]; then
-   old_pkgs+=("${f##*/}")
+   old_pkgs+=("${f}")
fi
 done
 if (( ${#old_pkgs[@]} >= 1 )); then
msg "Removing old packages from the cleanup directory..."
for old_pkg in "${old_pkgs[@]}"; do
-   msg2 '%s' "${old_pkg}"
+   msg2 '%s' "${old_pkg#${CLEANUP_DESTDIR}/}"
if [[ $CLEANUP_DRYRUN != true ]]; then
-   rm -f "${CLEANUP_DESTDIR}/${old_pkg}"
-   rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig"
+   rm -f "${old_pkg}"
+   rm -f "${old_pkg}.sig"
fi
done
 fi
-- 
2.19.2


[arch-projects] [dbscripts] [PATCH 1/4] tests: make dummy copies of all pkgpool packages in the test environment

2018-12-04 Thread Eli Schwartz via arch-projects
Prerequisite for reproducible archives of packages.

Signed-off-by: Eli Schwartz 
---
 test/lib/common.bash | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/lib/common.bash b/test/lib/common.bash
index bc2b4e6d..3dda5f62 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -102,6 +102,7 @@ setup() {
SVNREPO="file://${TMP}/svn-packages-repo"
PKGREPOS=('core' 'extra' 'testing')
PKGPOOL='pool/packages'
+   EXTRA_PKGPOOLS=('pool/community')
SRCPOOL='sources/packages'
TESTING_REPO='testing'
STABLE_REPOS=('core' 'extra')
@@ -123,9 +124,18 @@ eot
mkdir -p "${TMP}/ftp/${r}/os/${a}"
done
done
-   mkdir -p "${TMP}/ftp/${PKGPOOL}"
+   mkdir -p "${TMP}/ftp/${PKGPOOL}"{,-reproducible}
+   mkdir -p "${TMP}/ftp/${EXTRA_PKGPOOLS[0]}"
mkdir -p "${TMP}/ftp/${SRCPOOL}"
 
+   # make dummy packages for "reproducibility"
+   comm -12 <(pacman -Sql core extra | sort -u) <(pacman -Qq | sort -u) | 
pacman -Sddp - | while read -r line; do
+   touch "${FTP_BASE}/${PKGPOOL}/${line##*/}"{,.sig}
+   done
+   comm -12 <(pacman -Sql community | sort -u) <(pacman -Qq | sort -u) | 
pacman -Sddp - | while read -r line; do
+   touch "${FTP_BASE}/${EXTRA_PKGPOOLS[0]}/${line##*/}"{,.sig}
+   done
+
svnadmin create "${TMP}/svn-packages-repo"
svn checkout -q "file://${TMP}/svn-packages-repo" 
"${TMP}/svn-packages-copy"
 }
-- 
2.19.2


[arch-projects] [namcap] FS#34300 False positive on Mach-O universal binary

2018-12-03 Thread Michael Straube via arch-projects

Hi,

namcap does not distinguish java class files from Mach-O files since
both use the same byte magic CAFEBABE. See FS#34300

Implementing this would only need a test if the value of the byte at
offset 7 is greater than 0x30.
See: https://github.com/file/file/blob/master/magic/Magdir/cafebabe

I think having Mach-O files in a package is a _very_ rare case.
But on the other hand implementing would be no big deal.

Would a patch for this be accepted, or is it not worth?

Regards,
Michael


Re: [arch-projects] [namcap] [PATCH] namcap-tags: Add back missing dependency reason tags (FS#56898)

2018-12-03 Thread Michael Straube via arch-projects

Am 02.12.18 um 20:34 schrieb Eli Schwartz via arch-projects:

On 12/2/18 1:33 PM, Michael Straube via arch-projects wrote:

There are two missing tags that are needed in rules added (back) in
commit e385ac93a354 (Restore and refactor accidentally removed tests).
Add back the missing tags.

Signed-off-by: Michael Straube 
---
  namcap-tags | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/namcap-tags b/namcap-tags
index 17b9506..70dabb2 100644
--- a/namcap-tags
+++ b/namcap-tags
@@ -101,6 +101,8 @@ depends-by-namcap-sight depends=(%s) :: Depends as namcap 
sees them: depends=(%s
  dconf-needed-for-glib-schemas :: needed for glib schemas
  glib2-needed-for-gio-modules :: needed for GIO modules
  hicolor-icon-theme-needed-for-hicolor-dir :: needed for hicolor theme 
hierarchy
+shared-mime-info-needed :: needed for update-mime-database
+desktop-file-utils-needed :: needed for update-desktop-database
  kdebase-runtime-needed %s :: needed for programs %s
  java-runtime-needed %s :: found class files %s
  libraries-needed %s %s :: libraries %s needed in files %s


Huh, why do these tests even exist? The fact that we have hooks for them
now, means that we never need to run either command at all. Applications
that need a desktop or mime database will already depend on the relevant
package, and packages that merely happen to be a provider of such files
should not care whether or not you have other applications that can make
use of them.

We don't even need to use NeedsTargets, so it doesn't matter when the
hook runs. It can be run in the future at any time.



I was also wondering and do not know why these tests were added (back).
 


Re: [arch-projects] [namcap] [PATCH] namcap-tags: Add back missing dependency reason tags (FS#56898)

2018-12-02 Thread Eli Schwartz via arch-projects
On 12/2/18 1:33 PM, Michael Straube via arch-projects wrote:
> There are two missing tags that are needed in rules added (back) in
> commit e385ac93a354 (Restore and refactor accidentally removed tests).
> Add back the missing tags.
> 
> Signed-off-by: Michael Straube 
> ---
>  namcap-tags | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/namcap-tags b/namcap-tags
> index 17b9506..70dabb2 100644
> --- a/namcap-tags
> +++ b/namcap-tags
> @@ -101,6 +101,8 @@ depends-by-namcap-sight depends=(%s) :: Depends as namcap 
> sees them: depends=(%s
>  dconf-needed-for-glib-schemas :: needed for glib schemas
>  glib2-needed-for-gio-modules :: needed for GIO modules
>  hicolor-icon-theme-needed-for-hicolor-dir :: needed for hicolor theme 
> hierarchy
> +shared-mime-info-needed :: needed for update-mime-database
> +desktop-file-utils-needed :: needed for update-desktop-database
>  kdebase-runtime-needed %s :: needed for programs %s
>  java-runtime-needed %s :: found class files %s
>  libraries-needed %s %s :: libraries %s needed in files %s

Huh, why do these tests even exist? The fact that we have hooks for them
now, means that we never need to run either command at all. Applications
that need a desktop or mime database will already depend on the relevant
package, and packages that merely happen to be a provider of such files
should not care whether or not you have other applications that can make
use of them.

We don't even need to use NeedsTargets, so it doesn't matter when the
hook runs. It can be run in the future at any time.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [dbscripts] [PATCH 1/3] testing2x: be more generic and accept multiple testing repos

2018-12-02 Thread Eli Schwartz via arch-projects
Currently multilib is a second-class citizen the way it is lumped into
community, and dbscripts cannot even keep track of whether it
constitutes a testing repo. Teach config to track both testing and
staging repos just like the stable ones, and teach testing2x to search
through TESTING_REPOS to determine which one it is operating on.

Signed-off-by: Eli Schwartz 
---
 config |  3 ++-
 config.local.svn-community |  3 ++-
 config.local.svn-packages  |  3 ++-
 test/lib/common.bash   |  3 ++-
 testing2x  | 26 --
 5 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/config b/config
index 1cfe11f4..4c76558b 100644
--- a/config
+++ b/config
@@ -4,7 +4,8 @@ FTP_BASE="/srv/ftp"
 PKGREPOS=()
 PKGPOOL=''
 SRCPOOL=''
-TESTING_REPO=''
+STAGING_REPOS=()
+TESTING_REPOS=()
 STABLE_REPOS=()
 
 # VCS backend
diff --git a/config.local.svn-community b/config.local.svn-community
index 5d61b5ea..493f34e3 100644
--- a/config.local.svn-community
+++ b/config.local.svn-community
@@ -5,7 +5,8 @@ PKGPOOL='pool/community'
 SRCPOOL='sources/community'
 SVNREPO='file:///srv/repos/svn-community/svn'
 SVNUSER='svn-community'
-TESTING_REPO='community-testing'
+STAGING_REPOS=('community-staging' 'multilib-staging')
+TESTING_REPOS=('community-testing' 'multilib-testing')
 STABLE_REPOS=('community')
 
 CLEANUP_DESTDIR="/srv/repos/svn-community/package-cleanup"
diff --git a/config.local.svn-packages b/config.local.svn-packages
index 34aab35c..567d002e 100644
--- a/config.local.svn-packages
+++ b/config.local.svn-packages
@@ -5,7 +5,8 @@ PKGPOOL='pool/packages'
 SRCPOOL='sources/packages'
 SVNREPO='file:///srv/repos/svn-packages/svn'
 SVNUSER='svn-packages'
-TESTING_REPO='testing'
+STAGING_REPOS=('staging')
+TESTING_REPOS=('testing')
 STABLE_REPOS=('core' 'extra')
 
 CLEANUP_DESTDIR="/srv/repos/svn-packages/package-cleanup"
diff --git a/test/lib/common.bash b/test/lib/common.bash
index bc2b4e6d..a92a01ee 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -103,7 +103,8 @@ setup() {
PKGREPOS=('core' 'extra' 'testing')
PKGPOOL='pool/packages'
SRCPOOL='sources/packages'
-   TESTING_REPO='testing'
+   STAGING_REPOS=('staging')
+   TESTING_REPOS=('testing')
STABLE_REPOS=('core' 'extra')
CLEANUP_DESTDIR="${TMP}/package-cleanup"
SOURCE_CLEANUP_DESTDIR="${TMP}/source-cleanup"
diff --git a/testing2x b/testing2x
index 14970a9f..215be39c 100755
--- a/testing2x
+++ b/testing2x
@@ -10,7 +10,7 @@ fi
 
 # Lock everything to reduce  possibility of interfering task between the 
different repo-updates
 script_lock
-for repo in "${TESTING_REPO}" "${STABLE_REPOS[@]}"; do
+for repo in "${TESTING_REPOS[@]}" "${STABLE_REPOS[@]}"; do
for pkgarch in "${ARCHES[@]}"; do
repo_lock "${repo}" "${pkgarch}" || exit 1
done
@@ -18,30 +18,36 @@ done
 
 declare -A pkgs
 
+testing_repo=
 for pkgbase in "$@"; do
for pkgarch in "${ARCHES[@]}"; do
-   vcsrepo_from="$(find_repo_for_package "${pkgbase}" 
"${pkgarch[@]}" "${TESTING_REPO}")"
+   vcsrepo_from="$(find_repo_for_package "${pkgbase}" 
"${pkgarch[@]}" "${TESTING_REPOS[@]}")"
vcsrepo_to="$(find_repo_for_package "${pkgbase}" 
"${pkgarch[@]}" "${STABLE_REPOS[@]}")"
+   repo_from=${vcsrepo_from%-@(any|${pkgarch})}
+   repo_to="${vcsrepo_to%-@(any|${pkgarch})}"
 
+   if [[ -z ${testing_repo} ]]; then
+   testing_repo=${repo_from}
+   elif [[ ${testing_repo} != ${repo_from} ]]; then
+   die "Cannot move packages from multiple repos at a 
time: %s" "${testing_repo} ${repo_from}"
+   fi
if [[ ${vcsrepo_from} && ${vcsrepo_to} ]]; then
-   move_to="${vcsrepo_to%-@(any|${pkgarch})}"
-   pkgs[${move_to}]+="${pkgbase} "
+   pkgs[${repo_to}]+="${pkgbase} "
break
fi
done
-   [[ ${vcsrepo_from} ]] || die "%s not found in [%s]" "$pkgbase" 
"$TESTING_REPO"
+   [[ ${vcsrepo_from} ]] || die "%s not found in any of these repos: %s" 
"${pkgbase}" "${TESTING_REPOS[@]}"
[[ ${vcsrepo_to} ]] || die "%s not found in any of these repos: %s" 
"$pkgbase" "${STABLE_REPOS[*]}"
 done
 
-for pkgarch in "${ARCHES[@]}"; do
-   repo_unlock "${TESTING_REPO}" "${pkgarch}"
-done
-for repo in "${STABLE_REPOS[@]}"; do
+for repo in "${TESTING_REPOS[@]}" "${STABLE_REPOS[@]}"; do
for pkgarch in "${ARCHES[@]}"; do
repo_unlock "${repo}" "${pkgarch}"
done
+done
+for repo in "${STABLE_REPOS[@]}"; do
if [[ -n ${pkgs[${repo}]} ]]; then
-   "$(dirname "$(readlink -e "$0")")/db-move" "${TESTING_REPO}" 
"${repo}" ${pkgs[${repo}]}
+   "$(dirname "$(readlink -e "$0")")/db-move" "${testing_repo}" 
"${repo}" ${pkgs[${repo}]}
fi
 done
 
-- 
2.19.2


[arch-projects] [dbscripts] [PATCH 2/3] db-update: die when trying to update a package without updating a pending rebuild

2018-12-02 Thread Eli Schwartz via arch-projects
A semi-common pattern is for one maintainer to stage a rebuild of a
package due to e.g. cascading repository-wide python/boost/whatever
rebuilds, and then for the original maintainer of the package to not
notice and update the package in the stable repo, leaving an out of date
rebuild in staging or testing.

Then the the out of date package gets moved and ends up breaking things,
possibly via a package downgrade, possibly via breaking compatibility
with a much more targeted rebuild uploaded all at once. Ultimately,
Things Happen™ and the repository hierarchy gets broken.

Prevent this by enforcing for all packages that exist in
multiple levels of the repo: staging -> testing -> stable

That updates to one must come with an update to all the others.

Signed-off-by: Eli Schwartz 
---
 db-functions  | 21 +
 db-update |  5 +
 test/cases/db-update.bats | 13 +
 3 files changed, 39 insertions(+)

diff --git a/db-functions b/db-functions
index 7aeedced..b47ad570 100644
--- a/db-functions
+++ b/db-functions
@@ -374,6 +374,27 @@ check_pkgrepos() {
return 0
 }
 
+check_stagingrepos() {
+   local pkgfile=${1}
+   local pkgrepo=${2}
+   local pkgname=$(getpkgname "${pkgfile}")
+   local pkgarch=$(getpkgarch "${pkgfile}")
+   local candidate
+
+   if in_array "${pkgrepo}" "${STABLE_REPOS[@]}"; then
+   candidate=$(find_repo_for_package "${pkgname}" "${pkgarch}" 
"${TESTING_REPOS[@]}") || return 0
+   elif in_array "${pkgrepo}" "${TESTING_REPOS}"; then
+   candidate=$(find_repo_for_package "${pkgname}" "${pkgarch}" 
"${STAGING_REPOS[@]}") || return 0
+   fi
+
+   printf '%s\n' "${candidate%-*}"
+   for candidate in "${STAGING}/${candidate%-*}"/*${PKGEXTS}; do
+   [[ ${pkgname} = $(getpkgname "${candidate}" 2>/dev/null) ]] && 
return 0
+   done
+
+   return 1
+}
+
 #usage: chk_license ${license[@]}"
 chk_license() {
local l
diff --git a/db-update b/db-update
index 313fb999..f07a8a45 100755
--- a/db-update
+++ b/db-update
@@ -52,6 +52,11 @@ for repo in "${repos[@]}"; do
if ! check_pkgrepos "${pkg}"; then
die "Package %s already exists in another 
repository" "$repo/${pkg##*/}"
fi
+   set -x
+   if ! missing_repo="$(check_stagingrepos "${pkg}" 
"${repo}")"; then
+   die "Package %s in %s needs to be updated in 
unstable repos as well: %s" "${pkg}" "${repo}" "${missing_repo}"
+   fi
+   set +x
if ! check_packager "${pkg}"; then
die "Package %s does not have a valid packager" 
"$repo/${pkg##*/}"
fi
diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats
index 9ee06321..f2e7fcab 100644
--- a/test/cases/db-update.bats
+++ b/test/cases/db-update.bats
@@ -87,6 +87,19 @@ load ../lib/common
checkPackage testing pkg-any-a 1-2
 }
 
+@test "update any package to stable repo without updating testing package 
fails" {
+   releasePackage extra pkg-any-a
+   db-update
+   updatePackage pkg-any-a
+   releasePackage testing pkg-any-a
+   db-update
+   updatePackage pkg-any-a
+   releasePackage extra pkg-any-a
+
+   run db-update
+   [ "$status" -ne 0 ]
+}
+
 @test "update same any package to same repository fails" {
releasePackage extra pkg-any-a
db-update
-- 
2.19.2


[arch-projects] [namcap] [PATCH] namcap-tags: Add back missing dependency reason tags (FS#56898)

2018-12-02 Thread Michael Straube via arch-projects
There are two missing tags that are needed in rules added (back) in
commit e385ac93a354 (Restore and refactor accidentally removed tests).
Add back the missing tags.

Signed-off-by: Michael Straube 
---
 namcap-tags | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/namcap-tags b/namcap-tags
index 17b9506..70dabb2 100644
--- a/namcap-tags
+++ b/namcap-tags
@@ -101,6 +101,8 @@ depends-by-namcap-sight depends=(%s) :: Depends as namcap 
sees them: depends=(%s
 dconf-needed-for-glib-schemas :: needed for glib schemas
 glib2-needed-for-gio-modules :: needed for GIO modules
 hicolor-icon-theme-needed-for-hicolor-dir :: needed for hicolor theme hierarchy
+shared-mime-info-needed :: needed for update-mime-database
+desktop-file-utils-needed :: needed for update-desktop-database
 kdebase-runtime-needed %s :: needed for programs %s
 java-runtime-needed %s :: found class files %s
 libraries-needed %s %s :: libraries %s needed in files %s
-- 
2.19.2


[arch-projects] [namcap] [PATCH v3] makedepends: Make VCS matching more robust

2018-12-02 Thread Michael Straube via arch-projects
If a VCS source is renamed using the "::" syntax the makedepends are not
detected. If there are files starting with  in the source
array false positives are produced. See the gitlab package for example. Make
the matching more robust to avoid such issues.

Signed-off-by: Michael Straube 
---
v1 -> v2
Make it also work for e.g. git://

v2 -> v3
Return early if no vcs sources.

 Namcap/rules/makedepends.py   | 15 ---
 Namcap/tests/pkgbuild/test_makedepends.py | 15 +++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index 2a0ceaa..53676c2 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -54,10 +54,19 @@ class VCSMakedepends(PkgbuildRule):
'svn' : 'subversion',
}
missing = []
+   protocols = set()
 
-   for v in vcs:
-   if not any(s.startswith(v) for s in pkginfo["source"]):
-   continue
+   for s in pkginfo["source"]:
+   p = s.split("::", 1)[-1]
+   p = p.split("://", 1)[0]
+   p = p.split("+", 1)[0]
+   if p in vcs:
+   protocols.add(p)
+
+   if not protocols:
+   return
+
+   for v in protocols:
d = vcs[v]
if 'makedepends' not in pkginfo:
missing.append(d)
diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
b/Namcap/tests/pkgbuild/test_makedepends.py
index 78c476a..d443b2b 100644
--- a/Namcap/tests/pkgbuild/test_makedepends.py
+++ b/Namcap/tests/pkgbuild/test_makedepends.py
@@ -76,10 +76,10 @@ depends=()
 makedepends=()
 license=('GPL')
 options=('!libtool')
-source=(bzr+https://ftp.example.com/pub/mypackage
-git+https://ftp.example.com/pub/mypackage
-hg+https://ftp.example.com/pub/mypackage
-svn+https://ftp.example.com/pub/mypackage)
+source=(name::bzr+https://example.com/pub/mypackage
+name::git://example.com/pub/mypackage
+hg+https://example.com/pub/mypackage
+svn://example.com/pub/mypackage)
 md5sums=('abcdefabcdef12345678901234567890')
 
 build() {
@@ -104,4 +104,11 @@ package() {
set(("missing-vcs-makedeps %s", i) for i in makedeps))
self.assertEqual(r.infos, [])
 
+   def test_example2(self):
+   # Example 2
+   r = self.run_on_pkg(self.pkgbuild1 + 'source=(gitsomething)')
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [])
+   self.assertEqual(r.infos, [])
+
 # vim: set ts=4 sw=4 noet:
-- 
2.19.2


[arch-projects] [namcap] [PATCH v2] makedepends: Make VCS matching more robust

2018-12-02 Thread Michael Straube via arch-projects
If a VCS source is renamed using the "::" syntax the makedepends are not
detected. If there are files starting with  in the source
array false positives are produced. See the gitlab package for example. Make
the matching more robust to avoid such issues.

Signed-off-by: Michael Straube 
---
v1 -> v2
Make it also work for e.g. git://

 Namcap/rules/makedepends.py   | 10 +-
 Namcap/tests/pkgbuild/test_makedepends.py | 15 +++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index 2a0ceaa..65747c4 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -54,9 +54,17 @@ class VCSMakedepends(PkgbuildRule):
'svn' : 'subversion',
}
missing = []
+   protocols = set()
+
+   for s in pkginfo["source"]:
+   p = s.split("::", 1)[-1]
+   p = p.split("://", 1)[0]
+   p = p.split("+", 1)[0]
+   if p in vcs:
+   protocols.add(p)
 
for v in vcs:
-   if not any(s.startswith(v) for s in pkginfo["source"]):
+   if not v in protocols:
continue
d = vcs[v]
if 'makedepends' not in pkginfo:
diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
b/Namcap/tests/pkgbuild/test_makedepends.py
index 78c476a..d443b2b 100644
--- a/Namcap/tests/pkgbuild/test_makedepends.py
+++ b/Namcap/tests/pkgbuild/test_makedepends.py
@@ -76,10 +76,10 @@ depends=()
 makedepends=()
 license=('GPL')
 options=('!libtool')
-source=(bzr+https://ftp.example.com/pub/mypackage
-git+https://ftp.example.com/pub/mypackage
-hg+https://ftp.example.com/pub/mypackage
-svn+https://ftp.example.com/pub/mypackage)
+source=(name::bzr+https://example.com/pub/mypackage
+name::git://example.com/pub/mypackage
+hg+https://example.com/pub/mypackage
+svn://example.com/pub/mypackage)
 md5sums=('abcdefabcdef12345678901234567890')
 
 build() {
@@ -104,4 +104,11 @@ package() {
set(("missing-vcs-makedeps %s", i) for i in makedeps))
self.assertEqual(r.infos, [])
 
+   def test_example2(self):
+   # Example 2
+   r = self.run_on_pkg(self.pkgbuild1 + 'source=(gitsomething)')
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [])
+   self.assertEqual(r.infos, [])
+
 # vim: set ts=4 sw=4 noet:
-- 
2.19.2


Re: [arch-projects] [namcap] [PATCH] makedepends: Make VCS matching more robust

2018-12-02 Thread Michael Straube via arch-projects

Am 02.12.18 um 06:04 schrieb Eli Schwartz via arch-projects:

On 12/1/18 9:54 AM, Michael Straube via arch-projects wrote:

If a VCS source is renamed using the "::" syntax the makedepends are not
detected. If there are files starting with  in the source
array false positives are produced. See the gitlab package for example. Make
the matching more robust to avoid such issues.

Signed-off-by: Michael Straube 
---
Perhaps there is a more elegant way?

  Namcap/rules/makedepends.py   | 2 +-
  Namcap/tests/pkgbuild/test_makedepends.py | 9 -
  2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index 2a0ceaa..710e969 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -56,7 +56,7 @@ class VCSMakedepends(PkgbuildRule):
missing = []
  
  		for v in vcs:

-   if not any(s.startswith(v) for s in pkginfo["source"]):
+   if not any(s.split("::")[-1].startswith(v + '+') for s in 
pkginfo["source"]):


Instead this fails to detect git:// instead?

The check makepkg uses is to strip ::* and then strip ://* to get the
protocol, and match on protocols like git*, although I have pending
patches to also strip +* and match protocols exactly.



Ah yes, I will send a v2 that also works for things like git://.
Thank you!


Re: [arch-projects] [namcap] [PATCH] makedepends: Make VCS matching more robust

2018-12-01 Thread Eli Schwartz via arch-projects
On 12/1/18 9:54 AM, Michael Straube via arch-projects wrote:
> If a VCS source is renamed using the "::" syntax the makedepends are not
> detected. If there are files starting with  in the source
> array false positives are produced. See the gitlab package for example. Make
> the matching more robust to avoid such issues.
> 
> Signed-off-by: Michael Straube 
> ---
> Perhaps there is a more elegant way?
> 
>  Namcap/rules/makedepends.py   | 2 +-
>  Namcap/tests/pkgbuild/test_makedepends.py | 9 -
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
> index 2a0ceaa..710e969 100644
> --- a/Namcap/rules/makedepends.py
> +++ b/Namcap/rules/makedepends.py
> @@ -56,7 +56,7 @@ class VCSMakedepends(PkgbuildRule):
>   missing = []
>  
>   for v in vcs:
> - if not any(s.startswith(v) for s in pkginfo["source"]):
> + if not any(s.split("::")[-1].startswith(v + '+') for s 
> in pkginfo["source"]):

Instead this fails to detect git:// instead?

The check makepkg uses is to strip ::* and then strip ://* to get the
protocol, and match on protocols like git*, although I have pending
patches to also strip +* and match protocols exactly.

>   continue
>   d = vcs[v]
>   if 'makedepends' not in pkginfo:
> diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
> b/Namcap/tests/pkgbuild/test_makedepends.py
> index 78c476a..0309016 100644
> --- a/Namcap/tests/pkgbuild/test_makedepends.py
> +++ b/Namcap/tests/pkgbuild/test_makedepends.py
> @@ -77,7 +77,7 @@ makedepends=()
>  license=('GPL')
>  options=('!libtool')
>  source=(bzr+https://ftp.example.com/pub/mypackage
> -git+https://ftp.example.com/pub/mypackage
> +some_name::git+https://ftp.example.com/pub/mypackage
>  hg+https://ftp.example.com/pub/mypackage
>  svn+https://ftp.example.com/pub/mypackage)
>  md5sums=('abcdefabcdef12345678901234567890')
> @@ -104,4 +104,11 @@ package() {
>   set(("missing-vcs-makedeps %s", i) for i in makedeps))
>   self.assertEqual(r.infos, [])
>  
> + def test_example2(self):
> + # Example 2
> + r = self.run_on_pkg(self.pkgbuild1 + 'source=(gitsomething)')
> + self.assertEqual(r.errors, [])
> + self.assertEqual(r.warnings, [])
> + self.assertEqual(r.infos, [])
> +
>  # vim: set ts=4 sw=4 noet:
> 


-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [namcap] [PATCH] makedepends: Make VCS matching more robust

2018-12-01 Thread Michael Straube via arch-projects
If a VCS source is renamed using the "::" syntax the makedepends are not
detected. If there are files starting with  in the source
array false positives are produced. See the gitlab package for example. Make
the matching more robust to avoid such issues.

Signed-off-by: Michael Straube 
---
Perhaps there is a more elegant way?

 Namcap/rules/makedepends.py   | 2 +-
 Namcap/tests/pkgbuild/test_makedepends.py | 9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index 2a0ceaa..710e969 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -56,7 +56,7 @@ class VCSMakedepends(PkgbuildRule):
missing = []
 
for v in vcs:
-   if not any(s.startswith(v) for s in pkginfo["source"]):
+   if not any(s.split("::")[-1].startswith(v + '+') for s 
in pkginfo["source"]):
continue
d = vcs[v]
if 'makedepends' not in pkginfo:
diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
b/Namcap/tests/pkgbuild/test_makedepends.py
index 78c476a..0309016 100644
--- a/Namcap/tests/pkgbuild/test_makedepends.py
+++ b/Namcap/tests/pkgbuild/test_makedepends.py
@@ -77,7 +77,7 @@ makedepends=()
 license=('GPL')
 options=('!libtool')
 source=(bzr+https://ftp.example.com/pub/mypackage
-git+https://ftp.example.com/pub/mypackage
+some_name::git+https://ftp.example.com/pub/mypackage
 hg+https://ftp.example.com/pub/mypackage
 svn+https://ftp.example.com/pub/mypackage)
 md5sums=('abcdefabcdef12345678901234567890')
@@ -104,4 +104,11 @@ package() {
set(("missing-vcs-makedeps %s", i) for i in makedeps))
self.assertEqual(r.infos, [])
 
+   def test_example2(self):
+   # Example 2
+   r = self.run_on_pkg(self.pkgbuild1 + 'source=(gitsomething)')
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [])
+   self.assertEqual(r.infos, [])
+
 # vim: set ts=4 sw=4 noet:
-- 
2.19.2


[arch-projects] [namcap] [PATCH v2 2/3] Add test for the makedepends rule

2018-11-25 Thread Michael Straube via arch-projects
Signed-off-by: Michael Straube 
---
 Namcap/tests/pkgbuild/test_makedepends.py | 65 +++
 1 file changed, 65 insertions(+)
 create mode 100644 Namcap/tests/pkgbuild/test_makedepends.py

diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
b/Namcap/tests/pkgbuild/test_makedepends.py
new file mode 100644
index 000..c8d6e97
--- /dev/null
+++ b/Namcap/tests/pkgbuild/test_makedepends.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+#
+# namcap tests - makedepends
+# Copyright (C) 2011 Rémy Oudompheng 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+#   USA
+#
+
+from Namcap.tests.pkgbuild_test import PkgbuildTest
+import Namcap.rules.makedepends as module
+
+class NamcapRedundantMakedependsTest(PkgbuildTest):
+   pkgbuild1 = """
+# Maintainer: Arch Linux 
+# Contributor: Arch Linux 
+
+pkgname=mypackage
+pkgver=1.0
+pkgrel=1
+pkgdesc="A package"
+url="http://www.example.com/;
+arch=('i686' 'x86_64')
+depends=('lib1' 'lib2' 'lib3')
+makedepends=('lib1' 'lib2' 'lib4')
+license=('GPL')
+options=('!libtool')
+source=(ftp://ftp.example.com/pub/mypackage-0.1.tar.gz)
+md5sums=('abcdefabcdef12345678901234567890')
+
+build() {
+  true
+}
+
+package() {
+  true
+}
+"""
+
+   test_valid = PkgbuildTest.valid_tests
+
+   def preSetUp(self):
+   self.rule = module.RedundantMakedepends
+
+   def test_example1(self):
+   # Example 1
+   r = self.run_on_pkg(self.pkgbuild1)
+   self.assertEqual(r.errors, [])
+   self.assertEqual(set(r.warnings),
+   set(("redundant-makedep %s", i) for i in ["lib1" 
,"lib2"]))
+   self.assertEqual(r.infos, [])
+
+# vim: set ts=4 sw=4 noet:
-- 
2.19.2


[arch-projects] [namcap] [PATCH v2 1/3] Warn about makedepends already in depends

2018-11-25 Thread Michael Straube via arch-projects
Add a rule that warns about make dependencies already listed as
dependencies.

Signed-off-by: Michael Straube 
---
v1 -> v2
Added patch that implements FS#58303
Warn about missing VCS make dependencies.

 Namcap/rules/__init__.py|  1 +
 Namcap/rules/makedepends.py | 41 +
 namcap-tags |  1 +
 3 files changed, 43 insertions(+)
 create mode 100644 Namcap/rules/makedepends.py

diff --git a/Namcap/rules/__init__.py b/Namcap/rules/__init__.py
index e8775a0..dcc950f 100644
--- a/Namcap/rules/__init__.py
+++ b/Namcap/rules/__init__.py
@@ -59,6 +59,7 @@ from . import (
   carch,
   extravars,
   invalidstartdir,
+  makedepends,
   makepkgfunctions,
   missingvars,
   pkginfo,
diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
new file mode 100644
index 000..48b1049
--- /dev/null
+++ b/Namcap/rules/makedepends.py
@@ -0,0 +1,41 @@
+#
+# namcap rules - makedepends
+# Copyright (C) 2018 Michael Straube 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+from Namcap.ruleclass import *
+
+class RedundantMakedepends(PkgbuildRule):
+   """
+   This rule checks for make dependencies that are already
+   included as dependencies.
+   """
+   name = "makedepends"
+   description = "Check for redundant make dependencies"
+
+   def analyze(self, pkginfo, pkgbuild):
+   redundant_makedeps = []
+
+   if 'makedepends' in pkginfo and 'depends' in pkginfo:
+   for d in pkginfo["makedepends"]:
+   if d in pkginfo["depends"]:
+   redundant_makedeps.append(d)
+
+   for i in redundant_makedeps:
+   self.warnings.append(("redundant-makedep %s", i))
+
+# vim: set ts=4 sw=4 noet:
diff --git a/namcap-tags b/namcap-tags
index 2133c45..c253042 100644
--- a/namcap-tags
+++ b/namcap-tags
@@ -71,6 +71,7 @@ potential-non-fhs-man-page %s :: Potential non-FHS man page 
(%s) found.
 py-mtime-mtree-warning :: Found .py file unnoticeably newer than associated 
.pyc/pyo.
 py-mtime-tar-error :: Found .py file newer than associated .pyc/pyo.
 py-mtime-file-name %s :: Python script (%s) is newer than associated .pyc/pyo.
+redundant-makedep %s :: Make dependency (%s) already included as dependency
 script-link-detected %s in %s :: Script link detected (%s) in file %s
 scrollkeeper-dir-exists %s :: Scrollkeeper directory exists (%s). Remember to 
not run scrollkeeper till post_{install,upgrade,remove}.
 site-ruby :: Found usr/lib/ruby/site_ruby in package, usr/lib/ruby/vendor_ruby 
should be used instead.
-- 
2.19.2


Re: Disable JDBC query timeout

2018-11-21 Thread Heitor Projects - Jose
Thanks for all the help and advice, everyone. I don't know how to file a 
feature-request for jMeter, so will ask if a contributing developer would 
kindly do so. The change seems very simple to implement, so I will download the 
jMeter source, make the change and (hopefully) be able to create a custom build 
for my own use in the interim. Many thanks, Jose Heitor  On Wed, 21 Nov 
2018 12:42:25 +0200 Bruno Antunes  wrote  
Analysing source code on JMeter, 
(http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java?view=markup)
 , the timeout is always passed to the Driver. As commented we should fill an 
issue in order to request that feature. I don't see we should not not have that 
kind of configuration; not setting and using defaults from drivers should be 
valid. In arguments for  timeout value should be >= 0; the 0 means there is no 
limit: 
https://docs.oracle.com/javase/10/docs/api/java/sql/Statement.html#setQueryTimeout(int)
 In source code on Apache Ignite JDBC Driver 
(https://apacheignite-sql.readme.io/docs/jdbc-driver) we can see that setting a 
query timeout not supported: 
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java
 On Tue, 20 Nov 2018 at 17:54, Deepak Shetty  wrote: -- 
Bruno Antunes Java Software Engineer Hi as far as I can tell there isn't a way 
to do this (Short of downloading and modifying the source code)- You will have 
to raise an enhancmeent  for JMeter (https://jmeter.apache.org/issues.html ) 
AbstractJDBCTestElement.java in source code can be modified if you want to use 
-1 or equivalent to represent no timeout and not call the timeout method Can 
you also post your complete stack trace top verify ? regards deepak On Tue, Nov 
20, 2018 at 4:57 AM Heitor Projects - Jose < j...@heitorprojects.com> wrote: > 
How to disable JDBC request query timeout (for database drivers that do > not 
support this feature...eg. Apache Ignite)? [Sampler result] Thread > Name: 
Thread Group 1-1 Sample Start: 2018-11-20 14:41:38 SAST Load time: > 761 
Connect Time: 761 Latency: 0 Size in bytes: 31 Sent bytes:0 Headers > size in 
bytes: 0 Body size in bytes: 31 Sample Count: 1 Error Count: 1 Data > type 
("text"|"bin"|""): text Response code: null 0 Response message: > 
java.sql.SQLFeatureNotSupportedException: Query timeout is not supported. > 
Thanks, Jose

[arch-projects] [namcap] [PATCH] Add test for systemdlocation rule

2018-11-21 Thread Michael Straube via arch-projects
Signed-off-by: Michael Straube 
---
 Namcap/tests/package/test_systemdlocation.py | 85 
 1 file changed, 85 insertions(+)
 create mode 100644 Namcap/tests/package/test_systemdlocation.py

diff --git a/Namcap/tests/package/test_systemdlocation.py 
b/Namcap/tests/package/test_systemdlocation.py
new file mode 100644
index 000..c22dd5d
--- /dev/null
+++ b/Namcap/tests/package/test_systemdlocation.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+#
+# namcap tests - systemdlocation
+# Copyright (C) 2011 Rémy Oudompheng 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+#   USA
+#
+
+import os
+from Namcap.tests.makepkg import MakepkgTest
+import Namcap.rules.systemdlocation
+
+class SystemdlocationTest(MakepkgTest):
+   pkgbuild = """
+pkgname=__namcap_test_systemdlocation
+pkgver=1.0
+pkgrel=1
+pkgdesc="A package"
+arch=('i686' 'x86_64')
+url="http://www.example.com/;
+license=('GPL')
+depends=('glibc')
+source=()
+build() {
+  true
+}
+package() {
+  mkdir -p "${pkgdir}/etc/systemd/system"
+  touch "${pkgdir}/etc/systemd/system/systemdsomething"
+}
+"""
+   def test_systemdlocation_pkgname(self):
+   pkgfile = "systemd-1.0-1-%(arch)s.pkg.tar" % { "arch": 
self.arch }
+   with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f:
+   f.write(self.pkgbuild + "pkgname=systemd")
+   self.run_makepkg()
+   pkg, r = self.run_rule_on_tarball(
+   os.path.join(self.tmpdir, pkgfile),
+   Namcap.rules.systemdlocation.systemdlocationRule
+   )
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [])
+   self.assertEqual(r.infos, [])
+
+   def test_systemdlocation_provides(self):
+   pkgfile = 
"__namcap_test_systemdlocation-1.0-1-%(arch)s.pkg.tar" % { "arch": self.arch }
+   with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f:
+   f.write(self.pkgbuild + "provides=(systemd)")
+   self.run_makepkg()
+   pkg, r = self.run_rule_on_tarball(
+   os.path.join(self.tmpdir, pkgfile),
+   Namcap.rules.systemdlocation.systemdlocationRule
+   )
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [])
+   self.assertEqual(r.infos, [])
+
+   def test_systemdlocation(self):
+   pkgfile = 
"__namcap_test_systemdlocation-1.0-1-%(arch)s.pkg.tar" % { "arch": self.arch }
+   with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f:
+   f.write(self.pkgbuild)
+   self.run_makepkg()
+   pkg, r = self.run_rule_on_tarball(
+   os.path.join(self.tmpdir, pkgfile),
+   Namcap.rules.systemdlocation.systemdlocationRule
+   )
+   self.assertEqual(r.errors, [])
+   self.assertEqual(r.warnings, [("systemd-location %s",
+   "etc/systemd/system/systemdsomething")])
+   self.assertEqual(r.infos, [])
+
+# vim: set ts=4 sw=4 noet:
-- 
2.19.1


Disable JDBC query timeout

2018-11-20 Thread Heitor Projects - Jose
How to disable JDBC request query timeout (for database drivers that do not 
support this feature...eg. Apache Ignite)? [Sampler result] Thread Name: Thread 
Group 1-1 Sample Start: 2018-11-20 14:41:38 SAST Load time: 761 Connect Time: 
761 Latency: 0 Size in bytes: 31 Sent bytes:0 Headers size in bytes: 0 Body 
size in bytes: 31 Sample Count: 1 Error Count: 1 Data type ("text"|"bin"|""): 
text Response code: null 0 Response message: 
java.sql.SQLFeatureNotSupportedException: Query timeout is not supported. 
Thanks, Jose

[arch-projects] [netctl] [GIT] Network control utility based on systemd annotated tag 1.19 created. 1.19

2018-11-15 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The annotated tag, 1.19 has been created
at  3c62e2c301346e968113520d09d12d6fc50846f9 (tag)
   tagging  e0014041ad40c9385bb2c38aad2acae3c93eb512 (commit)
  replaces  1.18
 tagged by  Jouke Witteveen
on  Thu Nov 15 19:43:20 2018 +0100

- Log -
Release 1.19
-BEGIN PGP SIGNATURE-

iQFKBAABCAA0FiEEbql9KtO+F66lkufaVrYfv4JJLBUFAlvtvlAWHGoud2l0dGV2
ZWVuQGdtYWlsLmNvbQAKCRBWth+/gkksFW2LCADI8l2HTUJHAZOqetzzMf43SpTb
LFOLO59iIVA/Dz4lcaj9RruEom/hCglc9ZWkdYXQ6i5o83fRZf09JVior77Q1QpQ
ghikQ86MpKooHWvwyNZeqXg4IxF2ZRHAuUgvQGze2RBf6Bi48MxvvJQG3t3gKhcW
cviCL2c++ucsiZo8+KLD+5FBYPQ80UWQi/S2dcB0KBivbqbgHTigJyYMVWqkL0IH
7YiLfobxtTpZXHLuP8dwtQctWYcZCmzyz7PbtuzTjeCgxix1n3MMqFbtPrOwd/sw
0/TiOQ+rQ+No8561gnWGNGg0V3To+LVp0qxiAtJH3pIM3BX+SY3pnhZCAKaJ
=xJBp
-END PGP SIGNATURE-

Christoph Hoopmann (1):
  mobile_ppp: do not try to determine the local IP from the hostname

Jouke Witteveen (2):
  Support removable devices in automatic connections
  1.19 release updates

---


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl] [GIT] Network control utility based on systemd branch master updated. 1.18-3-ge001404

2018-11-15 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The branch, master has been updated
   via  e0014041ad40c9385bb2c38aad2acae3c93eb512 (commit)
   via  d511899a3763c07420aa91b106354c8265c6e989 (commit)
   via  f13c69f1136a9b03138744b53b368807029cbb2c (commit)
  from  9044d45d9d25c585f666e51f47da5559b165c837 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit e0014041ad40c9385bb2c38aad2acae3c93eb512
Author: Jouke Witteveen 
Date:   Thu Nov 15 19:43:00 2018 +0100

1.19 release updates

commit d511899a3763c07420aa91b106354c8265c6e989
Author: Jouke Witteveen 
Date:   Sun Nov 11 17:18:55 2018 +0100

Support removable devices in automatic connections

commit f13c69f1136a9b03138744b53b368807029cbb2c
Author: Christoph Hoopmann 
Date:   Wed Oct 17 10:20:52 2018 +0200

mobile_ppp: do not try to determine the local IP from the hostname

Signed-off-by: Christoph Hoopmann 

---

Summary of changes:
 Makefile | 2 +-
 NEWS | 4 
 services/netctl-auto@.service| 3 ++-
 services/netctl-ifplugd@.service | 3 ++-
 src/lib/connections/mobile_ppp   | 1 +
 5 files changed, 10 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl][PATCH] Support removable devices in automatic connections

2018-11-11 Thread Jouke Witteveen via arch-projects
---
 services/netctl-auto@.service| 3 ++-
 services/netctl-ifplugd@.service | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/services/netctl-auto@.service b/services/netctl-auto@.service
index 3e41744..aacf65c 100644
--- a/services/netctl-auto@.service
+++ b/services/netctl-auto@.service
@@ -1,6 +1,7 @@
 [Unit]
 Description=Automatic wireless network connection using netctl profiles
 Documentation=man:netctl.special(7)
+Requisite=multi-user.target
 BindsTo=sys-subsystem-net-devices-%i.device
 After=sys-subsystem-net-devices-%i.device network-pre.target
 Before=network.target
@@ -14,4 +15,4 @@ ExecStop=/usr/bin/netctl-auto stop %I
 ExecStopPost=/usr/bin/netctl-auto clean %I
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=sys-subsystem-net-devices-%i.device
diff --git a/services/netctl-ifplugd@.service b/services/netctl-ifplugd@.service
index 76993b9..82fd9c0 100644
--- a/services/netctl-ifplugd@.service
+++ b/services/netctl-ifplugd@.service
@@ -1,6 +1,7 @@
 [Unit]
 Description=Automatic wired network connection using netctl profiles
 Documentation=man:netctl.special(7)
+Requisite=multi-user.target
 BindsTo=sys-subsystem-net-devices-%i.device
 After=sys-subsystem-net-devices-%i.device network-pre.target
 
@@ -9,4 +10,4 @@ NotifyAccess=all
 ExecStart=/usr/bin/ifplugd -i %I -r /etc/ifplugd/netctl.action -bfIns
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=sys-subsystem-net-devices-%i.device
-- 
2.19.1


[arch-projects] [namcap] [PATCH] Add test for makepkgfunctions rule

2018-11-02 Thread Michael Straube via arch-projects
Signed-off-by: Michael Straube 
---
 .../tests/pkgbuild/test_makepkgfunctions.py   | 67 +++
 1 file changed, 67 insertions(+)
 create mode 100644 Namcap/tests/pkgbuild/test_makepkgfunctions.py

diff --git a/Namcap/tests/pkgbuild/test_makepkgfunctions.py 
b/Namcap/tests/pkgbuild/test_makepkgfunctions.py
new file mode 100644
index 000..ac2601c
--- /dev/null
+++ b/Namcap/tests/pkgbuild/test_makepkgfunctions.py
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+#
+# namcap tests - makepkgfunctions
+# Copyright (C) 2011 Rémy Oudompheng 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+#   USA
+#
+
+from Namcap.tests.pkgbuild_test import PkgbuildTest
+import Namcap.rules.makepkgfunctions as module
+
+class NamcapMakepkgfunctionsTest(PkgbuildTest):
+   pkgbuild1 = """
+# Maintainer: Arch Linux 
+# Contributor: Arch Linux 
+
+pkgname=mypackage
+pkgver=1.0
+pkgrel=1
+pkgdesc="A package"
+arch=('i686' 'x86_64')
+url="http://www.example.com/;
+license=('GPL')
+depends=('glibc')
+options=('!libtool')
+source=(ftp://ftp.example.com/pub/mypackage-0.1.tar.gz)
+md5sums=('abcdefabcdef12345678901234567890')
+
+build() {
+  msg "some text"
+  msg2 "some text"
+  warning "some text"
+  error "some text"
+  plain "some text"
+}
+
+package() {
+  true
+}
+"""
+   test_valid = PkgbuildTest.valid_tests
+
+   def preSetUp(self):
+   self.rule = module.package
+
+   def test_example1(self):
+   bad_calls = ['msg', 'msg2', 'warning', 'error', 'plain']
+   r = self.run_on_pkg(self.pkgbuild1)
+   self.assertEqual(r.errors, [])
+   self.assertEqual(set(r.warnings),
+   set(("makepkg-function-used %s", i) for i in bad_calls))
+   self.assertEqual(r.infos, [])
+
+# vim: set ts=4 sw=4 noet:
-- 
2.19.1


[arch-projects] [namcap] [PATCH 1/2] Warn about makedepends already in depends

2018-10-31 Thread Michael Straube via arch-projects
Add a rule that warns about make dependencies already listed as
dependencies.

Signed-off-by: Michael Straube 
---
 Namcap/rules/__init__.py|  1 +
 Namcap/rules/makedepends.py | 41 +
 namcap-tags |  1 +
 3 files changed, 43 insertions(+)
 create mode 100644 Namcap/rules/makedepends.py

diff --git a/Namcap/rules/__init__.py b/Namcap/rules/__init__.py
index e8775a0..dcc950f 100644
--- a/Namcap/rules/__init__.py
+++ b/Namcap/rules/__init__.py
@@ -59,6 +59,7 @@ from . import (
   carch,
   extravars,
   invalidstartdir,
+  makedepends,
   makepkgfunctions,
   missingvars,
   pkginfo,
diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
new file mode 100644
index 000..48b1049
--- /dev/null
+++ b/Namcap/rules/makedepends.py
@@ -0,0 +1,41 @@
+#
+# namcap rules - makedepends
+# Copyright (C) 2018 Michael Straube 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+from Namcap.ruleclass import *
+
+class RedundantMakedepends(PkgbuildRule):
+   """
+   This rule checks for make dependencies that are already
+   included as dependencies.
+   """
+   name = "makedepends"
+   description = "Check for redundant make dependencies"
+
+   def analyze(self, pkginfo, pkgbuild):
+   redundant_makedeps = []
+
+   if 'makedepends' in pkginfo and 'depends' in pkginfo:
+   for d in pkginfo["makedepends"]:
+   if d in pkginfo["depends"]:
+   redundant_makedeps.append(d)
+
+   for i in redundant_makedeps:
+   self.warnings.append(("redundant-makedep %s", i))
+
+# vim: set ts=4 sw=4 noet:
diff --git a/namcap-tags b/namcap-tags
index 2133c45..c253042 100644
--- a/namcap-tags
+++ b/namcap-tags
@@ -71,6 +71,7 @@ potential-non-fhs-man-page %s :: Potential non-FHS man page 
(%s) found.
 py-mtime-mtree-warning :: Found .py file unnoticeably newer than associated 
.pyc/pyo.
 py-mtime-tar-error :: Found .py file newer than associated .pyc/pyo.
 py-mtime-file-name %s :: Python script (%s) is newer than associated .pyc/pyo.
+redundant-makedep %s :: Make dependency (%s) already included as dependency
 script-link-detected %s in %s :: Script link detected (%s) in file %s
 scrollkeeper-dir-exists %s :: Scrollkeeper directory exists (%s). Remember to 
not run scrollkeeper till post_{install,upgrade,remove}.
 site-ruby :: Found usr/lib/ruby/site_ruby in package, usr/lib/ruby/vendor_ruby 
should be used instead.
-- 
2.19.1


[arch-projects] [namcap] [PATCH 2/2] Add test for the makedepends rule

2018-10-31 Thread Michael Straube via arch-projects
Signed-off-by: Michael Straube 
---
 Namcap/tests/pkgbuild/test_makedepends.py | 65 +++
 1 file changed, 65 insertions(+)
 create mode 100644 Namcap/tests/pkgbuild/test_makedepends.py

diff --git a/Namcap/tests/pkgbuild/test_makedepends.py 
b/Namcap/tests/pkgbuild/test_makedepends.py
new file mode 100644
index 000..c8d6e97
--- /dev/null
+++ b/Namcap/tests/pkgbuild/test_makedepends.py
@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+#
+# namcap tests - makedepends
+# Copyright (C) 2011 Rémy Oudompheng 
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+#   USA
+#
+
+from Namcap.tests.pkgbuild_test import PkgbuildTest
+import Namcap.rules.makedepends as module
+
+class NamcapRedundantMakedependsTest(PkgbuildTest):
+   pkgbuild1 = """
+# Maintainer: Arch Linux 
+# Contributor: Arch Linux 
+
+pkgname=mypackage
+pkgver=1.0
+pkgrel=1
+pkgdesc="A package"
+url="http://www.example.com/;
+arch=('i686' 'x86_64')
+depends=('lib1' 'lib2' 'lib3')
+makedepends=('lib1' 'lib2' 'lib4')
+license=('GPL')
+options=('!libtool')
+source=(ftp://ftp.example.com/pub/mypackage-0.1.tar.gz)
+md5sums=('abcdefabcdef12345678901234567890')
+
+build() {
+  true
+}
+
+package() {
+  true
+}
+"""
+
+   test_valid = PkgbuildTest.valid_tests
+
+   def preSetUp(self):
+   self.rule = module.RedundantMakedepends
+
+   def test_example1(self):
+   # Example 1
+   r = self.run_on_pkg(self.pkgbuild1)
+   self.assertEqual(r.errors, [])
+   self.assertEqual(set(r.warnings),
+   set(("redundant-makedep %s", i) for i in ["lib1" 
,"lib2"]))
+   self.assertEqual(r.infos, [])
+
+# vim: set ts=4 sw=4 noet:
-- 
2.19.1


[arch-projects] [namcap] [PATCH] parsepkgbuild.sh: fix detection of split pkgbuilds with empty pkgbase

2018-10-31 Thread Michael Straube via arch-projects
For split pkgbuilds the pkgbase variable is optional. If not specified,
the first element in the pkgname array is used. Currently parsepkgbuild.sh
fails to detect split pkgbuilds if pkgbase is not specified. Therefore the
split pkgbuild rules are not applied to such pkgbuilds.

Instead of testing if pkgbase is set, test if the pkgname array has more
than one element. If so, set pkgbase accordingly.

Signed-off-by: Michael Straube 
---
 parsepkgbuild.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/parsepkgbuild.sh b/parsepkgbuild.sh
index a158d1e..d85574d 100644
--- a/parsepkgbuild.sh
+++ b/parsepkgbuild.sh
@@ -140,7 +140,8 @@ compgen -A variable
 }
 
 # is it a split pkgbuild ?
-if [ -n "${pkgbase}" ]; then
+if [ "${#pkgname[@]}" -gt 1 ]; then
+   pkgbase=${pkgbase:-${pkgname[0]}}
_namcap_pkgnames=(${pkgname[@]})
unset pkgname
echo -e "%SPLIT%\n1\n"
-- 
2.19.1


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag 25 created. 25

2018-10-16 Thread Dave Reisner via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, 25 has been created
at  c381320560a8ebc2b9b80d3686cb93e3dd067d62 (tag)
   tagging  a3cb799a8f63186b843db6a57da12d74a9320686 (commit)
  replaces  v24
 tagged by  Dave Reisner
on  Tue Oct 16 12:57:50 2018 -0400

- Log -
tag as v25
-BEGIN PGP SIGNATURE-

iQFLBAABCAA1FiEESH6swIVXrQggiNq6HrJjj/VsDFMFAlvGGI4XHGRyZWlzbmVy
QGFyY2hsaW51eC5vcmcACgkQHrJjj/VsDFOJKwgAti10wWG0Fk7fC8VFAcEKPo8k
IZ+7EfRbZFtTxPUT6PKVZeZxDM1Ibj1HZ2CgDT57ZTNDRn4RH9+W5mjiNJGSvX11
0u+NKJViPAD+IPuAjJQBr5ZnRByctbNUNgfDOtoQ1eHN0SJrnfxzinOBEn0sUARC
am7SKTiLcvyPDV/bD5ljAwNXDMSoIbhQHAr4VCMmJADULWusHIqcF5e+pXmi4z6S
WXAxXsKSM3qU9H2Clo9y/qZcQhA+/xqVyTd7gsSm8ZZIBLRJzaI0bkvA+Ss5TNS+
i++qfD8ZFOMGus56Olg5fkbp2ULqAAp5LLchadTY1sI6+7WywoHLfds+LiqjUQ==
=FDmL
-END PGP SIGNATURE-

Dave Reisner (7):
  Restore addition of modules from config file
  lsinitcpio: Attempt to estimate only decompression time
  PKGBUILD: fix upstream URL
  cleanup some shellcheck lint warnings
  Remove install hook aliases for block and keyboard
  ship /var/run as symlink to /run
  install/block: avoid conditional addition of drivers

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20180603-12-g549fe00

2018-10-16 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  549fe0017f44031b24fb5322726721b95cca395b (commit)
   via  1bf2b35e8d6574e507853102c5d4b464ff767956 (commit)
  from  61c9cc6f44e654a90a12da11be06e707e3f4b162 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 549fe0017f44031b24fb5322726721b95cca395b
Author: Luke Shumaker 
Date:   Sun Jul 15 01:19:54 2018 -0400

test: Resolve "TODO: Does not fail if one arch is missing"

 - Implement the TODO by keeping a list/set of architectures found via
   "$repo-$arch" directory names, and another list/set of architectures
   named in arch=() in the PKGBUILD(s).  This means turning the simple
   `compgen` in to a loop.

 - While we're at it loading PKGBUILDs in a loop, fix that it clearly
   isn't doing anything with the $pkgver argument; it should verify that
   the version in the found PKGBUILD(s) matches that argument.

 - Use extglob to more strictly match the "arch" part of the "repo-arch"
   dirname; the existing glob wouldn't have behaved correctly for values
   of $repo containing a "-" (like "community-testing").  We don't
   currently test with any of those, but it makes me nervous.

 - Also make that extglob change in checkRemovedPackage.  While we're at
   it, let Bash do the glob expansion normally and check it with
   __isGlobfile, instead of compgen; it means we don't have to worry about
   escaping the non-glob part of the string.  Not that we expect it to
   contain anything needing escaping, but again, it makes me nervous.

commit 1bf2b35e8d6574e507853102c5d4b464ff767956
Author: Luke Shumaker 
Date:   Sun Jul 15 22:47:19 2018 -0400

test: db-remove: Verify that it accepts pkgname (in addition to pkgbase)

It is important that db-remove be able to remove a single pkgname, without
being able to look it up by pkgbase in SVN.  For instance, when a split
package update removes one of its members; there will be no reference to
the removed pkgname in SVN, and it won't be removed by db-update.  If
db-remove doesn't accept pkgnames, then this outdated orphan could not be
removed.

---

Summary of changes:
 test/cases/db-remove.bats | 19 +++
 test/lib/common.bash  | 27 ---
 2 files changed, 43 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Official repo DB scripts


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20180603-10-g61c9cc6

2018-10-16 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  61c9cc6f44e654a90a12da11be06e707e3f4b162 (commit)
   via  13e5708b65c7f8d5f8e9a3de9b2b6776fbcaacc4 (commit)
   via  37a493d3037b98e77fc949af4a808a8203d7f9f3 (commit)
   via  d6b48bd61eaaa3db4aef8e63fcd35f8c31645e21 (commit)
  from  971181bf94d5e86bd7fce41303b51d1b3befc85b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 61c9cc6f44e654a90a12da11be06e707e3f4b162
Author: Eli Schwartz 
Date:   Sun Oct 7 13:36:55 2018 -0400

Finish the svn refactor by implementing helper functions to write to the VCS

commit 13e5708b65c7f8d5f8e9a3de9b2b6776fbcaacc4
Author: Eli Schwartz 
Date:   Mon Aug 13 11:18:53 2018 -0400

More work on refactoring svn moving into VCS-agnostic routines.

commit 37a493d3037b98e77fc949af4a808a8203d7f9f3
Author: Eli Schwartz 
Date:   Tue Jun 26 16:07:44 2018 -0400

Factor out the exporting of files/folders from svn.

As of the source_pkgbuild rewrite, this is only ever done once.

commit d6b48bd61eaaa3db4aef8e63fcd35f8c31645e21
Author: Eli Schwartz 
Date:   Tue Jun 26 15:11:15 2018 -0400

Preliminary work to break out svn-specific code.

Introduce "db-functions-$VCS" which will eventually contain all
VCS-specific code, and make this configurable in config.

Move private arch_svn function and svn acl handling here, and introduce
a new source_pkgbuild function to handle discovering PKGBUILDs from the
configured VCS and sourcing them to extract metadata.

The PKGBUILD is the only file we ever check out from version control,
and only ever to scrape information from it, except for when we actually
want to db-move a whole directory (which is by necessity considerably
dependent on the VCS in use).

source_pkgbuild is inspired by commits from the dbscripts rewrite,
authored by Florian Pritz 

---

Summary of changes:
 config|   7 +++-
 cron-jobs/sourceballs |   3 +-
 db-functions  |  50 +++-
 db-functions-svn  | 106 ++
 db-move   |  56 +-
 db-remove |  12 +++---
 db-update |   4 +-
 testing2x |  37 ++
 8 files changed, 165 insertions(+), 110 deletions(-)
 create mode 100644 db-functions-svn


hooks/post-receive
-- 
Official repo DB scripts


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v24-7-ga3cb799

2018-10-09 Thread Dave Reisner via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  a3cb799a8f63186b843db6a57da12d74a9320686 (commit)
   via  cfcc53c94d0bd67fc69e06c6c5f52bd801ccbe22 (commit)
   via  c511e624d4f0264d1ee4f32b08b59352d76708e5 (commit)
   via  e2a1189dbd0f3d8c051e2d21b8c8aec9b3b091c7 (commit)
  from  f8cc481e7a4cb33a351308b3f440870fef57fe72 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit a3cb799a8f63186b843db6a57da12d74a9320686
Author: Dave Reisner 
Date:   Mon Oct 8 19:45:11 2018 -0400

install/block: avoid conditional addition of drivers

Avoid over-optimizing autodetect and always add these. This allows
storage drivers to be builtins and still trigger addition of the block
node driver.

commit cfcc53c94d0bd67fc69e06c6c5f52bd801ccbe22
Author: Dave Reisner 
Date:   Thu Mar 29 05:46:08 2018 -0400

ship /var/run as symlink to /run

This might not strictly be strictly needed, but systemd documents it as
being a requirement, else it adds a var-run-bad taint flag.

commit c511e624d4f0264d1ee4f32b08b59352d76708e5
Author: Dave Reisner 
Date:   Sat Dec 30 12:18:40 2017 -0500

Remove install hook aliases for block and keyboard

These have been deprecated since 2012. I think that's enough time for
people to migrate.

commit e2a1189dbd0f3d8c051e2d21b8c8aec9b3b091c7
Author: Dave Reisner 
Date:   Sat Dec 30 12:16:12 2017 -0500

cleanup some shellcheck lint warnings

---

Summary of changes:
 functions|  3 ++-
 install/block| 25 -
 install/fw   |  1 -
 install/mmc  |  1 -
 install/pata |  1 -
 install/sata |  1 -
 install/scsi |  1 -
 install/usb  |  1 -
 install/usbinput |  1 -
 install/virtio   |  1 -
 mkinitcpio   | 24 +++-
 11 files changed, 21 insertions(+), 39 deletions(-)
 delete mode 12 install/fw
 delete mode 12 install/mmc
 delete mode 12 install/pata
 delete mode 12 install/sata
 delete mode 12 install/scsi
 delete mode 12 install/usb
 delete mode 12 install/usbinput
 delete mode 12 install/virtio


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [dbscripts] [PATCH 1/4] Preliminary work to break out svn-specific code.

2018-10-08 Thread Eli Schwartz via arch-projects
Introduce "db-functions-$VCS" which will eventually contain all
VCS-specific code, and make this configurable in config.

Move private arch_svn function and svn acl handling here, and introduce
a new source_pkgbuild function to handle discovering PKGBUILDs from the
configured VCS and sourcing them to extract metadata.

The PKGBUILD is the only file we ever check out from version control,
and only ever to scrape information from it, except for when we actually
want to db-move a whole directory (which is by necessity considerably
dependent on the VCS in use).

source_pkgbuild is inspired by commits from the dbscripts rewrite,
authored by Florian Pritz 

Signed-off-by: Eli Schwartz 
---
 config   |  7 +--
 db-functions | 50 +++-
 db-functions-svn | 27 ++
 db-move  |  5 +++--
 db-remove|  5 ++---
 db-update|  4 ++--
 6 files changed, 54 insertions(+), 44 deletions(-)
 create mode 100644 db-functions-svn

diff --git a/config b/config
index fd79b6ee..1cfe11f4 100644
--- a/config
+++ b/config
@@ -1,14 +1,17 @@
 #!/hint/bash
 
 FTP_BASE="/srv/ftp"
-SVNREPO=''
-SVNUSER=''
 PKGREPOS=()
 PKGPOOL=''
 SRCPOOL=''
 TESTING_REPO=''
 STABLE_REPOS=()
 
+# VCS backend
+VCS=svn
+SVNREPO=''
+SVNUSER=''
+
 CLEANUP_DESTDIR="/var/tmp"
 CLEANUP_DRYRUN=false
 # Time in days to keep moved packages
diff --git a/db-functions b/db-functions
index 6d6084a9..7aeedced 100644
--- a/db-functions
+++ b/db-functions
@@ -39,11 +39,6 @@ mv_acl() {
 
 # set up general environment
 WORKDIR=$(mktemp -dt "${0##*/}.XX")
-if [[ -n ${SVNUSER} ]]; then
-   setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}"
-   setfacl -m d:u:"${USER}":rwx "${WORKDIR}"
-   setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}"
-fi
 LOCKS=()
 REPO_MODIFIED=0
 
@@ -306,27 +301,24 @@ check_pkgfile() {
[[ ${pkgfile##*/} = "${pkgname}-${pkgver}-${pkgarch}"* ]]
 }
 
-check_pkgsvn() {
+# Check that the package file is consistent with the PKGBUILD in version 
control
+check_pkgvcs() {
local pkgfile="${1}"
+   local repo="${2}"
local _pkgbase="$(getpkgbase "${pkgfile}")" || return 1
local _pkgname="$(getpkgname "${pkgfile}")" || return 1
local _pkgver="$(getpkgver "${pkgfile}")" || return 1
local _pkgarch="$(getpkgarch "${pkgfile}")" || return 1
-   local repo="${2}"
 
in_array "${repo}" "${PKGREPOS[@]}" || return 1
 
-   if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase} ]]; then
-   mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
-   arch_svn export -q 
"${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
-   "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" 
>/dev/null || return 1
-   fi
+   local vcsver vcsnames=()
+   read -rd'\n' vcsver vcsnames < <(source_pkgbuild "${_pkgbase}" 
"repos/${repo}-${_pkgarch}"; \
+get_full_version; echo "${pkgname[@]}")
+   read -ra vcsnames <<<"${vcsnames}"
 
-   local svnver="$(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; get_full_version)"
-   [[ "${svnver}" = "${_pkgver}" ]] || return 1
-
-   local svnnames=($(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}"))
-   in_array "${_pkgname}" "${svnnames[@]}" || return 1
+   [[ "${vcsver}" = "${_pkgver}" ]] || return 1
+   in_array "${_pkgname}" "${vcsnames[@]}" || return 1
 
return 0
 }
@@ -337,7 +329,7 @@ check_splitpkgs() {
local pkgfiles=("${@}")
local pkgfile
local pkgdir
-   local svnname
+   local vcsname
 
mkdir -p "${WORKDIR}/check_splitpkgs/"
pushd "${WORKDIR}/check_splitpkgs" >/dev/null
@@ -350,22 +342,16 @@ check_splitpkgs() {
mkdir -p "${repo}/${_pkgarch}/${_pkgbase}"
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
 
-   if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase} 
]]; then
-   mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
-   arch_svn export -q 
"${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
-   
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null || return 1
-   fi
-
-   local svnnames=($(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}"))
-   printf '%s\n' "${svnnames[@]}" >> 
"${repo}/${_pkgarch}/${_pkgbase}/svn"
+   local vcsnames=($(source_pkgbuild "${_pkgbase}" 
"repos/${repo}-${_pkgarch}"; echo "${pkgname[@]}"))
+   printf '%s\n' "${vcsnames[@]}" >> 
"${repo}/${_pkgarch}/${_pkgbase}/vcs"
done
popd >/dev/null
 
for pkgdir in "${WORKDIR}/check_splitpkgs/${repo}"/*/*; do
[[ ! -d ${pkgdir} ]] && continue
sort -u 

[arch-projects] [dbscripts] [PATCH 4/4] Finish the svn refactor by implementing helper functions to write to the VCS

2018-10-08 Thread Eli Schwartz via arch-projects
Signed-off-by: Eli Schwartz 
---
 db-functions-svn | 46 ++
 db-move  | 23 ---
 db-remove|  5 ++---
 3 files changed, 52 insertions(+), 22 deletions(-)

diff --git a/db-functions-svn b/db-functions-svn
index 9903f55e..f971cd2e 100644
--- a/db-functions-svn
+++ b/db-functions-svn
@@ -58,3 +58,49 @@ find_repo_for_package() {
 
printf '%s\n' "${repos[@]%/}"
 }
+
+# Commit changes staged by (successive?) vcs_(re)?move_package runs.
+vcs_commit() {
+   arch_svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${1}"
+}
+
+# Write to the VCS in order to track a package moving between different pacman
+# repositories.
+vcs_move_package() {
+   local pkgbase=${1}
+   local vcsrepo_from=${WORKDIR}/svn/${pkgbase}/repos/${2}
+   local vcsrepo_to=${WORKDIR}/svn/${pkgbase}/repos/${3}
+
+   if [[ ! -d ${WORKDIR}/svn ]]; then
+   arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null
+   fi
+   arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null
+
+   if [[ -d ${vcsrepo_to} ]]; then
+   while read -r file; do
+   arch_svn rm -q "${vcsrepo_to}/${file}@"
+   done < <(arch_svn ls "${vcsrepo_to}")
+   else
+   mkdir "${vcsrepo_to}"
+   arch_svn add -q "${vcsrepo_to}"
+   fi
+
+   while read -r file; do
+   arch_svn mv -q -r HEAD "${vcsrepo_from}/${file}@" 
"${vcsrepo_to}/"
+   done < <(arch_svn ls "${vcsrepo_from}")
+   arch_svn rm --force -q "${vcsrepo_from}"
+}
+
+# Write to the VCS in order to track a package being deleted from a pacman
+# repository.
+vcs_remove_package() {
+   local pkgbase=${1}
+   local vcsrepo=${WORKDIR}/svn/${pkgbase}/repos/${2}
+
+   if [[ ! -d ${WORKDIR}/svn ]]; then
+   arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null
+   fi
+
+   arch_svn up -q "${WORKDIR}/svn/${pkgbase}" > /dev/null
+   arch_svn rm --force -q "${vcsrepo}"
+}
diff --git a/db-move b/db-move
index 4867b41f..72aa0b35 100755
--- a/db-move
+++ b/db-move
@@ -58,15 +58,12 @@ for arch in "${ARCHES[@]}"; do
declare -a add_pkgs_$arch
declare -a remove_pkgs_$arch
 done
-arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null
 for pkgbase in "${args[@]:2}"; do
-   arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null
tag_list=""
for pkgarch in "${ARCHES[@]}" 'any'; do
-   
svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}"
-   
svnrepo_to="${WORKDIR}/svn/${pkgbase}/repos/${repo_to}-${pkgarch}"
+   vcsrepo_from=$(find_repo_for_package "${pkgbase}" "${pkgarch}" 
"${repo_from}")
 
-   if [[ -f ${svnrepo_from}/PKGBUILD ]]; then
+   if [[ ${vcsrepo_from} = ${repo_from}-${pkgarch} ]]; then
if [[ ${pkgarch} = any ]]; then
tarches=("${ARCHES[@]}")
else
@@ -77,19 +74,7 @@ for pkgbase in "${args[@]:2}"; do
get_full_version; echo "${pkgname[@]}")
read -ra pkgnames <<<"$pkgnames"
 
-   if [[ -d ${svnrepo_to} ]]; then
-   for file in $(arch_svn ls "${svnrepo_to}"); do
-   arch_svn rm -q "${svnrepo_to}/$file@"
-   done
-   else
-   mkdir "${svnrepo_to}"
-   arch_svn add -q "${svnrepo_to}"
-   fi
-
-   for file in $(arch_svn ls "${svnrepo_from}"); do
-   arch_svn mv -q -r HEAD "${svnrepo_from}/$file@" 
"${svnrepo_to}/"
-   done
-   arch_svn rm --force -q "${svnrepo_from}"
+   vcs_move_package "${pkgbase}" "${repo_from}-${pkgarch}" 
"${repo_to}-${pkgarch}"
tag_list+=", $pkgarch"
 
for tarch in "${tarches[@]}"; do
@@ -110,7 +95,7 @@ for pkgbase in "${args[@]:2}"; do
fi
done
tag_list="${tag_list#, }"
-   arch_svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved 
${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})"
+   vcs_commit "${0##*/}: moved ${pkgbase} from [${repo_from}] to 
[${repo_to}] (${tag_list})"
 done
 
 for tarch in "${ARCHES[@]}"; do
diff --git a/db-remove b/db-remove
index b0a49cf8..a27a9f29 100755
--- a/db-remove
+++ b/db-remove
@@ -34,9 +34,8 @@ for pkgbase in "${pkgbases[@]}"; do
msg "Removing %s from [%s]..." "$pkgbase" "$repo"
 
if remove_pkgs+=($(source_pkgbuild "${pkgbase}" "repos/${vcsrepo}" && 
echo ${pkgname[@]})); then
-   arch_svn checkout -q "${SVNREPO}/${pkgbase}" 
"${WORKDIR}/svn/${pkgbase}" >/dev/null
-   arch_svn rm --force -q 

[arch-projects] [dbscripts] [PATCH 0/4] Refactoring svn calls

2018-10-08 Thread Eli Schwartz via arch-projects
Having svn code intertwined with everything is complicated and results
in it being harder to replace svn with something else. As a first step
to hopefully migrating to git, I've refactored everything that directly
touched svn to be contained in db-functions-svn, and renamed to be
generic enough that any alternative backend should be able to implement
some VCS-specific "vcs_*" functions.

Also see https://github.com/archlinux/dbscripts/pull/12

Eli Schwartz (4):
  Preliminary work to break out svn-specific code.
  Factor out the exporting of files/folders from svn.
  More work on refactoring svn moving into VCS-agnostic routines.
  Finish the svn refactor by implementing helper functions to write to
the VCS

 config|   7 ++-
 cron-jobs/sourceballs |   3 +-
 db-functions  |  50 ++--
 db-functions-svn  | 106 ++
 db-move   |  56 --
 db-remove |  12 ++---
 db-update |   4 +-
 testing2x |  37 +--
 8 files changed, 165 insertions(+), 110 deletions(-)
 create mode 100644 db-functions-svn

-- 
2.19.1


[arch-projects] [dbscripts] [PATCH 2/4] Factor out the exporting of files/folders from svn.

2018-10-08 Thread Eli Schwartz via arch-projects
As of the source_pkgbuild rewrite, this is only ever done once.

Signed-off-by: Eli Schwartz 
---
 cron-jobs/sourceballs |  3 +--
 db-functions-svn  | 15 +++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index 6be28abc..115c5bc0 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -79,8 +79,7 @@ for repo in "${PKGREPOS[@]}"; do
 
# Get the sources from svn
mkdir -p -m0770 
"${WORKDIR}/pkgbuilds/${repo}-${pkgarch}"
-   arch_svn export -q 
"${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \
-   
"${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1
+   export_from_vcs "${pkgbase}" "repos/${repo}-${pkgarch}" 
"" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}"
if (( $? >= 1 )); then
failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}")
continue
diff --git a/db-functions-svn b/db-functions-svn
index 41a87cc0..deb4e389 100644
--- a/db-functions-svn
+++ b/db-functions-svn
@@ -25,3 +25,18 @@ source_pkgbuild() {
 
. <(arch_svn cat "${SVNREPO}/${pkgbase}/${tag}/PKGBUILD" 2>/dev/null || 
echo "false")
 }
+
+# Export PKGBUILD resource(s) from the package's git/svn/whatever repo.
+# Depending on how the VCS is used the tag might be "trunk" or 
"repos/$repo-$arch"
+# or the full package version (epoch:pkgver-pkgrel) or any other recognized 
tag.
+export_from_vcs() {
+   local pkgbase=${1}
+   local tag=${2}
+   local src=${3}
+   local dest=${4}
+
+   if [[ ! -e ${dest} ]]; then
+   mkdir -p "${dest%/?*}"
+   arch_svn export -q "${SVNREPO}/${pkgbase}/${tag}/${src}" 
"${dest}" 2>/dev/null
+   fi
+}
-- 
2.19.1


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20180603-6-g971181b

2018-10-07 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  971181bf94d5e86bd7fce41303b51d1b3befc85b (commit)
   via  a75e4ee5b440a9d571658cd326f29a625320d777 (commit)
   via  e712811bcacd43ee443b98ad8a03347ce3a63b69 (commit)
  from  0b630e25a3181d5228cbd99c9041a04b6514fc81 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 971181bf94d5e86bd7fce41303b51d1b3befc85b
Author: Luke Shumaker 
Date:   Fri Jul 13 11:23:42 2018 -0400

test: checkPackageDB(): Resolve "FIXME: We guess the location of the 
PKGBUILD"

The problem statement:

  checkPackageDB and checkRemovedPackageDB need bit of information on the
  package they're checking: a full list of pkgnames with that pkgbase, the
  list of pkgarches, and (for checkPackageDB only) the full version.  In
  dbscripts itself, we can get that directly from the .db files; however,
  since the test suite is checking the ability of dbscripts to edit those
  .db files, that's obviously not a good solution.

  The current solution is to get this information from the PKGBUILD...
  which we also count on dbscripts to correctly keep track of.  Wait,
  that's skipping ahead, let's back up.

  The current solution is to get this information from the PKGBUILD.  For
  checkRemovedPackageDB, that's easy; we just get it from trunk, as that's
  the most up-to-date information on the package as-it-would-have-existed
  (if that sounded a little hand-wavey, it was).  But for checkPackageDB,
  it's a little trickier, because of 2 factors working together: (1) there
  might be different versions on different repos, and (2) unlike
  checkRemovedPackageDB, checkPackageDB actually cares about pkgver.  So,
  checkPackageDB "guesses" the location in a slightly sloppy way, and is
  tagged with a "FIXME".

What todo about it?

  There are a couple of things to observe:

   - Hidden in the hand-waving in assuming that "trunk" is fine for
 checkRemovedPackageDB is the assumption that neither pkgname=() nor
 arch=() is going to change between versions.  Which is a fine
 assumption, because we don't change those things between versions in
 any of our test cases.
   - We're counting on dbscripts correctly keeping track of which PKGBUILD
 is correct for which repo... which is one of the thing's we're trying
 to test, we shouldn't be counting on it.  That's actually a bigger
 problem than the original "FIXME"!

  So, putting those things together, let's (1) take the code under test out
  of the equation, and (2) remove any suggestion that the version of the
  PKGBUILD makes a difference to pkgnames/pkgarches: Let's have both
  functions that that information from the PKGBUILDs under "fixtures/",
  rather than getting PKGBUILDs from VCS.

  That just leaves one question: How to get the correct pkgver in
  checkPackageDB?  The obvious answer is: Each test case knows what the
  version should be; add it as an argument, and adjust every testcase that
  calls it.

commit a75e4ee5b440a9d571658cd326f29a625320d777
Author: Luke Shumaker 
Date:   Fri Jul 13 18:04:29 2018 -0400

test: Don't use "! cmd" except as the last statement in a function

With BATS setting up error traps, we get used to writing simple `[[ foo ]]`
assertions and not having to check the result.  However, using `!` to
invert the result DOESN'T trigger the trap.  It works OK when it is the
last command in a function, as it still affects the function's return
value, so then the trap triggers in the caller (rather than in the
function).  This means that a check may run successfully when it should
fail.

So, replace all uses of bare `! cmd` with `if cmd; then return 1; fi`,
unless it is the final statement in a function (as it is in
sourceballs.bats:__checkRemovedSourcePackage())

The mistake meant that checkRemovedPackage() was effectively equivalent to
checkRemovedPackageDB().  This meant that no one noticed that db-updates's
"add package with inconsistent name fails" test called checkRemovedPackage
instead of checkRemovedPackageDB.  Fixing the ! issue means that the test
now fails, so change which function it calls.

commit e712811bcacd43ee443b98ad8a03347ce3a63b69
Author: Luke Shumaker 
Date:   Thu Jun 21 22:01:54 2018 -0400

test: db-move: Verify that it works on single-arch packages

---

Summary of 

[arch-projects] [namcap] [PATCH] elffiles: also check DF_BIND_NOW when checking FULL RELRO

2018-09-11 Thread Chih-Hsuan Yen via arch-projects
Looks like DF_BIND_NOW has the same function as DT_BIND_NOW.
---
 Namcap/rules/elffiles.py | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Namcap/rules/elffiles.py b/Namcap/rules/elffiles.py
index d707a58..b2ce6ec 100644
--- a/Namcap/rules/elffiles.py
+++ b/Namcap/rules/elffiles.py
@@ -140,11 +140,16 @@ class ELFGnuRelroRule(TarballRule):
description = "Check for FULL RELRO in ELF files."
 
def has_bind_now(self, elffile):
+   DF_BIND_NOW = 8
+
for section in elffile.iter_sections():
if not isinstance(section, DynamicSection):
continue
-   if any(tag.entry.d_tag == 'DT_BIND_NOW' for tag in 
section.iter_tags()):
-   return True
+   for tag in section.iter_tags():
+   if tag.entry.d_tag == 'DT_BIND_NOW':
+   return True
+   if tag.entry.d_tag == 'DT_FLAGS' and 
tag.entry.d_val & DF_BIND_NOW:
+   return True
return False
 
def analyze(self, pkginfo, tar):
-- 
2.19.0


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20180603-3-g0b630e2

2018-09-09 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  0b630e25a3181d5228cbd99c9041a04b6514fc81 (commit)
   via  57a307d6620d8fbf3bf1c7d01e621022da4f3f29 (commit)
  from  c53352c103e023727ce31e98ca9647bb918a9a5d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 0b630e25a3181d5228cbd99c9041a04b6514fc81
Author: anthraxx 
Date:   Mon Sep 3 13:50:16 2018 +0200

fix potential bsdtar stream close error by grep

This silences a useless error message that confuses the user.

bsdtar doesn't like it when the stream gets closed before it finishes
which may be the case when grep found its match on potentially huge
archives. Instead of suppressing the whole stderr , we find all matches
with grep, then use a second pass with `tail` to find only the last
match, which ensures the stream remains open for bsdtar but we may still
catch and see useful messages on stderr.

This works because tail has the useful property of not closing early.

commit 57a307d6620d8fbf3bf1c7d01e621022da4f3f29
Author: anthraxx 
Date:   Mon Sep 3 22:01:16 2018 +0200

readme: switch to travis-ci.com build status badge

The old travis-ci.org is deprecated and this project was migrated.

---

Summary of changes:
 README.md| 2 +-
 db-functions | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Official repo DB scripts


Re: [arch-projects] [dbscripts] [PATCH 2/2] fixup: fix potential bsdtar stream close error by grep

2018-09-09 Thread Eli Schwartz via arch-projects
On 9/9/18 11:20 AM, Eli Schwartz wrote:
> On 9/3/18 7:50 AM, Levente Polyak via arch-projects wrote:
>> From: anthraxx 
>>
>> bsdtar doesn't like it when the stream gets closed before it finishes
>> which may be the case when grep found its match on potentially huge
>> archives. Instead of suppressing the whole strerr , we just pipe
>> the output through cat which ensures the stream remains open for bsdtar
>> but we may still catch and see useful messages on stderr.
> 
> This is functionally 23c2b82c336bf19b7a29a90d19bca4423d8b8839 again, but
> for more locations. I'm never going to understand why some people get
> this SIGPIPE but I don't, but I guess it makes sense to do this change
> -- especially as we do the same elsewhere.
> 
> (We need to buffer it somehow with some extra command, grep doesn't have
> a way to only output the first result but still avoid propagating
> SIGPIPE. Why does bsdtar care about this anyway...)


As discussed on IRC, I can finally reproduce this, e.g.
bsdtar xOf /path/to/file | grep --binary-files=text a
(many matches for the string "a")

With grep -q or grep -m1, it errors

with cat | grep -q/-m1 it still errors due to the buffer going *into*
grep, having insufficient room :(

with grep | head -1 it only errors, if the matching buffer going *out*
of grep is too large. For our uses it should only ever match exactly
once. So this is what we should do.

(Or complain to libarchive. :p)

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: [arch-projects] [dbscripts] [PATCH 2/2] fixup: fix potential bsdtar stream close error by grep

2018-09-09 Thread Eli Schwartz via arch-projects
On 9/3/18 7:50 AM, Levente Polyak via arch-projects wrote:
> From: anthraxx 
> 
> bsdtar doesn't like it when the stream gets closed before it finishes
> which may be the case when grep found its match on potentially huge
> archives. Instead of suppressing the whole strerr , we just pipe
> the output through cat which ensures the stream remains open for bsdtar
> but we may still catch and see useful messages on stderr.

This is functionally 23c2b82c336bf19b7a29a90d19bca4423d8b8839 again, but
for more locations. I'm never going to understand why some people get
this SIGPIPE but I don't, but I guess it makes sense to do this change
-- especially as we do the same elsewhere.

(We need to buffer it somehow with some extra command, grep doesn't have
a way to only output the first result but still avoid propagating
SIGPIPE. Why does bsdtar care about this anyway...)

Accepted.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [dbscripts] [PATCH 1/2 v2] readme: switch to travis-ci.com build status badge

2018-09-03 Thread Levente Polyak via arch-projects
From: anthraxx 

The old travis-ci.org is deprecated and this project was migrated.
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c672998..bdd958b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Arch Linux repository management scripts [![Build 
Status](https://travis-ci.org/archlinux/dbscripts.svg?branch=master)](https://travis-ci.org/archlinux/dbscripts)
+# Arch Linux repository management scripts [![Build 
Status](https://travis-ci.com/archlinux/dbscripts.svg?branch=master)](https://travis-ci.com/archlinux/dbscripts)
 ## Configuration
 * The default configuration can be found in `config`.
 * An optional `config.local` may override the default configuration.
-- 
2.18.0


[arch-projects] [dbscripts] [PATCH 1/2] readme: switch to travis-ci.com build status badge

2018-09-03 Thread Levente Polyak via arch-projects
From: anthraxx 

The old travis-ci.org is deprecated and this project was migrated.
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c672998..bdd958b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Arch Linux repository management scripts [![Build 
Status](https://travis-ci.org/archlinux/dbscripts.svg?branch=master)](https://travis-ci.org/archlinux/dbscripts)
+# Arch Linux repository management scripts [![Build 
Status](https://travis-ci.com/archlinux/dbscripts.svg?branch=master)](https://travis-ci.org/archlinux/dbscripts)
 ## Configuration
 * The default configuration can be found in `config`.
 * An optional `config.local` may override the default configuration.
-- 
2.18.0


[arch-projects] [dbscripts] [PATCH 2/2] fixup: fix potential bsdtar stream close error by grep

2018-09-03 Thread Levente Polyak via arch-projects
From: anthraxx 

bsdtar doesn't like it when the stream gets closed before it finishes
which may be the case when grep found its match on potentially huge
archives. Instead of suppressing the whole strerr , we just pipe
the output through cat which ensures the stream remains open for bsdtar
but we may still catch and see useful messages on stderr.
---
 db-functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db-functions b/db-functions
index 0491c22..f0a6453 100644
--- a/db-functions
+++ b/db-functions
@@ -174,7 +174,7 @@ repo_unlock () { #repo_unlock  
 _grep_pkginfo() {
local _ret
 
-   _ret="$(/usr/bin/bsdtar -xOqf "$1" .PKGINFO | grep -m 1 "^${2} = ")"
+   _ret="$(/usr/bin/bsdtar -xOqf "$1" .PKGINFO | cat | grep -m 1 "^${2} = 
")"
echo "${_ret#${2} = }"
 }
 
@@ -182,7 +182,7 @@ _grep_pkginfo() {
 _grep_buildinfo() {
local _ret
 
-   _ret="$(/usr/bin/bsdtar -xOqf "$1" .BUILDINFO | grep -m 1 "^${2} = ")"
+   _ret="$(/usr/bin/bsdtar -xOqf "$1" .BUILDINFO | cat | grep -m 1 "^${2} 
= ")"
echo "${_ret#${2} = }"
 }
 
-- 
2.18.0


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20180603-1-gc53352c

2018-08-26 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  c53352c103e023727ce31e98ca9647bb918a9a5d (commit)
  from  08995618eb606523b7d05ac987b1243981290839 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit c53352c103e023727ce31e98ca9647bb918a9a5d
Author: Jelle van der Waa 
Date:   Sun Aug 26 14:52:59 2018 +0200

cron-jobs: remove unused cron jobs

Updating the archweb database is now handled by archweb itself and
deployed on the server using a systemd unit/service. These scripts are
no longer used.

Signed-off-by: Jelle van der Waa 

---

Summary of changes:
 README.md |  6 +---
 cron-jobs/update-web-db   | 78 ---
 cron-jobs/update-web-files-db |  1 -
 3 files changed, 1 insertion(+), 84 deletions(-)
 delete mode 100755 cron-jobs/update-web-db
 delete mode 12 cron-jobs/update-web-files-db


hooks/post-receive
-- 
Official repo DB scripts


Re: [arch-projects] [devtools] [PATCH 1/2] Add lddd manual

2018-08-25 Thread Doug Newgard via arch-projects
On Sat, 25 Aug 2018 13:14:35 +0200
Jelle van der Waa  wrote:

> ---
>  doc/lddd.1 | 27 +++
>  1 file changed, 27 insertions(+)
>  create mode 100644 doc/lddd.1
> 
> diff --git a/doc/lddd.1 b/doc/lddd.1
> new file mode 100644
> index 000..74f9c5e
> --- /dev/null
> +++ b/doc/lddd.1
> @@ -0,0 +1,27 @@
> +.Dd August 13, 2018
> +.\"  Patch this in our groff's mdoc.local
> +.ds volume-operating-system Arch Linux
> +.ds default-operating-system Arch Linux
> +.Os Arch Linux
> +.Dt lddd 1
> +.Sh NAME
> +.Nm lddd
> +.Nd find broken library links on your machine
> +.Sh SYNOPSIS
> +.Nm lddd
> +.Sh DESCRIPTION
> +lddd scans all elf binaries in $PATH, /lib, /usr/local/lib or specified in
> +/etc/ld.so.conf.d/*.conf, looks for missing symbols and suggests which 
> packages

I don't think that's right. lddd uses ldd, which AFAIK, only checks for linked
files, not individual symbols.

> +might need to be rebuild. The collected data is written to a temporary
> +directory created by mktemp.
> +.Sh SEE ALSO
> +.Xr ldd 1
> +.Sh BUGS
> +Bugs? You must be kidding; there are no bugs in this software. But if we 
> happen
> +to be wrong, send us an email with as much detail as possible to
> +arch-projects@archlinux.org
> +.Sh AUTHORS
> +.An Aaron Griffin 
> +.An Pierre Schmitz 
> +.An Lukas Fleischer 
> +.An Luke Shumaker 
> -- 
> 2.18.0


[arch-projects] [netctl] [GIT] Network control utility based on systemd annotated tag 1.18 created. 1.18

2018-08-07 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The annotated tag, 1.18 has been created
at  752de745e674cdb66b07a4d36a85188e689d8855 (tag)
   tagging  9044d45d9d25c585f666e51f47da5559b165c837 (commit)
  replaces  1.17
 tagged by  Jouke Witteveen
on  Tue Aug 7 17:47:51 2018 +0200

- Log -
Release 1.18
-BEGIN PGP SIGNATURE-

iQFKBAABCAA0FiEEbql9KtO+F66lkufaVrYfv4JJLBUFAltpvy0WHGoud2l0dGV2
ZWVuQGdtYWlsLmNvbQAKCRBWth+/gkksFb3bB/4+Xex1tOwXJXinZdX7CB0BZgZ7
R1yQY7GCxh75xmi32bYYjJBF7eRlhxImt55EzUi08dN5Ii58+zbWMQciSgs5QwCa
DuJnke6LvHoEDUeZI4wcms6cNXwXGdYOkDX5oxtd7zjQAQoMdjy3BGfxVVYrCcrQ
pcxVZsZnmBSxtRIIL1JvYVJxbg2KVUQm3qAXji5idR261JRMlHjxr+x1kX2Xc/mx
5S9XVotctKYjNtFRDsFGIsW+AyI0PO0yz1jiqaKrWN1leGjYxIcsLiJpyuliu+VR
oMnfeFQm3nR250mhZehGmUWG4QwwrMkxpn6TDGrforaDOkEjc0o66esQlEvC
=TCy6
-END PGP SIGNATURE-

Jouke Witteveen (6):
  Use drop-in directories instead of .include statements
  Centralize profile exposing through the Profile variable
  Switch to single quotes in contexts where we may want to use '\'
  PKGBUILD: depend on resolvconf instead of on openresolv
  PKGBUILD: add post_upgrade messages
  1.18 release updates

---


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl] [GIT] Network control utility based on systemd branch master updated. 1.17-6-g9044d45

2018-08-07 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The branch, master has been updated
   via  9044d45d9d25c585f666e51f47da5559b165c837 (commit)
   via  9e9014e57e72ef321ef959bfbf645b9062cd5d15 (commit)
  from  e9c5de21c2d50c8fd8d1343feecb632bf836eec1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 9044d45d9d25c585f666e51f47da5559b165c837
Author: Jouke Witteveen 
Date:   Tue Aug 7 17:47:24 2018 +0200

1.18 release updates

commit 9e9014e57e72ef321ef959bfbf645b9062cd5d15
Author: Jouke Witteveen 
Date:   Sat Aug 4 18:16:30 2018 +0200

PKGBUILD: add post_upgrade messages

---

Summary of changes:
 .gitignore |  1 +
 Makefile   |  9 ++---
 NEWS   |  4 
 contrib/PKGBUILD.in|  1 +
 contrib/netctl.install | 10 ++
 docs/Makefile  |  3 ++-
 6 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100644 contrib/netctl.install


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl][PATCH] PKGBUILD: add post_upgrade messages

2018-08-04 Thread Jouke Witteveen via arch-projects
---
I am still a little hesitant to carry this in the netctl repository.
Currently, the repository is more or less distribution agnostic.

 Makefile   |  7 +--
 contrib/PKGBUILD.in|  1 +
 contrib/netctl.install | 10 ++
 3 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 contrib/netctl.install

diff --git a/Makefile b/Makefile
index 7e6a7c9..003abfc 100644
--- a/Makefile
+++ b/Makefile
@@ -49,16 +49,19 @@ netctl-$(VERSION).tar.xz:
gpg --detach-sign $@
 
 pkgbuild: PKGBUILD
-PKGBUILD: netctl-$(VERSION).tar.xz contrib/PKGBUILD.in
+PKGBUILD: netctl-$(VERSION).tar.xz contrib/PKGBUILD.in netctl.install
sed -e "s|@pkgver@|$(VERSION)|g" \
-e "s|@md5sum@|$(shell md5sum $< | cut -d ' ' -f 1)|" \
-e "s|@md5sum.sig@|$(shell md5sum $<.sig | cut -d ' ' -f 1)|" \
$(lastword $^) > $@
 
+netctl.install: contrib/netctl.install
+   cp $< $@
+
 upload: netctl-$(VERSION).tar.xz
scp $< $<.sig sources.archlinux.org:/srv/ftp/other/packages/netctl
 
 clean:
$(MAKE) -C docs clean
-   -@rm -vf PKGBUILD *.tar.xz *.tar.xz.sig 2>/dev/null
+   -@rm -vf netctl-*.tar.xz{,.sig} PKGBUILD netctl.install
 
diff --git a/contrib/PKGBUILD.in b/contrib/PKGBUILD.in
index 71b1f5c..b5ce44c 100644
--- a/contrib/PKGBUILD.in
+++ b/contrib/PKGBUILD.in
@@ -19,6 +19,7 @@ optdepends=('dialog: for the menu based wifi assistant'
 'ppp: for PPP connections'
 'openvswitch: for Open vSwitch connections'
)
+install=netctl.install
 
source=(https://sources.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig})
 arch=('any')
 md5sums=('@md5sum@'
diff --git a/contrib/netctl.install b/contrib/netctl.install
new file mode 100644
index 000..920ce5e
--- /dev/null
+++ b/contrib/netctl.install
@@ -0,0 +1,10 @@
+post_upgrade() {
+if [[ $(vercmp 1.18 "$2") -gt 0 ]]; then
+grep -ls '^.include ' /etc/systemd/system/netctl@*.service | \
+  while read -r unit; do
+profile=$(systemd-escape --unescape "${unit:27:-8}")
+echo ":: The unit for profile '$profile' uses deprecated features."
+echo "   Consider running: netctl reenable $(printf '%q' 
"$profile")"
+done
+fi
+}
-- 
2.18.0


Re: [arch-projects] [netctl] news draft

2018-08-03 Thread Eli Schwartz via arch-projects
On 08/03/2018 02:10 PM, Jouke Witteveen wrote:
> On Fri, Aug 3, 2018 at 7:57 PM Eli Schwartz via arch-projects
>  wrote:
>>
>> On 08/03/2018 01:48 PM, Jouke Witteveen via arch-projects wrote:
>>> Hello all,
>>>
>>> I cannot send to arch-dev-public and don't know where to post this
>>> otherwise, so I'll just put this out here.
>>>
>>> With systemd 239, a deprecation message is printed in the journal for
>>> enabled netctl profiles (FS#59494). This currently has no effect on
>>> the functionality of either systemd or netctl. Nevertheless, the next
>>> version of netctl, which is not yet released, will move away from the
>>> deprecated features. However, the warnings are caused by unit files
>>> generated by netctl, so an update will not simply make the warnings go
>>> away.
>>> Here is a draft for a news post to accompany the next version of
>>> netctl down the line.
>>>
>>> Regards,
>>> - Jouke
>>> 
>>> Title: netctl 1.18 may require manual intervention
>>>
>>> In response to the explicit deprecation of .include statements in
>>> systemd units, netctl has modified its unit management. This change
>>> only affects individually enabled netctl profiles. To use the new
>>> management scheme, all enabled profiles must be reenabled after
>>> updating netctl. This can be done through `netctl reenable `.
>>> No action is needed for the automatic netctl services.
>>
>> Why would it need manual intervention? Does netctl not work if you use
>> the old format? From systemd's side, the whole reason it is a
>> deprecation warning is because it will continue to work for some time
>> until they finally ditch it entirely.
>>
>> I would assume that existing netctl profiles which aren't reenabled
>> would continue to successfully use the old, deprecated unit files?
> 
> Indeed, I expect the generated units to continue to work for a little
> longer, but at https://github.com/systemd/systemd/pull/8530 there is
> already a suggestion to proceed the deprecation further. I think it is
> nice to tell people what to do if they are bothered by the deprecation
> warning in their logs. Maybe in a different wording, stressing that
> nothing will break (for now) if you don't reenable your profiles?

I'm not sure I understand the suggestion to mark it as tainted, what
exactly is "tainted" about using deprecated stuff?

I think systemd's builtin deprecation policies are probably sufficient
for now, especially as nothing actually breaks for now.

In this case I would not use a news post, but I might consider a
post_upgrade function in an install script for netctl itself which runs
once for the upgrade from 1.17 to (unreleased) 1.18, warning users to
refresh their profiles. News posts are usually for things which require
manual intervention *before* updating.

And as long as 1.18 isn't released yet, I guess it makes no sense at all
to warn people about something they cannot do yet. :D

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: [arch-projects] [netctl] news draft

2018-08-03 Thread Jouke Witteveen via arch-projects
On Fri, Aug 3, 2018 at 7:57 PM Eli Schwartz via arch-projects
 wrote:
>
> On 08/03/2018 01:48 PM, Jouke Witteveen via arch-projects wrote:
> > Hello all,
> >
> > I cannot send to arch-dev-public and don't know where to post this
> > otherwise, so I'll just put this out here.
> >
> > With systemd 239, a deprecation message is printed in the journal for
> > enabled netctl profiles (FS#59494). This currently has no effect on
> > the functionality of either systemd or netctl. Nevertheless, the next
> > version of netctl, which is not yet released, will move away from the
> > deprecated features. However, the warnings are caused by unit files
> > generated by netctl, so an update will not simply make the warnings go
> > away.
> > Here is a draft for a news post to accompany the next version of
> > netctl down the line.
> >
> > Regards,
> > - Jouke
> > 
> > Title: netctl 1.18 may require manual intervention
> >
> > In response to the explicit deprecation of .include statements in
> > systemd units, netctl has modified its unit management. This change
> > only affects individually enabled netctl profiles. To use the new
> > management scheme, all enabled profiles must be reenabled after
> > updating netctl. This can be done through `netctl reenable `.
> > No action is needed for the automatic netctl services.
>
> Why would it need manual intervention? Does netctl not work if you use
> the old format? From systemd's side, the whole reason it is a
> deprecation warning is because it will continue to work for some time
> until they finally ditch it entirely.
>
> I would assume that existing netctl profiles which aren't reenabled
> would continue to successfully use the old, deprecated unit files?

Indeed, I expect the generated units to continue to work for a little
longer, but at https://github.com/systemd/systemd/pull/8530 there is
already a suggestion to proceed the deprecation further. I think it is
nice to tell people what to do if they are bothered by the deprecation
warning in their logs. Maybe in a different wording, stressing that
nothing will break (for now) if you don't reenable your profiles?

Regards,
- Jouke


Re: [arch-projects] [netctl] news draft

2018-08-03 Thread Eli Schwartz via arch-projects
On 08/03/2018 01:48 PM, Jouke Witteveen via arch-projects wrote:
> Hello all,
> 
> I cannot send to arch-dev-public and don't know where to post this
> otherwise, so I'll just put this out here.
> 
> With systemd 239, a deprecation message is printed in the journal for
> enabled netctl profiles (FS#59494). This currently has no effect on
> the functionality of either systemd or netctl. Nevertheless, the next
> version of netctl, which is not yet released, will move away from the
> deprecated features. However, the warnings are caused by unit files
> generated by netctl, so an update will not simply make the warnings go
> away.
> Here is a draft for a news post to accompany the next version of
> netctl down the line.
> 
> Regards,
> - Jouke
> 
> Title: netctl 1.18 may require manual intervention
> 
> In response to the explicit deprecation of .include statements in
> systemd units, netctl has modified its unit management. This change
> only affects individually enabled netctl profiles. To use the new
> management scheme, all enabled profiles must be reenabled after
> updating netctl. This can be done through `netctl reenable `.
> No action is needed for the automatic netctl services.

Why would it need manual intervention? Does netctl not work if you use
the old format? From systemd's side, the whole reason it is a
deprecation warning is because it will continue to work for some time
until they finally ditch it entirely.

I would assume that existing netctl profiles which aren't reenabled
would continue to successfully use the old, deprecated unit files?

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [netctl] news draft

2018-08-03 Thread Jouke Witteveen via arch-projects
Hello all,

I cannot send to arch-dev-public and don't know where to post this
otherwise, so I'll just put this out here.

With systemd 239, a deprecation message is printed in the journal for
enabled netctl profiles (FS#59494). This currently has no effect on
the functionality of either systemd or netctl. Nevertheless, the next
version of netctl, which is not yet released, will move away from the
deprecated features. However, the warnings are caused by unit files
generated by netctl, so an update will not simply make the warnings go
away.
Here is a draft for a news post to accompany the next version of
netctl down the line.

Regards,
- Jouke

Title: netctl 1.18 may require manual intervention

In response to the explicit deprecation of .include statements in
systemd units, netctl has modified its unit management. This change
only affects individually enabled netctl profiles. To use the new
management scheme, all enabled profiles must be reenabled after
updating netctl. This can be done through `netctl reenable `.
No action is needed for the automatic netctl services.


[arch-projects] [netctl] [GIT] Network control utility based on systemd branch master updated. 1.17-4-ge9c5de2

2018-08-03 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The branch, master has been updated
   via  e9c5de21c2d50c8fd8d1343feecb632bf836eec1 (commit)
   via  a49ffaf79fee536ded2465f2cb669b024f43274a (commit)
   via  1a35b9ffe7464e4fd02898a2a97e38c4236e (commit)
   via  04d39b2573bd34d4159837afdb4793a0990bd44a (commit)
  from  4be6904e2518b5b13675439d6b89592e6bb4a6e3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit e9c5de21c2d50c8fd8d1343feecb632bf836eec1
Author: Jouke Witteveen 
Date:   Thu Aug 2 14:29:21 2018 +0200

PKGBUILD: depend on resolvconf instead of on openresolv

Depend on the interface, not on the implementation.
Nevertheless, for netctl, openresolv is the preferred implementation.

commit a49ffaf79fee536ded2465f2cb669b024f43274a
Author: Jouke Witteveen 
Date:   Sat Jul 28 23:09:29 2018 +0200

Switch to single quotes in contexts where we may want to use '\'

Inside double quotes, backslash is an escape character. Hence, it is
cleaner to use single quotes where backslashes may occur. This includes
pattern strings for print, grep, and sed.

commit 1a35b9ffe7464e4fd02898a2a97e38c4236e
Author: Jouke Witteveen 
Date:   Sat Jul 28 14:31:43 2018 +0200

Centralize profile exposing through the Profile variable

This also allows hooks to alter the profile to be loaded.

commit 04d39b2573bd34d4159837afdb4793a0990bd44a
Author: Jouke Witteveen 
Date:   Sat Jul 28 14:07:50 2018 +0200

Use drop-in directories instead of .include statements

The .include directive in systemd unit files has effectively been
deprecated since systemd v210. Its functionality is subsumed by
drop-in directories.

---

Summary of changes:
 contrib/PKGBUILD.in  |  2 +-
 contrib/bash-completion  |  2 +-
 contrib/zsh-completion   |  2 +-
 src/ifplugd.action   |  4 ++--
 src/lib/auto.action  |  4 +---
 src/lib/connections/wireless |  2 +-
 src/lib/globals  | 14 +++-
 src/lib/ip   |  2 +-
 src/lib/network  |  5 ++--
 src/lib/wpa  | 14 ++--
 src/netctl-auto  |  4 ++--
 src/netctl.in| 54 ++--
 src/wifi-menu| 16 ++---
 13 files changed, 62 insertions(+), 63 deletions(-)


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl][PATCH] Use drop-in directories instead of .include statements

2018-07-28 Thread Jouke Witteveen via arch-projects
The .include directive in systemd unit files has effectively been
deprecated since systemd v210. Its functionality is subsumed by
drop-in directories.
---
 src/netctl.in | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/netctl.in b/src/netctl.in
index b5da594..6aeed7e 100644
--- a/src/netctl.in
+++ b/src/netctl.in
@@ -90,43 +90,43 @@ switch_to() {
 }
 
 unit_enable() {
-local unit="@systemdsystemconfdir@/netctl@$(systemd-escape "$1").service"
-if [[ -e $unit ]]; then
-report_error "A unit file for profile '$1' already exists"
+local unit=$(systemd-escape --template=netctl@.service "$1") target
+load_profile "$1"
+
+target="@systemdsystemconfdir@/multi-user.target.wants/$unit"
+if [[ -e $target ]]; then
+report_error "The profile '$1' is already enabled"
 return 1
 fi
-load_profile "$1"
-do_readable touch "$unit"
-echo ".include @systemdsystemunitdir@/netctl@.service" > "$unit"
-echo -e "\n[Unit]" >> "$unit"
-[[ $Description ]] && echo "Description=$Description" >> "$unit"
+do_readable mkdir -p "$(dirname "$target")"
+ln -vs "@systemdsystemunitdir@/netctl@.service" "$target"
+
+target="@systemdsystemconfdir@/$unit.d/profile.conf"
+do_readable mkdir -p "$(dirname "$target")"
+do_readable touch "$target"
+echo "[Unit]" > "$target"
+if [[ $Description ]]; then
+echo "Description=$Description" >> "$target"
+fi
 declare -p BindsToInterfaces &> /dev/null || BindsToInterfaces=$Interface
 if (( ${#BindsToInterfaces[@]} )); then
 : ${InterfaceRoot=sys/subsystem/net/devices/}
 printf "BindsTo=$(systemd-escape "$InterfaceRoot")%s.device\n" \
-   $(systemd-escape "${BindsToInterfaces[@]}") >> "$unit"
+   $(systemd-escape "${BindsToInterfaces[@]}") >> "$target"
 printf "After=$(systemd-escape "$InterfaceRoot")%s.device\n" \
-   $(systemd-escape "${BindsToInterfaces[@]}") >> "$unit"
+   $(systemd-escape "${BindsToInterfaces[@]}") >> "$target"
 fi
 if (( ${#After[@]} )); then
 printf 'After=netctl@%s.service\n' \
-   $(systemd-escape "${After[@]}") >> "$unit"
+   $(systemd-escape "${After[@]}") >> "$target"
 fi
-mkdir -p "@systemdsystemconfdir@/multi-user.target.wants"
-echo "ln -s '$unit' '${unit/system\//system/multi-user.target.wants/}'"
-ln -s "$unit" "${unit/system\//system/multi-user.target.wants/}"
+report_notice "generated '$target'"
 }
 
 unit_disable() {
-local unit="@systemdsystemconfdir@/netctl@$(systemd-escape "$1").service"
-if sd_call "is-enabled --quiet" "$1" &> /dev/null; then
-sd_call disable "$1"
-fi
-if [[ ! -f $unit ]]; then
-report_error "No regular unit file found for profile '$1'"
-return 1
-fi
-do_debug rm "$unit"
+local unit=$(systemd-escape --template=netctl@.service "$1")
+rm -vfd "@systemdsystemconfdir@"{/multi-user.target.wants,}"/$unit" \
+"@systemdsystemconfdir@/$unit.d"{/profile.conf,}
 }
 
 wait_online() {
-- 
2.18.0


Re: [arch-projects] [devtools] [PATCH] Expand check_root keepenv variables

2018-07-23 Thread Eli Schwartz via arch-projects
On 07/23/2018 06:15 PM, Morten Linderud via arch-projects wrote:
> From: Morten Linderud 
> 
> makechrootpkg checks the environment for multiple variables before
> overwriting them with makepkg.conf configurations. Expand check_root
> with the variables makechrootpkg check for so we are capable of
> overwriting them when needed.

The two times we use check_root we're checking the environment for
something decidedly not related to makepkg.conf at all? Not sure what
this means.

You're suggesting makechrootpkg does check for them, therefore we should
expand check_root itself in order to check for them? How is it checking
for them?

...

The fact that it could use the values from the environment before
makepkg.conf is technically an implementation detail due to the
lazy-loaded way makechrootpkg will grep for the value (which is totally
wrong and it should source the bash-compatible file), see in contrast
how makepkg itself does a whole song-and-a-dance to preserve the values
from the environment, source makepkg.conf, and restore the environment
versions if available.

I would not describe this commit message by the implementation method
"expand check_root", but instead describe it as "allow makepkg.conf
settings to be sourced from the environment too".

> Signed-off-by: Morten Linderud 
> ---
>  archbuild.in| 2 +-
>  lib/archroot.sh | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/archbuild.in b/archbuild.in
> index 1e5b582..6f22b12 100644
> --- a/archbuild.in
> +++ b/archbuild.in
> @@ -39,7 +39,7 @@ while getopts 'hcr:' arg; do
>   esac
>  done
>  
> -check_root SOURCE_DATE_EPOCH
> +check_root SOURCE_DATE_EPOCH SRCDEST SRCPKGDEST PKGDEST LOGDEST MAKEFLAGS 
> PACKAGER
>
>  # Pass all arguments after -- right to makepkg
>  makechrootpkg_args+=("${@:$OPTIND}")
> diff --git a/lib/archroot.sh b/lib/archroot.sh
> index f279603..82276e2 100644
> --- a/lib/archroot.sh
> +++ b/lib/archroot.sh
> @@ -10,7 +10,7 @@ CHROOT_VERSION='v4'
>  ##
>  orig_argv=("$0" "$@")
>  check_root() {
> - local keepenv=$1
> + local keepenv=$(tr " " "," <<< $@)

Why is it necessary to post-process the arguments, when every other user
simply passes them comma-separated in the first place?

When I wrote this code, I intended it to maintain sudo-like semantics
rather than require some preprocessor to fork a subshell and exec a
binary, introduce word splitting, and so forth... just to fix whitespace
in the arguments that should never have been added in the first place.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [devtools] [PATCH] Expand check_root keepenv variables

2018-07-23 Thread Morten Linderud via arch-projects
From: Morten Linderud 

makechrootpkg checks the environment for multiple variables before
overwriting them with makepkg.conf configurations. Expand check_root
with the variables makechrootpkg check for so we are capable of
overwriting them when needed.

Signed-off-by: Morten Linderud 
---
 archbuild.in| 2 +-
 lib/archroot.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/archbuild.in b/archbuild.in
index 1e5b582..6f22b12 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -39,7 +39,7 @@ while getopts 'hcr:' arg; do
esac
 done
 
-check_root SOURCE_DATE_EPOCH
+check_root SOURCE_DATE_EPOCH SRCDEST SRCPKGDEST PKGDEST LOGDEST MAKEFLAGS 
PACKAGER
 
 # Pass all arguments after -- right to makepkg
 makechrootpkg_args+=("${@:$OPTIND}")
diff --git a/lib/archroot.sh b/lib/archroot.sh
index f279603..82276e2 100644
--- a/lib/archroot.sh
+++ b/lib/archroot.sh
@@ -10,7 +10,7 @@ CHROOT_VERSION='v4'
 ##
 orig_argv=("$0" "$@")
 check_root() {
-   local keepenv=$1
+   local keepenv=$(tr " " "," <<< $@)
 
(( EUID == 0 )) && return
if type -P sudo >/dev/null; then
-- 
2.18.0


WARN: project from a retired committee but PMC not changed to Attic in http://lucy.apache.org/doap.rdf

2018-07-13 Thread Projects


WARN: project in Attic but not in 'retired' category: http://lucy.apache.org/doap.rdf

2018-07-13 Thread Projects


WARN: project from a retired committee but PMC not changed to Attic in http://lucy.apache.org/doap.rdf

2018-07-13 Thread Projects


Re: [arch-projects] [devtools] [PATCH] makechrootpkg: Skip PGP checks inside the chroot

2018-07-12 Thread Alexander Shpilkin via arch-projects
On Fri, 2018-07-13 at 06:55 +0200, Alexander Shpilkin wrote:
> As with the integrity checks, these have already been done in
> download_sources(), and the GPG keyring is unavailable inside the
> chroot anyway.

Err...  Nevermind, apparently --skipinteg disables PGP as well, and I
messed up my debugging today.  Sorry for the noise.  --Alex

signature.asc
Description: This is a digitally signed message part


[arch-projects] [devtools] [PATCH] makechrootpkg: Skip PGP checks inside the chroot

2018-07-12 Thread Alexander Shpilkin via arch-projects
As with the integrity checks, these have already been done in
download_sources(), and the GPG keyring is unavailable inside the
chroot anyway.
---
 makechrootpkg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index d81be84..a26815e 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -304,7 +304,7 @@ move_products() {
 # }}}
 
 main() {
-   default_makepkg_args=(--syncdeps --noconfirm --log --holdver 
--skipinteg)
+   default_makepkg_args=(--syncdeps --noconfirm --log --holdver 
--skipinteg --skippgpcheck)
makepkg_args=("${default_makepkg_args[@]}")
keepbuilddir=false
update_first=false
---
2.18.0

signature.asc
Description: This is a digitally signed message part


Re: [arch-projects] [dbscripts] [PATCH] Don't parse .db files ourselves; use pyalpm instead

2018-07-09 Thread Eli Schwartz via arch-projects
On 07/09/2018 01:32 PM, Luke Shumaker wrote:
> With the "True" filter that ftpdir-cleanup and sourceballs both use,
> you're right; this could be done with expac.  But, with the context
> that this patch exists to enable me to address the concern you had
> with the other patchset:
> 
> AFAICT, with expac there's no way to do a query like:
> 
> dbquery core x86_64 \
>   "(pkg.base or pkg.name) == '$pkgbase'" \
>   ...
> 
> Which is what most (all?) of the queries in the other patchset would
> become.
> 
> (Drat, it seems that discussing this separately from the other
> patchset won't work after all.)

Well, it's not as complex as you think. No matter what tool is used,
we'd need to manually reassemble the repository layout vs. pacman's
system DBPath. (Whether by doing database loading by hand with low-level
APIs or by providing a custom pacman.conf). But:

Checking a specific arch is as simple as using setarch first.

Current versions of makepkg set the pkgbase regardless of whether the
pkgname is different (with the rationale that there's no reason not to,
and it makes parsing package metadata easier), so we can add this to the
long list of other reasons we want to do a complete rebuild of every
package (cf. reproducible builds, PIE, and more).

And expac supports "repo/package" -- or printing the repo and filtering
that while parsing the filename or what-have-you. That being said, I've
discussed on our development IRC channel, having expac's -Ss mode to
support 'repo/.*' filtering which might be useful too...

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


Re: [arch-projects] [dbscripts] [PATCH] Don't parse .db files ourselves; use pyalpm instead

2018-07-08 Thread Eli Schwartz via arch-projects
On 07/08/2018 09:14 PM, Luke Shumaker wrote:
> From: Luke Shumaker 
> 
> In a patchset that I recently submitted, Eli was concerned that I was
> parsing .db files with bsdtar+awk, when the format of .db files isn't
> "public"; the only guarantees made about it are that libalpm can parse it.
> 
> https://lists.archlinux.org/pipermail/arch-projects/2018-June/004932.html
> 
> I wasn't too concerned, because `ftpdir-cleanup` and `sourceballs` already
> parse the .db files in the same way.  Nonetheless, I think Eli is right: we
> shouldn't be parsing these files ourselves.
> 
> So, add a `dbquery` function that uses pyalpm to parse the .db files:

What's wrong with expac?

expac --config ${dbscripts_root}/pacman-community.conf -S '%f'

expac is not only super elegant, there's pending patches to provide it
in pacman 6 as part of the core project. This is what I'm waiting for,
actually.

I see no reason to add an external dependency on both python and pyalpm,
in order to run a small python program which evals its arguments in
order to inject database queries, when a tool with a simple API can do
the same and will eventually be guaranteed to be everywhere pacman
itself is.

(Let's ignore for a moment, the defunct integrity checks service which
is written in python, but not pyalpm. pyalpm is not currently installed
on the dbscripts server ATM.)

>  - It takes as arguments Python 3 expressions;
>1. one that that returns a bool deciding whether we want to print
>   information on a package, and
>2. another that returns the string to print for a package.
> 
>Currently, all callers use "True" for the decider expression, as
>ftpdir-cleanup and sourceballs operate on *every* package.  However, I'm
>including a way to filter packages because, I'm coming at this from the
>context that I want to parse .db files in other places too.
> 
>  - libalpm doesn't offer an easy way to say "parse this DB file for me";
>instead, we must construct a configuration that has a syncdb pointing to
>that file, which we then have it sync in to a temporary directory.
> 
> As a final note, when re-writing the bit of sourceballs to use dbquery
> instead of AWK, I realized that it does not correctly handle licenses that
> have a space in them (as of 2018-07-07 there are 67 packages in the Arch
> repos that have license containing a space).  I did not fix this bug; I
> merely translated it from AWK to Python, as the program would also need to
> be adjusted elsewhere.
Keeping in mind the ones we're looking for are a whitelist of
strictly-defined license types... I think those are all ad-hoc custom
licenses, none of which we're interested in in the primary sourceballs
deployment.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [namcap] [PATCH] Fix testsuite to not hardcode the libalpm version.

2018-07-05 Thread Eli Schwartz via arch-projects
Namcap already depends on pyelftools, which contains an elegant way to
retrieve the soname information directly from libalpm.so (demonstrated
in readelf.py).

Using hardcoded strings means the testsuite periodically breaks (every
time the external pacman project bumps their soname), for no good reason
and at least a few bad ones.

Signed-off-by: Eli Schwartz 
---
 Namcap/tests/package/test_sodepends.py | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/Namcap/tests/package/test_sodepends.py 
b/Namcap/tests/package/test_sodepends.py
index 3a3d7b6..f94b3e9 100644
--- a/Namcap/tests/package/test_sodepends.py
+++ b/Namcap/tests/package/test_sodepends.py
@@ -2,7 +2,7 @@
 #
 # namcap tests - sodepends
 # Copyright (C) 2011 Rémy Oudompheng 
-# 
+#
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2 of the License, or
@@ -17,11 +17,23 @@
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 #   USA
-# 
+#
 
 import os
 from Namcap.tests.makepkg import MakepkgTest
 import Namcap.rules.sodepends
+from elftools.elf.dynamic import DynamicSection
+from elftools.elf.elffile import ELFFile
+
+def get_soname(filename):
+   with open(filename, 'rb') as f:
+   alpm = ELFFile(f)
+   for section in alpm.iter_sections():
+   if not isinstance(section, DynamicSection):
+   continue
+   for tag in section.iter_tags():
+   if tag.entry.d_tag == 'DT_SONAME':
+   return tag.soname
 
 class SoDependsTest(MakepkgTest):
pkgbuild = """
@@ -47,6 +59,7 @@ package() {
def test_sodepends(self):
"Package with missing pacman dependency"
pkgfile = "__namcap_test_sodepends-1.0-1-%(arch)s.pkg.tar" % { 
"arch": self.arch }
+   alpm_filename = os.path.join('usr/lib', 
get_soname('/usr/lib/libalpm.so'))
with open(os.path.join(self.tmpdir, "PKGBUILD"), "w") as f:
f.write(self.pkgbuild)
self.run_makepkg()
@@ -56,15 +69,15 @@ package() {
)
self.assertEqual(pkg.detected_deps['pacman'], [
('libraries-needed %s %s',
-(str(['usr/lib/libalpm.so.10']), str(["usr/bin/main"]))
+(str([alpm_filename]), str(["usr/bin/main"]))
)]
)
e, w, i = Namcap.depends.analyze_depends(pkg)
self.assertEqual(e, [
('dependency-detected-not-included %s (%s)',
-   ('pacman', "libraries ['usr/lib/libalpm.so.10'] 
needed in files ['usr/bin/main']"))
+   ('pacman', "libraries ['%s'] needed in files 
['usr/bin/main']" % alpm_filename))
+
])
self.assertEqual(w, [])
 
 # vim: set ts=4 sw=4 noet:
-
-- 
2.18.0


Re: [arch-projects] [namcap][PATCH 3/3] tests: Update to latest libaplm version

2018-07-05 Thread Eli Schwartz via arch-projects
Duplicate of
https://lists.archlinux.org/pipermail/arch-projects/2018-July/004948.html

And thus equally wrong.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [dbscripts] [PATCH 1/2] Preliminary work to break out svn-specific code.

2018-07-03 Thread Eli Schwartz via arch-projects
Introduce "db-functions-$VCS" which will eventually contain all
VCS-specific code, and make this configurable in config.

Move private arch_svn function and svn acl handling here, and introduce
a new source_pkgbuild function to handle discovering PKGBUILDs from the
configured VCS and sourcing them to extract metadata.

The PKGBUILD is the only file we ever check out from version control,
and only ever to scrape information from it, except for when we actually
want to db-move a whole directory (which is by necessity considerably
dependent on the VCS in use).

source_pkgbuild is inspired by commits from the dbscripts rewrite,
authored by Florian Pritz 

Signed-off-by: Eli Schwartz 
---
 config   |  7 +--
 db-functions | 50 +++-
 db-functions-svn | 27 ++
 db-move  |  5 +++--
 db-remove|  5 ++---
 db-update|  4 ++--
 6 files changed, 54 insertions(+), 44 deletions(-)
 create mode 100644 db-functions-svn

diff --git a/config b/config
index fd79b6ee..1cfe11f4 100644
--- a/config
+++ b/config
@@ -1,14 +1,17 @@
 #!/hint/bash
 
 FTP_BASE="/srv/ftp"
-SVNREPO=''
-SVNUSER=''
 PKGREPOS=()
 PKGPOOL=''
 SRCPOOL=''
 TESTING_REPO=''
 STABLE_REPOS=()
 
+# VCS backend
+VCS=svn
+SVNREPO=''
+SVNUSER=''
+
 CLEANUP_DESTDIR="/var/tmp"
 CLEANUP_DRYRUN=false
 # Time in days to keep moved packages
diff --git a/db-functions b/db-functions
index 0491c22d..3757b726 100644
--- a/db-functions
+++ b/db-functions
@@ -39,11 +39,6 @@ mv_acl() {
 
 # set up general environment
 WORKDIR=$(mktemp -dt "${0##*/}.XX")
-if [[ -n ${SVNUSER} ]]; then
-   setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}"
-   setfacl -m d:u:"${USER}":rwx "${WORKDIR}"
-   setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}"
-fi
 LOCKS=()
 REPO_MODIFIED=0
 
@@ -306,27 +301,24 @@ check_pkgfile() {
[[ ${pkgfile##*/} = "${pkgname}-${pkgver}-${pkgarch}"* ]]
 }
 
-check_pkgsvn() {
+# Check that the package file is consistent with the PKGBUILD in version 
control
+check_pkgvcs() {
local pkgfile="${1}"
+   local repo="${2}"
local _pkgbase="$(getpkgbase "${pkgfile}")" || return 1
local _pkgname="$(getpkgname "${pkgfile}")" || return 1
local _pkgver="$(getpkgver "${pkgfile}")" || return 1
local _pkgarch="$(getpkgarch "${pkgfile}")" || return 1
-   local repo="${2}"
 
in_array "${repo}" "${PKGREPOS[@]}" || return 1
 
-   if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase} ]]; then
-   mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
-   arch_svn export -q 
"${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
-   "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" 
>/dev/null || return 1
-   fi
+   local vcsver vcsnames=()
+   read -rd'\n' vcsver vcsnames < <(source_pkgbuild "${_pkgbase}" 
"repos/${repo}-${_pkgarch}"; \
+get_full_version; echo "${pkgname[@]}")
+   read -ra vcsnames <<<"${vcsnames}"
 
-   local svnver="$(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; get_full_version)"
-   [[ "${svnver}" = "${_pkgver}" ]] || return 1
-
-   local svnnames=($(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}"))
-   in_array "${_pkgname}" "${svnnames[@]}" || return 1
+   [[ "${vcsver}" = "${_pkgver}" ]] || return 1
+   in_array "${_pkgname}" "${vcsnames[@]}" || return 1
 
return 0
 }
@@ -337,7 +329,7 @@ check_splitpkgs() {
local pkgfiles=("${@}")
local pkgfile
local pkgdir
-   local svnname
+   local vcsname
 
mkdir -p "${WORKDIR}/check_splitpkgs/"
pushd "${WORKDIR}/check_splitpkgs" >/dev/null
@@ -350,22 +342,16 @@ check_splitpkgs() {
mkdir -p "${repo}/${_pkgarch}/${_pkgbase}"
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
 
-   if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase} 
]]; then
-   mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}"
-   arch_svn export -q 
"${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
-   
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null || return 1
-   fi
-
-   local svnnames=($(. 
"${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}"))
-   printf '%s\n' "${svnnames[@]}" >> 
"${repo}/${_pkgarch}/${_pkgbase}/svn"
+   local vcsnames=($(source_pkgbuild "${_pkgbase}" 
"repos/${repo}-${_pkgarch}"; echo "${pkgname[@]}"))
+   printf '%s\n' "${vcsnames[@]}" >> 
"${repo}/${_pkgarch}/${_pkgbase}/vcs"
done
popd >/dev/null
 
for pkgdir in "${WORKDIR}/check_splitpkgs/${repo}"/*/*; do
[[ ! -d ${pkgdir} ]] && continue
sort -u 

[arch-projects] [dbscripts] [GIT] Official repo DB scripts annotated tag 20180603 created. 20180603

2018-07-03 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The annotated tag, 20180603 has been created
at  b9e1a487c7b89072904a5d6aabd8b827693e440f (tag)
   tagging  08995618eb606523b7d05ac987b1243981290839 (commit)
  replaces  20131102
 tagged by  Eli Schwartz
on  Tue Jul 3 22:05:48 2018 -0400

- Log -
Lots of fixes which presumably make us handle data more safely
-BEGIN PGP SIGNATURE-

iQJMBAABCgA2FiEEYEETBMCdNmKDQO7/zrFn77VyK9YFAls8LNEYHGVzY2h3YXJ0
ekBhcmNobGludXgub3JnAAoJEM6xZ++1civWMiIP/j3vBx4Ei2A7AvSn6/BDE54p
CpPTe5GD4DBp5x/X1Ja0aMpSvsMLs5dguesXglxBwZVPWNuDYcf/flP05V0uwK38
/0+b1dy/2Sn+tBh0fe/BxdiXfF6thH8axi8+92yonzEFhWz+TXRyg7IjGLALNaLu
DkWgC4YuLan+uuCqXBbQc7h0z+ZCE95fi4ymVrgA83VjFUp4Nkc46taQFgmN4lj7
mTCr962+9js2wm6shfeqbhSbYmj8KBXG9zdelE0uWgcpFz+Q9LgddDvqXFA4J9lW
ku+2AV9P+b+Zy838iduLDgshO2ZCd25tgSo87YngSLLxKfrpbf1HKcxW2ggZsWtk
xoO4AX3ElElSiFZL8gDUL9AQNpskfAck1Hrup71xKg8d2B3OrfAdrPef/8+cPLAR
5CQ+7a+NjmAcUbLo0fG5eAntgEM+foRqdRnnw2KgwvMwTj90BXi4soPPpf8CQ1gG
o0P/gnp0/f8IrzCd/PPOTRFnLfE/sGJFO65R2hVmlk3Y+xS7V+982sQirXj22wbF
3nTI1+eGrCLONhxGFM6moxQs/mF2FLQUJDCTC3jQdcv4d8/cKocKAWfSOuQHK8pH
ij9uu1qqKaBmW0VXu5pOpssg4hPZfFCWXtVWYXfKoDS62//08o5nVQPyq/iBMwOZ
C2MSqCydTte4YATTwkfH
=ihXJ
-END PGP SIGNATURE-

Dave Reisner (1):
  disallow packages without a valid PACKAGER

Eli Schwartz (17):
  Use return codes properly when checking for failed commands.
  Update messages to make full use of printf formatters
  ARCHES is an array, do not attempt to call it as a string
  Use modern bash to append to strings/arrays.
  Use more bashisms
  db-functions: deduplicate some repeated logic
  Use even more bashisms.
  Fix overloading PKGEXT to mean two things.
  db-update: replace external find command with bash globbing
  ftpdir-cleanup,sourceballs: replace external find command with bash 
globbing
  Globally set $PKGEXT to a bash extended glob representing valid choices.
  db-functions: unify the repo-add/repo-remove caller
  fixup! Update messages to make fuller use of printf formatters
  pacman 5.1 compatibility
  test: BUILDDIR must be owned by build user
  db-move: Don't store filepaths as a string with whitespace splitting
  hoist $tarch handling above $pkgname, since it is more efficient

Florian Pritz (1):
  Remove i686 from config

Jelle van der Waa (1):
  Disable integrity check for i686

Johannes Löthberg (1):
  config: add GPL3/LGPL3 to ALLOWED_LICENSES

Levente Polyak (1):
  disallow packages not built in a chroot

Luke Shumaker (18):
  test: db-update: verify that PKGEXT(S) is treated as a glob
  Update messages to make fuller use of printf formatters
  test: common.bash:__getCheckSum: Don't rely on IFS
  test: Fixup glob matching
  Export TMPDIR, and use mktemp -t instead of making it part of the template
  Normalize to tab indent
  Add "#!/hint/bash" to the beginning of several files
  Don't use `grep -q` when operating on piped stdin
  Remove uses of the "v=true; if $v ..." anti-pattern
  Fixups near unquoted variables
  Clean up printf-formatters for user messages
  README.md: fix spelling mistake: "overriden"->"overridden"
  README.md: Write an overview of the programs included
  test/: Verify that db-update won't release duplicate packages in the same 
transaction
  Fixup quoting around variables, especially arrays
  Consistently use "$(dirname "$(readlink -e "$0")")"
  devlist-mailer: Make LIST and FROM configurable
  test: Fix typoed variables

Pierre Schmitz (52):
  cron-jobs: Fix issues with empty repositories
  Remove separate creation of file databases
  Update bundled makepkg.conf
  Run tests using docker
  Add travis configuration
  Add editor configuration
  Compile tests into one file to reduce time spent on setup
  Simplify test setup
  Use a minimal travis environment
  testSuite is a simple file
  Fix package test
  Fix test package dependency
  Add ability to generate test coverage
  Replace bash script with Makefile
  Make test suite independent from code under test
  db-repo-add: Fix adding of 'any' packages
  db-repo-remove: Test removal of 'any' packages
  db-update: Check that packages with invalid signatures wont get added
  Signing packages is no longer optional
  ftpdir-cleanup: Test removal of old packages
  db-update: Disallow invalid package names
  db-update: Test if package cannot be added if svn is inconsistent
  db-update: Test package validation
  Make coverage folder writeable to the test user
  Avoid replacing the temporary dir by accident
  use makepkg library instead of local function copies
   

[arch-projects] [dbscripts] [PATCH 1/2] db-move: Don't store filepaths as a string with whitespace splitting

2018-07-02 Thread Eli Schwartz via arch-projects
Use arrays via nameref, since makepkg does not support multidimensional
arrays, and assigning to/retrieving from an array variable with an
unknown name requires this.

Requires bash 4.3, requires that architectures never contain chars that
are invalid in a variable name -- which makepkg explicitly requires in
order to support architecture-dependent sources/dependencies, and also
incorporates into linting checks which forbid anything but [[:alnum:]_]
so that's all good.

Signed-off-by: Eli Schwartz 
---
 db-move | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/db-move b/db-move
index 63e5c14c..c4da5bf9 100755
--- a/db-move
+++ b/db-move
@@ -60,8 +60,10 @@ done
 
 msg "Moving packages from [%s] to [%s]..." "$repo_from" "$repo_to"
 
-declare -A add_pkgs
-declare -A remove_pkgs
+for arch in "${ARCHES[@]}"; do
+   declare -a add_pkgs_$arch
+   declare -a remove_pkgs_$arch
+done
 for pkgbase in "${args[@]:2}"; do
tag_list=""
for pkgarch in "${ARCHES[@]}" 'any'; do
@@ -95,6 +97,8 @@ for pkgbase in "${args[@]:2}"; do
 
for pkgname in "${pkgnames[@]}"; do
for tarch in "${tarches[@]}"; do
+   declare -n add_pkgs="add_pkgs_${tarch}"
+   declare -n 
remove_pkgs="remove_pkgs_${tarch}"
pkgpath=$(getpkgfile 
"${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXTS})
pkgfile="${pkgpath##*/}"
 
@@ -102,8 +106,8 @@ for pkgbase in "${args[@]:2}"; do
if [[ -f 
${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]]; then
ln -s 
"../../../${PKGPOOL}/${pkgfile}.sig" "${ftppath_to}/${tarch}/"
fi
-   
add_pkgs[${tarch}]+="${FTP_BASE}/${PKGPOOL}/${pkgfile} "
-   remove_pkgs[${tarch}]+="${pkgname} "
+   
add_pkgs+=("${FTP_BASE}/${PKGPOOL}/${pkgfile}")
+   remove_pkgs+=("${pkgname}")
done
done
fi
@@ -113,9 +117,11 @@ for pkgbase in "${args[@]:2}"; do
 done
 
 for tarch in "${ARCHES[@]}"; do
-   if [[ -n ${add_pkgs[${tarch}]} ]]; then
-   arch_repo_modify add "${repo_to}" "${tarch}" 
${add_pkgs[${tarch}]}
-   arch_repo_modify remove "${repo_from}" "${tarch}" 
${remove_pkgs[${tarch}]}
+   declare -n add_pkgs="add_pkgs_${tarch}"
+   declare -n remove_pkgs="remove_pkgs_${tarch}"
+   if [[ -n ${add_pkgs[@]} ]]; then
+   arch_repo_modify add "${repo_to}" "${tarch}" "${add_pkgs[@]}"
+   arch_repo_modify remove "${repo_from}" "${tarch}" 
"${remove_pkgs[@]}"
fi
 done
 
-- 
2.18.0


[arch-projects] [dbscripts] [PATCH 2/2] hoist $tarch handling above $pkgname, since it is more efficient

2018-07-02 Thread Eli Schwartz via arch-projects
Signed-off-by: Eli Schwartz 
---
 db-move | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/db-move b/db-move
index c4da5bf9..b6448898 100755
--- a/db-move
+++ b/db-move
@@ -95,10 +95,10 @@ for pkgbase in "${args[@]:2}"; do
arch_svn rm --force -q "${svnrepo_from}"
tag_list+=", $pkgarch"
 
-   for pkgname in "${pkgnames[@]}"; do
-   for tarch in "${tarches[@]}"; do
-   declare -n add_pkgs="add_pkgs_${tarch}"
-   declare -n 
remove_pkgs="remove_pkgs_${tarch}"
+   for tarch in "${tarches[@]}"; do
+   declare -n add_pkgs="add_pkgs_${tarch}"
+   declare -n remove_pkgs="remove_pkgs_${tarch}"
+   for pkgname in "${pkgnames[@]}"; do
pkgpath=$(getpkgfile 
"${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXTS})
pkgfile="${pkgpath##*/}"
 
-- 
2.18.0


[arch-projects] [namcap] [PATCH] tests: pacman 5.1

2018-07-02 Thread Michael Straube via arch-projects
Signed-off-by: Michael Straube 
---
 Namcap/tests/package/test_sodepends.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Namcap/tests/package/test_sodepends.py 
b/Namcap/tests/package/test_sodepends.py
index 3a3d7b6..4188c35 100644
--- a/Namcap/tests/package/test_sodepends.py
+++ b/Namcap/tests/package/test_sodepends.py
@@ -56,13 +56,13 @@ package() {
)
self.assertEqual(pkg.detected_deps['pacman'], [
('libraries-needed %s %s',
-(str(['usr/lib/libalpm.so.10']), str(["usr/bin/main"]))
+(str(['usr/lib/libalpm.so.11']), str(["usr/bin/main"]))
)]
)
e, w, i = Namcap.depends.analyze_depends(pkg)
self.assertEqual(e, [
('dependency-detected-not-included %s (%s)',
-   ('pacman', "libraries ['usr/lib/libalpm.so.10'] 
needed in files ['usr/bin/main']"))
+   ('pacman', "libraries ['usr/lib/libalpm.so.11'] 
needed in files ['usr/bin/main']"))
])
self.assertEqual(w, [])
 
-- 
2.18.0


[arch-projects] [namcap] [PATCH] Add missing support for sha224 sums

2018-07-02 Thread Michael Straube via arch-projects
Namcap does not support sha224 checksums but makepkg does.
Add sha224 support.

Signed-off-by: Michael Straube 
---
 Namcap/rules/arrays.py  | 2 +-
 Namcap/rules/extravars.py   | 4 ++--
 Namcap/rules/missingvars.py | 2 +-
 parsepkgbuild.sh| 5 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Namcap/rules/arrays.py b/Namcap/rules/arrays.py
index 243816e..5ca33cc 100644
--- a/Namcap/rules/arrays.py
+++ b/Namcap/rules/arrays.py
@@ -29,7 +29,7 @@ class package(PkgbuildRule):
arrayvars = ['arch', 'license', 'groups', 'depends', 
'makedepends',
 'optdepends', 'checkdepends', 'provides', 'conflicts', 
'replaces',
 'backup', 'options', 'source', 'noextract', 'md5sums', 
'sha1sums',
-'sha256sums', 'sha384sums', 'sha512sums', 
'validpgpkeys']
+'sha224sums', 'sha256sums', 'sha384sums', 
'sha512sums', 'validpgpkeys']
for i in pkginfo.pkgbuild:
m = re.match('\s*(.*)\s*=\s*(.*)$', i)
for j in arrayvars:
diff --git a/Namcap/rules/extravars.py b/Namcap/rules/extravars.py
index df0c0bf..a10a878 100644
--- a/Namcap/rules/extravars.py
+++ b/Namcap/rules/extravars.py
@@ -26,8 +26,8 @@ class package(PkgbuildRule):
description = "Verifies that extra variables start with an underscore"
def analyze(self, pkginfo, tar):
carch_vars = ['checkdepends', 'conflicts', 'depends', 
'makedepends',
-'optdepends', 'provides', 'replaces', 'source', 
'md5sums',
-'sha1sums', 'sha256sums', 'sha384sums', 
'sha512sums']
+'optdepends', 'provides', 'replaces', 
'source', 'md5sums',
+'sha224sums', 'sha1sums', 'sha256sums', 
'sha384sums', 'sha512sums']
stdvars = ['arch', 'license', 'backup', 'noextract', 'pkgname',
 'pkgbase', 'pkgver', 'pkgrel', 'epoch', 
'pkgdesc', 'groups',
 'url', 'install', 'changelog',
diff --git a/Namcap/rules/missingvars.py b/Namcap/rules/missingvars.py
index 2b8811c..25445e2 100644
--- a/Namcap/rules/missingvars.py
+++ b/Namcap/rules/missingvars.py
@@ -30,7 +30,7 @@ class ChecksumsRule(PkgbuildRule):
name = "checksums"
description = "Verifies checksums are included in a PKGBUILD"
def analyze(self, pkginfo, tar):
-   checksums=[('md5', 32), ('sha1', 40), ('sha256', 64), 
('sha384', 96), ('sha512', 128)]
+   checksums=[('md5', 32), ('sha1', 40), ('sha224', 56), 
('sha256', 64), ('sha384', 96), ('sha512', 128)]
 
if "source" in pkginfo:
haschecksums = False
diff --git a/parsepkgbuild.sh b/parsepkgbuild.sh
index 12874f3..a158d1e 100644
--- a/parsepkgbuild.sh
+++ b/parsepkgbuild.sh
@@ -109,6 +109,11 @@ if [ -n "$sha1sums" ]; then
for i in "${sha1sums[@]}"; do echo $i; done
echo ""
 fi
+if [ -n "$sha224sums" ]; then
+   echo "%SHA224SUMS%"
+   for i in "${sha224sums[@]}"; do echo $i; done
+   echo ""
+fi
 if [ -n "$sha256sums" ]; then
echo "%SHA256SUMS%"
for i in "${sha256sums[@]}"; do echo $i; done
-- 
2.18.0


[arch-projects] [netctl] [GIT] Network control utility based on systemd branch master updated. 1.16-5-g4be6904

2018-06-26 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The branch, master has been updated
   via  4be6904e2518b5b13675439d6b89592e6bb4a6e3 (commit)
   via  580f80add61423343d8ec35363a5eab39989d104 (commit)
   via  e4638274ac7f84b749cdcbd8e93f06a5564280e7 (commit)
  from  1ae84f054368f012ffa3b70b873e24c35767f4d3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 4be6904e2518b5b13675439d6b89592e6bb4a6e3
Author: Jouke Witteveen 
Date:   Tue Jun 26 18:26:13 2018 +0200

1.17 release updates

commit 580f80add61423343d8ec35363a5eab39989d104
Author: Jouke Witteveen 
Date:   Tue Jun 26 17:58:34 2018 +0200

Small documentation updates

commit e4638274ac7f84b749cdcbd8e93f06a5564280e7
Author: Jouke Witteveen 
Date:   Sat Jun 23 13:14:25 2018 +0200

wifi-menu: Support UTF-8 encoded SSIDs (FS#45384)

Strictly speaking, we should check with the SSIDEncoding value sent out
by the station, as specified in the 2012 version of 802.11 (page 566),
but wpa_supplicant does not (yet) expose this information and stations
may not set the field to UTF-8 and still encode their SSID accordingly.

We therefore assume SSIDs to be UTF-8 encoded (the only real alternative
is treating SSIDs as raw byte string) in wifi-menu. Note that wifi-menu
is only provided as a convenience and many/most use cases involve
writing profile files manually.

When the current character map is not set to UTF-8, wifi-menu will only
use ASCII characters in its screen output.
This can be forced using for example `LC_CTYPE=C wifi-menu`.

Thanks to Declspeck  for their activity on the
Flyspray task.

---

Summary of changes:
 Makefile  |  2 +-
 NEWS  |  4 
 docs/netctl.profile.5.txt | 10 ++
 src/wifi-menu | 46 +-
 4 files changed, 44 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
Network control utility based on systemd


[arch-projects] [netctl] [GIT] Network control utility based on systemd annotated tag 1.17 created. 1.17

2018-06-26 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The annotated tag, 1.17 has been created
at  00116412c1b163ba2fe4b5ae6c77e4b09dcc68f0 (tag)
   tagging  4be6904e2518b5b13675439d6b89592e6bb4a6e3 (commit)
  replaces  1.16
 tagged by  Jouke Witteveen
on  Tue Jun 26 18:26:30 2018 +0200

- Log -
Release 1.17
-BEGIN PGP SIGNATURE-

iQFKBAABCAA0FiEEbql9KtO+F66lkufaVrYfv4JJLBUFAlsyaT4WHGoud2l0dGV2
ZWVuQGdtYWlsLmNvbQAKCRBWth+/gkksFbR+B/9D8qf1VB728c2wHC+1xnpWyLrS
9ImopurAVHECh0KGjI0wxlTWqQ61yXMEu9eejkUD7hxwMJAmzq/8BxnT/PbXMZlP
N4hdkDdhEYfgu0JULMTxuRdT6AhnRbUt/3MqZ0UP1r9CRZTiFmTIW10y6UrM5dIf
Mab36vSvYJuQI0zipyXT4NVOHj+n7cKhr34EgLyeJpDkfxBOL3h9h2bAl2Rx93ok
l42HibRFdRI72SCcxYj2yOmo3DhGUuuIn0HxwSxveS4uhReDduzdnUnbN6cB7JO0
LPkIN7iNftBR1NP8wryuN2mZ5CFatayayqvayTa/frtibeBLZBJ8EsRL726K
=g9be
-END PGP SIGNATURE-

Jouke Witteveen (5):
  Improved handling of exposed variables
  Code and comments streamlining
  wifi-menu: Support UTF-8 encoded SSIDs (FS#45384)
  Small documentation updates
  1.17 release updates

---


hooks/post-receive
-- 
Network control utility based on systemd


Re: [arch-projects] [netctl] [PATCH] wifi-menu: Support UTF-8 encoded SSIDs (FS#45384)

2018-06-26 Thread Emil Velikov via arch-projects
On 26 June 2018 at 11:34, Jouke Witteveen  wrote:
> On Tue, Jun 26, 2018 at 12:17 PM Emil Velikov  
> wrote:
>> On 23 June 2018 at 12:25, Jouke Witteveen via arch-projects
>>  wrote:
>> > Strictly speaking, we should check with the SSIDEncoding value sent out
>> > by the station, as specified in the 2012 version of 802.11 (page 566),
>> > but wpa_supplicant does not (yet) expose this information and stations
>> > may not set the field to UTF-8 and still encode their SSID accordingly.
>> >
>> I wonder if iwd (meant to be wpa_supplicant replacement) could help here.
>> Be that by exposing SSIDEncoding or setting it, as it detects UTF-8 in the 
>> SSID.
>
> As far as I can tell, only developers of iwd think of iwd as a
> wpa_supplicant replacement. Currently, it is lacking a CLI and
> documentation. Moreover, wpa_supplicant is tried and tested. While I
> try to not tie netctl in too strongly with any specific client,
> wpa_supplicant will likely be the client of choice for netctl for the
> foreseeable future.
>
I've noticed the iwctl and iwmon utils provided, although did not play
around with them.
You're on point though, sticking with wpa_supplicant for the
foreseeable future is fine.

> I submitted a patch to wpa_supplicant for exposing the UTF-8 SSID bit:
> http://lists.infradead.org/pipermail/hostap/2018-June/038658.html
> However, experimentation showed that it is not really used (yet?).
>
Vendors may start using it... one day

Thanks again for the comprehensive answers!
Emil


[arch-projects] [netctl] [PATCH] Simplify init_profiles() implementation

2018-06-26 Thread Emil Velikov via arch-projects
From: Emil Velikov 

Currently each profile is handles in two stages:
 - a unique value is returned for a set of patterns matches
 - depending on the value the profile/essid is added to global lists

A shorter and simpler solution is to omit the unnecessary value
passing/processing all together.

Cc: Jouke Witteveen 
Signed-off-by: Emil Velikov 
---
Jouke, let me know if you'd like this rebased on top of your patch.
Pardon if you're getting this twice. The initial submission was rejected
by the ML :-\
---
 src/wifi-menu | 40 ++--
 1 file changed, 14 insertions(+), 26 deletions(-)

diff --git a/src/wifi-menu b/src/wifi-menu
index 42c4c53..928cf5e 100755
--- a/src/wifi-menu
+++ b/src/wifi-menu
@@ -29,34 +29,22 @@ quote_safe() {
 fi
 }
 
-# Fill PROFILES and ESSIDS with the profile names and essids of the profiles
-# for interface $1
+# Fill GENERATED, PROFILES and ESSIDS with the profile names and essids of the
+# profiles for interface $1
 init_profiles() {
-local i=0 essid profile
+local i=0 profile
 while IFS= read -r profile; do
-essid=$(
-unset Interface ESSID
-source "$PROFILE_DIR/$profile" > /dev/null
-if [[ "$Interface" = "$1" && -n "$ESSID" ]]; then
-printf "%s" "$ESSID"
-if [[ "$Description" =~ "Automatically generated" ]]; then
-return 2
-else
-return 1
-fi
-fi
-return 0
-)
-case $? in
-2)
-GENERATED+=("$profile")
-;&
-1)
-PROFILES[i]=$profile
-ESSIDS[i]=$essid
-(( ++i ))
-;;
-esac
+unset Interface ESSID
+source "$PROFILE_DIR/$profile" > /dev/null
+if [[ "$Interface" != "$1" || -z "$ESSID" ]]; then
+continue;
+fi
+if [[ "$Description" =~ "Automatically generated" ]]; then
+GENERATED+=("$profile")
+fi
+PROFILES[i]=$profile
+ESSIDS[i]=$ESSID
+(( ++i ))
 done < <(list_profiles)
 }
 
-- 
2.18.0


Re: [arch-projects] [netctl] [PATCH] wifi-menu: Support UTF-8 encoded SSIDs (FS#45384)

2018-06-26 Thread Emil Velikov via arch-projects
Hi Jouke,

Thanks for fixing this!
Sharing a couple of ideas that come to mind.

On 23 June 2018 at 12:25, Jouke Witteveen via arch-projects
 wrote:
> Strictly speaking, we should check with the SSIDEncoding value sent out
> by the station, as specified in the 2012 version of 802.11 (page 566),
> but wpa_supplicant does not (yet) expose this information and stations
> may not set the field to UTF-8 and still encode their SSID accordingly.
>
I wonder if iwd (meant to be wpa_supplicant replacement) could help here.
Be that by exposing SSIDEncoding or setting it, as it detects UTF-8 in the SSID.


> @@ -38,6 +43,9 @@ init_profiles() {
>  unset Interface ESSID
>  source "$PROFILE_DIR/$profile" > /dev/null
>  if [[ "$Interface" = "$1" && -n "$ESSID" ]]; then
> +if [[ "$ESSID" = \"\"*\" ]]; then
> +ESSID=${ESSID:2:-1}
> +fi
FYI, I will send out a small patch which simplifying init_profiles.
It will cause a trivial conflict so I can rebase it on top of this
patch, if you prefer.

> @@ -221,6 +237,8 @@ ensure_root "$(basename "$0")"
>  if ! type dialog &> /dev/null; then
>  exit_error "Please install 'dialog' to use wifi-menu"
>  fi
> +CHARMAP=$(locale charmap)
> +cd /  # We do not want to spawn anything that can block unmounting
>
Was the "cd /" line moved by mistake?

Other than the cd nitpick, the patch looks great. FWIW
Reviewed-by: Emil Velikov 

HTH
Emil


[arch-projects] [netctl] [PATCH] wifi-menu: Support UTF-8 encoded SSIDs (FS#45384)

2018-06-23 Thread Jouke Witteveen via arch-projects
Strictly speaking, we should check with the SSIDEncoding value sent out
by the station, as specified in the 2012 version of 802.11 (page 566),
but wpa_supplicant does not (yet) expose this information and stations
may not set the field to UTF-8 and still encode their SSID accordingly.

We therefore assume SSIDs to be UTF-8 encoded (the only real alternative
is treating SSIDs as raw byte string) in wifi-menu. Note that wifi-menu
is only provided as a convenience and many/most use cases involve
writing profile files manually.

When the current character map is not set to UTF-8 , wifi-menu will only
use ASCII characters in its screen output.
This can be forced using for example `LC_CTYPE=C wifi-menu`.
---
 src/wifi-menu | 40 ++--
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/wifi-menu b/src/wifi-menu
index 42c4c53..525830f 100755
--- a/src/wifi-menu
+++ b/src/wifi-menu
@@ -20,6 +20,11 @@ Arguments:
 END
 }
 
+# Undo printf escaping in $1
+printf_decode() {
+printf -- "${1//%/%%}"
+}
+
 # Prepare $1 for use in a special quoting context
 quote_safe() {
 if [[ "$1" = \"* ]]; then
@@ -38,6 +43,9 @@ init_profiles() {
 unset Interface ESSID
 source "$PROFILE_DIR/$profile" > /dev/null
 if [[ "$Interface" = "$1" && -n "$ESSID" ]]; then
+if [[ "$ESSID" = \"\"*\" ]]; then
+ESSID=${ESSID:2:-1}
+fi
 printf "%s" "$ESSID"
 if [[ "$Description" =~ "Automatically generated" ]]; then
 return 2
@@ -62,14 +70,19 @@ init_profiles() {
 
 # Build ENTRIES as an argument list for dialog based on scan results in $1
 init_entries() {
-local i=0 sep=$'\t' flags signal ssid
+local i=0 sep=$'\t' decoded flags signal ssid
 while IFS=$'\t' read -r signal flags ssid; do
+decoded=$(printf_decode "$ssid")
 ENTRIES[i++]="--"  # the SSID might look like an option to dialog
-ENTRIES[i++]=$ssid
-if is_yes "${CONNECTED:-no}" && [[ "$ssid" = "$CONNECTION" ]]; then
+if [[ "$CHARMAP" = "UTF-8" ]]; then
+ENTRIES[i++]=$decoded
+else
+ENTRIES[i++]=$ssid
+fi
+if is_yes "${CONNECTED:-no}" && [[ "$decoded" = "$CONNECTION" ]]; then
 ENTRIES[i]="*"  # Currently connected
-elif in_array "$ssid" "${ESSIDS[@]}"; then
-if in_array "$(ssid_to_profile "$ssid")" "${GENERATED[@]}"; then
+elif in_array "$decoded" "${ESSIDS[@]}"; then
+if in_array "$(ssid_to_profile "$decoded")" "${GENERATED[@]}"; then
 ENTRIES[i]="."  # Automatically generated
 else
 ENTRIES[i]=":"  # Handmade
@@ -115,11 +128,14 @@ Do you want to overwrite it?"
 
 # Create a profile for ssid $1
 create_profile() {
-local box flags key msg security
-PROFILE="$INTERFACE-${1//\//_}"
+local box flags key msg security signal ssid
+PROFILE=$(iconv -c -f UTF-8 -t //TRANSLIT <<< "$1")
+PROFILE="$INTERFACE-${PROFILE//[?\/]/_}"
 [[ -e "$PROFILE_DIR/$PROFILE" ]] && PROFILE+=".wifi-menu"
 confirm_profile || return $?
-flags=$(grep -m 1 $'\t'"$1\$" "$NETWORKS" | cut -f 2)
+while IFS=$'\t' read -r signal flags ssid; do
+[[ "$(printf_decode "$ssid")" != "$1" ]] || break
+done < "$NETWORKS"
 if [[ "$flags" =~ WPA|WEP ]]; then
 security=${BASH_REMATCH[0],,}
 else
@@ -221,6 +237,8 @@ ensure_root "$(basename "$0")"
 if ! type dialog &> /dev/null; then
 exit_error "Please install 'dialog' to use wifi-menu"
 fi
+CHARMAP=$(locale charmap)
+cd /  # We do not want to spawn anything that can block unmounting
 
 INTERFACE=$1
 if [[ -z "$INTERFACE" ]]; then
@@ -237,7 +255,6 @@ elif ! is_interface "$INTERFACE"; then
 fi
 load_interface_config "$INTERFACE"
 
-cd /  # We do not want to spawn anything that can block unmounting
 if [[ "$RFKill" && "$(rf_status "$INTERFACE" "$RFKill")" ]]; then
 if ! rf_enable "$INTERFACE" "$RFKill"; then
 exit_error "Could not unblock transmission on interface '$INTERFACE'"
@@ -247,7 +264,7 @@ fi
 
 echo -n "Scanning for networks... "
 if CONNECTION=$(wpa_call "$INTERFACE" status 2> /dev/null | grep -m 1 
"^ssid="); then
-CONNECTION=${CONNECTION#ssid=}
+CONNECTION=$(printf_decode "${CONNECTION#ssid=}")
 CONNECTED=yes
 fi
 NETWORKS=$(wpa_supplicant_scan "$INTERFACE" 3,4,5)
@@ -270,6 +287,9 @@ Flags description:
 CHOICE=$(dialog --menu "$MSG" 24 50 12 "${ENTRIES[@]}" --stdout)
 RETURN=$?
 if (( RETURN == 0 )); then
+if [[ "$CHARMAP" != "UTF-8" ]]; then
+CHOICE=$(printf_decode "$CHOICE")
+fi
 connect_to_ssid "$CHOICE"
 RETURN=$?
 fi
-- 
2.18.0


[arch-projects] [netctl] [GIT] Network control utility based on systemd branch master updated. 1.16-2-g1ae84f0

2018-06-23 Thread Jouke Witteveen via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Network control utility based on systemd".

The branch, master has been updated
   via  1ae84f054368f012ffa3b70b873e24c35767f4d3 (commit)
   via  8c873b494c4df5c64af64aa6b1abb898d9a5301f (commit)
  from  dbc32d470420396f4af360af9ac17680fe99b368 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 1ae84f054368f012ffa3b70b873e24c35767f4d3
Author: Jouke Witteveen 
Date:   Sat Jun 23 12:51:29 2018 +0200

Code and comments streamlining

commit 8c873b494c4df5c64af64aa6b1abb898d9a5301f
Author: Jouke Witteveen 
Date:   Sat Jun 23 12:41:51 2018 +0200

Improved handling of exposed variables

Hooks can now tell the command to be executed by looking at $Command.
The value will be "start", "stop", or "" (undefined), depending on the
reason a profile is being sourced.

---

Summary of changes:
 src/lib/connections/ethernet | 11 ---
 src/lib/globals  |  1 +
 src/lib/network  |  3 ++-
 src/lib/wpa  | 23 ---
 src/wifi-menu| 34 +-
 5 files changed, 32 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
Network control utility based on systemd


Re: [arch-projects] [dbscripts] [PATCH 0/5] Be less tightly coupled with SVN

2018-06-22 Thread Eli Schwartz via arch-projects
On 06/19/2018 12:20 AM, Luke Shumaker wrote:
> From: Luke Shumaker 
> 
> This patchset is intended to clean up dbscripts' interaction with SVN.
> Besides (IMO) improved code clarity, this should make it easier for those
> who wish to replace SVN with something else.
> 
> There are two major themes here:
>  1. Avoid asking SVN for information; to the extent possible, get all
> information directly from the pacman repos.

Why is this a goal? Especially, because currently dbscripts will error
out on you if you do something like create a PKGBUILD in a directory
that doesn't match the pkgbase. This is a feature, because we don't want
that to happen.

We want the PKGBUILDs repository to match the expected pacman repository
action, so this information should always be sourced from the PKGBUILD.

There's a WIP rewrite here:
https://wiki.archlinux.org/index.php/User:Bluewind/dbscripts-rewrite

Which has e.g. get_file_from_pkgrepo which cat's the PKGBUILD in a
VCS-agnostic manner. This is the direction I think we want to take, and
IMHO also has a lot more code clarity than a mini awk program reading
from pacman's technically undocumented database format (makepkg/PKGBUILD
is quite well documented, I'm not sure we make any guarantees about the
database format except that libalpm can read it).

>  2. Isolate SVN-interfacing code in to functions; making it clear what
> interfaces the PKGBUILD tracking needs to provide.

The dbscripts-rewrite aims to do this too, but in a very different way.
I'd like to keep to those semantics in order to reduce the effort it
takes to merge those changes.

> This does not touch the test suite, which is still firmly SVN-dependent.
> 
> I've cc'd Florian Pritz because of his related work on migrating to git.
> https://wiki.archlinux.org/index.php/User:Bluewind/dbscripts-rewrite
> 
> Luke Shumaker (5):
>   db-move, db-remove: Don't parse PKGBUILD files
>   db-move: Clarify the flow of the preflight check
>   testing2x: Discover correct repos based on the DBEXT files, not SVN
>   Centralize all SVN access into 'abs_*' functions in a new 'db-abs'
> file
>   db-move, db-abs: Simplify the abs_move_* functions
> 
>  cron-jobs/sourceballs |   4 +-
>  db-abs| 114 ++
>  db-functions  |  61 +++---
>  db-move   |  95 +--
>  db-remove |  18 ++-
>  testing2x |  40 +++
>  6 files changed, 204 insertions(+), 128 deletions(-)
>  create mode 100644 db-abs
> 


-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch pacman-git deleted. 20131102-88-g2c68135

2018-06-19 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, pacman-git has been deleted
   was  2c68135f4ab9db048db460bc949322ad7bb418eb

- Log -
2c68135f4ab9db048db460bc949322ad7bb418eb pacman 5.1 compatibility
---


hooks/post-receive
-- 
Official repo DB scripts


[arch-projects] [dbscripts] [GIT] Official repo DB scripts branch master updated. 20131102-89-g05dd9be

2018-06-19 Thread Eli Schwartz via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Official repo DB scripts".

The branch, master has been updated
   via  05dd9be0db06d7f7cea0eff9f9f6f1993eb6d463 (commit)
   via  2c68135f4ab9db048db460bc949322ad7bb418eb (commit)
  from  656fd6d5d8f455492b1e51add9e6e1da8f911a7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 05dd9be0db06d7f7cea0eff9f9f6f1993eb6d463
Author: Eli Schwartz 
Date:   Mon May 28 19:45:15 2018 -0400

test: BUILDDIR must be owned by build user

pacman 5.1 enforces this restriction. OTOH it is a simpler setup to set
this as the user homedir directly in account creation (just like
makechrootpkg has always done) than to create an additional,
world-writable, directory.

dockerfile: don't use tmpfs for /build

---

Summary of changes:
 Makefile | 2 +-
 test/Dockerfile  | 3 +--
 test/lib/common.bash | 9 -
 3 files changed, 6 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Official repo DB scripts


Re: [arch-projects] [devtools] [PATCH] test: common.bash: Fix syntax mistake: $pkgarches[@] -> ${pkgarches[@]}

2018-06-15 Thread Eli Schwartz via arch-projects
On 06/15/2018 04:57 PM, Luke Shumaker wrote:
> From: Luke Shumaker 

1) dbscripts, not devtools :)

2) could you squash these as "fix typoed variables"? They're in theme
with each other, no need to commit each instance as a separate commit.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [archweb] [PATCH 1/1] Highlighting row on hover in the search results. FS#53612

2018-06-10 Thread nodivbyzero via arch-projects
---
 sitestatic/archweb.css | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css
index 209561f..ef178e8 100644
--- a/sitestatic/archweb.css
+++ b/sitestatic/archweb.css
@@ -698,11 +698,19 @@ table.results {
 }
 
 .results tr.odd {
+background: #f5f5f5;
+}
+
+.results tr.odd:hover {
 background: #fff;
 }
 
 .results tr.even {
-background: #e4eeff;
+background: #ccdfff;
+}
+
+.results tr.even:hover {
+background: #b3cfff;
 }
 
 .results .flagged {
-- 
2.17.0


[arch-projects] [projects][pacman] [PATCH] libalpm: ignore .hook suffix when sorting hooks

2018-06-09 Thread Jouke Witteveen via arch-projects
It is desirable to have 'a-post.hook' ordered after 'a.hook'. For this,
it is needed to ignore the suffix when sorting.
---

Two years ago, I suggested this patch in https://bugs.archlinux.org/task/49653.
Today, I do so again :-).

Regards,
- Jouke

 lib/libalpm/hook.c | 16 
 lib/libalpm/hook.h |  2 ++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/lib/libalpm/hook.c b/lib/libalpm/hook.c
index 0805e661..d90ed2da 100644
--- a/lib/libalpm/hook.c
+++ b/lib/libalpm/hook.c
@@ -551,7 +551,16 @@ static int _alpm_hook_triggered(alpm_handle_t *handle, 
struct _alpm_hook_t *hook
 
 static int _alpm_hook_cmp(struct _alpm_hook_t *h1, struct _alpm_hook_t *h2)
 {
-   return strcmp(h1->name, h2->name);
+   size_t suflen = strlen(ALPM_HOOK_SUFFIX), l1, l2;
+   int ret;
+   l1 = strlen(h1->name) - suflen;
+   l2 = strlen(h2->name) - suflen;
+   /* exclude the suffixes from comparison */
+   ret = strncmp(h1->name, h2->name, l1 <= l2 ? l1 : l2);
+   if(ret == 0 && l1 != l2) {
+   return l1 < l2 ? -1 : 1;
+   }
+   return ret;
 }
 
 static alpm_list_t *find_hook(alpm_list_t *haystack, const void *needle)
@@ -634,8 +643,7 @@ int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t 
when)
alpm_event_hook_t event = { .when = when };
alpm_event_hook_run_t hook_event;
alpm_list_t *i, *hooks = NULL, *hooks_triggered = NULL;
-   const char *suffix = ".hook";
-   size_t suflen = strlen(suffix), triggered = 0;
+   size_t suflen = strlen(ALPM_HOOK_SUFFIX), triggered = 0;
int ret = 0;
 
for(i = alpm_list_last(handle->hookdirs); i; i = alpm_list_previous(i)) 
{
@@ -681,7 +689,7 @@ int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t 
when)
memcpy(path + dirlen, entry->d_name, name_len + 1);
 
if(name_len < suflen
-   || strcmp(entry->d_name + name_len - 
suflen, suffix) != 0) {
+   || strcmp(entry->d_name + name_len - 
suflen, ALPM_HOOK_SUFFIX) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "skipping 
non-hook file %s\n", path);
continue;
}
diff --git a/lib/libalpm/hook.h b/lib/libalpm/hook.h
index 364d22d7..30d565df 100644
--- a/lib/libalpm/hook.h
+++ b/lib/libalpm/hook.h
@@ -22,6 +22,8 @@
 
 #include "alpm.h"
 
+#define ALPM_HOOK_SUFFIX ".hook"
+
 int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t when);
 
 #endif /* ALPM_HOOK_H */
-- 
2.17.1


Re: [arch-projects] [devtools] [PATCH v2] makechrootpkg: respect GNUPGHOME

2018-05-31 Thread Bruno Pagani via arch-projects
Le 27/02/2018 à 17:16, Emiel Wiedijk via arch-projects a écrit :

> Previously, makechrootpkg hardcoded ~/.gnupg. Therefore, if a user
> uses a custom GPG home directory, the siganture checking would fail.
> Now makechrootpkg uses $GNUPGHOME, with a fallback to ~/.gnupg.
>
> Signed-off-by: Emiel Wiedijk 
> ---
>  makechrootpkg.in | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/makechrootpkg.in b/makechrootpkg.in
> index afcd121..653847f 100644
> --- a/makechrootpkg.in
> +++ b/makechrootpkg.in
> @@ -252,7 +252,8 @@ download_sources() {
>   chmod 1777 "$builddir"
>  
>   # Ensure sources are downloaded
> - sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
> + sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
> + env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
>   makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o 
> ||
>   die "Could not download sources."
>  
> @@ -341,7 +342,7 @@ main() {
>   [[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid 
> makepkg user.'
>   makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
>  
> - check_root SOURCE_DATE_EPOCH
> + check_root SOURCE_DATE_EPOCH,GNUPGHOME
>  
>   # Canonicalize chrootdir, getting rid of trailing /
>   chrootdir=$(readlink -e "$passeddir")

Does not seem to work for me:
GNUPGHOME=/path/to/svn-community/.gnupg/ extra-x86_64-build
…
==> Verifying source file signatures with gpg...
    flickcurl-1.26.tar.gz ... FAILED (unknown public key 43EC92504F71955A)
…

(I have previously retrieved this key using
`GNUPGHOME=/path/to/svn-community/.gnupg/ gpg --recv-keys
43EC92504F71955A` of course)



signature.asc
Description: OpenPGP digital signature


[arch-projects] [devtools] [GIT] The official devtools repository annotated tag 20170824 created. 20170824

2018-05-31 Thread Jan Steffens via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official devtools repository".

The annotated tag, 20170824 has been created
at  97687a9ed53b5f10e6e2768770706cc3e8a02e7e (tag)
   tagging  24a298d475ae0af6d8d0a109b9476dd567cbdf7b (commit)
  replaces  20170813
 tagged by  Jan Alexander Steffens (heftig)
on  Thu Aug 24 17:21:17 2017 +0200

- Log -
Version 20170824
-BEGIN PGP SIGNATURE-

iQEzBAABCAAdFiEEghj4iEmqxSLpTPRwpekojE+kFfoFAlme7u0ACgkQpekojE+k
FfqleggAsM3cViq2lFxHvwN+vlx5me3MJOJ1vnc6zQZwn4GFSWDZXXMUTBWogPXh
Ahrs3FCZjUQdI3ZB+3ph5ztQVRWF36UbMAq6Q9IO6XfpMyidJynq7ly6VPdRDA3v
B6f5BiofKlRN3ExLi3wATaBXBemrrqH10LoQUcnqdAN3Gh66oIv8p4Ti749UaLC/
MDxLjZFYuzB5P91RQ0Puv26sHrkDFgMjMoGB9GaZ+GIN51UNBQRjh9IuUX8xNfrr
xmG/ojtKSWkVSpdyRIV3sGm6Cjs84AhXdiV3LdbWuXCjO9741FEyzyQSzD6t4crj
nYWaIOBVNdkhX9ZRnubLHcDCZhLVqw==
=VhQP
-END PGP SIGNATURE-

Jan Alexander Steffens (heftig) (3):
  arch-nspawn: Add --keep-unit to prevent scope conflicts
  makechrootpkg: Also look for -e as --noextract
  Version 20170824

Martchus (1):
  makechrootpkg: Prevent removing build dir when --noextract specified

---


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20180528-3-g6364b3c

2018-05-31 Thread Jan Steffens via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official devtools repository".

The branch, master has been updated
   via  6364b3c9b9fae2b43bf3e02b9e84c814fc3f502f (commit)
   via  98ff92f4675aeab379b9d5ed85e68778e1cc0dfe (commit)
  from  e414173f8984485ff850e1fba0f8cf97cd970064 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 6364b3c9b9fae2b43bf3e02b9e84c814fc3f502f
Author: Jan Alexander Steffens (heftig) 
Date:   Thu May 31 16:05:49 2018 +0200

Version 20180531

commit 98ff92f4675aeab379b9d5ed85e68778e1cc0dfe
Author: Eli Schwartz via arch-projects 
Date:   Tue May 29 17:23:10 2018 -0400

makechrootpkg: whitelist return code 14 from makepkg

makepkg 5.1 implements error codes, and 14 means that installing the
packages after they were built has failed. We don't care about this
error and would like makechrootpkg to succeed regardless, e.g. for split
packages that are mutually exclusive.

Signed-off-by: Eli Schwartz 

---

Summary of changes:
 Makefile | 2 +-
 makechrootpkg.in | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The official devtools repository


Re: [arch-projects] [pyalpm] Workaround https://bugs.python.org/issue33012

2018-05-30 Thread Chih-Hsuan Yen via arch-projects
No problem! Thanks for the fast fix and the release!


Jelle van der Waa 於 西元2018年05月30日 15:05 寫道:
> On 05/28/18 at 03:25pm, Chih-Hsuan Yen via arch-projects wrote:
>> This fixes building with GCC 8
>> ---
>>  setup.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/setup.py b/setup.py
>> index 887b7a1..ba3ae2a 100644
>> --- a/setup.py
>> +++ b/setup.py
>> @@ -9,7 +9,7 @@ os.putenv('LC_CTYPE', 'en_US.UTF-8')
>>  pyalpm_version = '0.8'
>>  
>>  cflags = ['-Wall', '-Wextra', '-Werror',
>> -'-Wno-unused-parameter',
>> +'-Wno-unused-parameter', '-Wno-cast-function-type',
>>  '-std=c99', '-D_FILE_OFFSET_BITS=64']
>>  
>>  alpm = Extension('pyalpm',
>> -- 
>> 2.17.0
> Sorry, I've already fixed this in master before I was aware of this
> patch.
>




signature.asc
Description: OpenPGP digital signature


[arch-projects] [devtools] [PATCH] makechrootpkg: whitelist return code 14 from makepkg

2018-05-29 Thread Eli Schwartz via arch-projects
makepkg 5.1 implements error codes, and 14 means that installing the
packages after they were built has failed. We don't care about this
error and would like makechrootpkg to succeed regardless, e.g. for split
packages that are mutually exclusive.

Signed-off-by: Eli Schwartz 
---
 makechrootpkg.in | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 37e97e7..d81be84 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -226,6 +226,13 @@ _chrootbuild() {
# ${1} is OK, but $foo or $1 isn't.
# https://bugzilla.sudo.ws/show_bug.cgi?id=765
sudo --preserve-env=SOURCE_DATE_EPOCH -iu builduser bash -c 'cd 
/startdir; makepkg "$@"' -bash "$@"
+   ret=$?
+   case $ret in
+   0|14)
+   return 0;;
+   *)
+   return $ret;;
+   esac
 }
 
 _chrootnamcap() {
-- 
2.17.0


[arch-projects] [namcap][PATCH] A handful of corrections to the namcap usage output

2018-05-29 Thread Sean Enck via arch-projects
noticed the following items in the usage output of namcap:
1. Displaying the site-packages path of namcap and not just 'namcap'
2. Missing long options in usage output
3. Not displaying anything about -h/--help (even if that's a given)

Signed-off-by: Sean Enck 
---
 namcap.py | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/namcap.py b/namcap.py
index b62a2fa..8940e88 100755
--- a/namcap.py
+++ b/namcap.py
@@ -41,16 +41,17 @@ def get_modules():
 def usage():
"""Display usage information"""
print("")
-   print("Usage: " + sys.argv[0] + " [OPTIONS] packages")
+   print("Usage: namcap [OPTIONS] packages")
print("")
print("Options are:")
print("-L, --list   : list available rules")
-   print("-i   : prints information 
(debug) responses from rules")
-   print("-m   : makes the output 
parseable (machine-readable)")
+   print("-i, --info   : prints information 
(debug) responses from rules")
+   print("-m, --machine-readable   : makes the output 
parseable (machine-readable)")
print("-e rulelist, --exclude=rulelist  : don't apply RULELIST 
rules to the package")
print("-r rulelist, --rules=rulelist: only apply RULELIST rules 
to the package")
-   print("-t tags  : use a custom tag file")
-   print("-v version   : print version and exit")
+   print("-t filename, --tags=filename : use a custom tag file")
+   print("-v, --version: print version and exit")
+   print("-h, --help   : print help and exit")
 
sys.exit(2)
 
-- 
2.17.0


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20180528-1-ge414173

2018-05-28 Thread Allan McRae via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official devtools repository".

The branch, master has been updated
   via  e414173f8984485ff850e1fba0f8cf97cd970064 (commit)
  from  7fcf847bc37fb014d38dcb5c37ea3abc75e1889a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit e414173f8984485ff850e1fba0f8cf97cd970064
Author: Allan McRae 
Date:   Tue May 29 10:42:47 2018 +1000

update makefile for current version

Signed-off-by: Allan McRae 

---

Summary of changes:
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository annotated tag 20180528 created. 20180528

2018-05-28 Thread Allan McRae via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official devtools repository".

The annotated tag, 20180528 has been created
at  c762f19bc49b9c0552ff8c63c4637d9b85b6d26e (tag)
   tagging  7fcf847bc37fb014d38dcb5c37ea3abc75e1889a (commit)
  replaces  20171108
 tagged by  Allan McRae
on  Tue May 29 10:39:37 2018 +1000

- Log -
20180528
-BEGIN PGP SIGNATURE-

iQEzBAABCAAdFiEEZkWwqMcAXnjbHXhk+Z/+D+rpmb0FAlsMoUkACgkQ+Z/+D+rp
mb0FzggAiWR7Wv026xD9B/V3og0x5KT0WVw5j3ZmwjFBKhLlILgF52ZArklAgeIS
bagXKpU7SyPzwTeJlHSVLcksssDo0hIVwyv71bvicEQC5RmG66WPVq6PRFSxAjpq
UfReFYmAt02RWfvvTiV79bwnkd3e+3FhHdFBETil0a+xQ5xg4iOKHkhLndUAd2Qd
B9szH924NCh+2PjnDzHKBb3stITNaJzz+BKKmZ5OKFsX3Dd8ql9sj3nJgYSErasb
3/MRXImFtr2P3EHQt+FFRe8P6ybAfqhbUvBPknL+NZgVucV/LoX2dTxT3DGBCjSH
aiUBvtBwKamt7YxQauaQsoDr5oOMfA==
=9dFB
-END PGP SIGNATURE-

Bartłomiej Piotrowski (2):
  makechrootpkg: make sure that makepkg.conf is always parsed as text
  Remove corepkg symlink

Eli Schwartz (8):
  Support reproducible builds
  makechrootpkg: Fix unconditionally running namcap
  makechrootpkg: Fix anti-pattern when checking for enabled features
  makechrootpkg: fix verifysource with pacman-git
  makechrootpkg: Do not copy the user keyring into the chroot.
  Revert "arch-nspawn: Work around pacman master returning file-URLs from 
the cache"
  Proper fix for pacman-git returning file urls from the cache
  Do not assume the makechrootpkg user's groupname is the same as the 
username

Emiel Wiedijk (1):
  makechrootpkg: respect GNUPGHOME

Evangelos Foutras (2):
  Revert "makechrootpkg: Reopen console to assign the CTTY"
  makechrootpkg: add /etc/shadow entry for builduser

Luke Shumaker (4):
  arch-nspawn: make sure that makepkg.conf is always parsed as text
  arch-nspawn: Remove pointless $(echo ...) subshell
  lib/common.sh: Adjust to work properly with `set -u`
  makechrootpkg: Adjust to work properly with `set -e`

---


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20171108-17-g7fcf847

2018-05-28 Thread Allan McRae via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official devtools repository".

The branch, master has been updated
   via  7fcf847bc37fb014d38dcb5c37ea3abc75e1889a (commit)
   via  5b3c14454a9c1ec00a3ef11f3f599281127b383d (commit)
   via  4408bb2a1529b5a1e62e12ac617daac945d44e27 (commit)
   via  509c00ea23e676d97072786f1fbe97dc23fa898b (commit)
  from  5713cd629c97c7a12a600a1dd73ad81d87374eb1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 7fcf847bc37fb014d38dcb5c37ea3abc75e1889a
Author: Eli Schwartz 
Date:   Wed May 16 10:37:55 2018 -0400

Do not assume the makechrootpkg user's groupname is the same as the username

chown support "$user:$group" but also "$user:" which infers $group
rather than leaving it as root. This looks up the group name in cases
where the default group is e.g. "users" and users do not get their own
unique groups.

commit 5b3c14454a9c1ec00a3ef11f3f599281127b383d
Author: Eli Schwartz 
Date:   Sat Sep 30 23:40:47 2017 -0400

Proper fix for pacman-git returning file urls from the cache

It is much nicer to use a proper configuration parser to retrieve the
primary mirror, rather than clever hacks using undocumented APIs,
especially when their behavior as used then breaks in later releases.

Fortunately, pacutils exists now and pacconf handles this quite
elegantly. It has since been moved to pacman-git proper.

Check if pacman-conf from a new enough version of pacman exists and
fallback on pacconf from pacutils.

commit 4408bb2a1529b5a1e62e12ac617daac945d44e27
Author: Eli Schwartz 
Date:   Sat Sep 30 23:31:23 2017 -0400

Revert "arch-nspawn: Work around pacman master returning file-URLs from the 
cache"

This reverts commit eb6b0e3f11279b6512b1469ff042d2982eaaeef4.

This never worked, as pacman-git returns file urls from the cache anyway
and pacman stable doesn't have any problem at all. Having useless code
which makes people think the issue is solved when it really isn't, is
bloat, so remove it.

commit 509c00ea23e676d97072786f1fbe97dc23fa898b
Author: Eli Schwartz 
Date:   Mon Jan 15 12:36:45 2018 -0500

makechrootpkg: Do not copy the user keyring into the chroot.

Since commit 75fdff1811a0487f82c75b2e260da905102b4eea we no longer run
integrity checks inside the chroot anyway, so this is no longer needed
and will never be used.

---

Summary of changes:
 arch-nspawn.in   | 3 ++-
 makechrootpkg.in | 9 ++---
 2 files changed, 4 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
The official devtools repository


Re: [arch-projects] [dbscripts] [PATCH 2/2] test: BUILDDIR must be owned by build user

2018-05-28 Thread Eli Schwartz via arch-projects
On 05/28/2018 08:02 PM, Eli Schwartz wrote:
> pacman 5.1 enforces this restriction. OTOH it is a simpler setup to set
> this as the user homedir directly in account creation (just like
> makechrootpkg has always done) than to create an additional,
> world-writable, directory.
> 
> Signed-off-by: Eli Schwartz 
> ---
>  test/Dockerfile | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/test/Dockerfile b/test/Dockerfile
> index 3913f007..83c84499 100644
> --- a/test/Dockerfile
> +++ b/test/Dockerfile
> @@ -2,8 +2,7 @@ FROM archlinux/base
>  RUN pacman -Syu --noconfirm --needed sudo fakeroot awk subversion make kcov 
> bash-bats gettext grep
>  RUN pacman-key --init
>  RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
> -RUN useradd -N -g users -G wheel -m tester
> -RUN install -d -m 1777 /build
> +RUN useradd -N -g users -G wheel -d /build -m tester
>  USER tester
>  RUN echo -e "\
>  Key-Type: RSA\n\

I cannot see why this does not work, but
https://travis-ci.org/archlinux/dbscripts/builds/384957987#L583 and
https://travis-ci.org/archlinux/dbscripts/builds/384957987#L597

Despite useradd being told to create the homedir "/build", it doesn't
seem to exist in the container.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


[arch-projects] [dbscripts] [PATCH 1/2] pacman 5.1 compatibility

2018-05-28 Thread Eli Schwartz via arch-projects
The print_all_package_names function changed its behavior, adapt

Signed-off-by: Eli Schwartz 
---
 test/lib/common.bash | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/test/lib/common.bash b/test/lib/common.bash
index 36c735fd..738cc972 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -30,7 +30,7 @@ __buildPackage() {
local cache
local pkgarches
local tarch
-   local pkgnames
+   local pkgfiles
 
if [[ -n ${BUILDDIR} ]]; then
cache=${BUILDDIR}/$(__getCheckSum PKGBUILD)
@@ -45,14 +45,14 @@ __buildPackage() {
for tarch in ${pkgarches[@]}; do
if [ "${tarch}" == 'any' ]; then
PKGDEST=${pkgdest} PKGEXT=${PKGEXT} makepkg -c
+   mapfile -tO "${#pkgfiles[@]}" pkgfiles < 
<(PKGDEST=${pkgdest} PKGEXT=${PKGEXT} makepkg --packagelist)
else
PKGDEST=${pkgdest} PKGEXT=${PKGEXT} CARCH=${tarch} 
makepkg -c
+   mapfile -tO "${#pkgfiles[@]}" pkgfiles < 
<(PKGDEST=${pkgdest} PKGEXT=${PKGEXT} CARCH=${tarch} makepkg --packagelist)
fi
done
 
-   pkgnames=($(. PKGBUILD; print_all_package_names))
-   pushd ${pkgdest}
-   for p in ${pkgnames[@]/%/${PKGEXT}}; do
+   for p in ${pkgfiles[@]}; do
# Manually sign packages as "makepkg --sign" is buggy
gpg -v --detach-sign --no-armor --use-agent ${p}
 
@@ -60,7 +60,6 @@ __buildPackage() {
cp -Lv ${p}{,.sig} ${cache}/
fi
done
-   popd
 }
 
 __archrelease() {
-- 
2.17.0


[arch-projects] [dbscripts] [PATCH 2/2] test: BUILDDIR must be owned by build user

2018-05-28 Thread Eli Schwartz via arch-projects
pacman 5.1 enforces this restriction. OTOH it is a simpler setup to set
this as the user homedir directly in account creation (just like
makechrootpkg has always done) than to create an additional,
world-writable, directory.

Signed-off-by: Eli Schwartz 
---
 test/Dockerfile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test/Dockerfile b/test/Dockerfile
index 3913f007..83c84499 100644
--- a/test/Dockerfile
+++ b/test/Dockerfile
@@ -2,8 +2,7 @@ FROM archlinux/base
 RUN pacman -Syu --noconfirm --needed sudo fakeroot awk subversion make kcov 
bash-bats gettext grep
 RUN pacman-key --init
 RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
-RUN useradd -N -g users -G wheel -m tester
-RUN install -d -m 1777 /build
+RUN useradd -N -g users -G wheel -d /build -m tester
 USER tester
 RUN echo -e "\
 Key-Type: RSA\n\
-- 
2.17.0


Re: [arch-projects] [dbscripts] [GIT] Official repo DB scripts annotated tag archlinux/20100906 created. 20100906 <-- not really

2018-05-28 Thread Eli Schwartz via arch-projects
Sorry all.

I intended to update the pacman-git branch, accidentally let
push.followtags upload the duplicated tags which parabola namespaces as
archlinux/* (since I had their repo as a remote).

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature


<    2   3   4   5   6   7   8   9   10   11   >