Re: [pacman-dev] Proposed Changelog Feature
Excerpts from Daniel M. Capella's message of September 7, 2019 17:20: > Would it be possible for the PKGBUILD to allow users to specify a file to set > for 'changelog=' relative to $srcdir? This is non-trivial. Consider that something simple in the global scope such as: changelog=$srcdir/$pkgname-$pkgver/NEWS At the time this var is read, $srcdir isn't yet defined, and while $pkgver *is* defined, it's subject to change via a pkgver() function. You can avoid some of this pain if you insist that changelog be partof the package() function, but that would be highly unusual/annoying. Alternatives of re-sourcing the PKGBUILD from within user-functions are equally hard to swallow and probably have strange side effects. How about `changelog="$pkgdir"/usr/share/doc/$pkgname/NEWS`? changelog could also be made capable of holding a link to where upstream hosts its release notes, especially when they have pretty formatting and further links to issues/PR's/commits/etc, eg. https://www.mozilla.org/en-US/firefox/69.0/releasenotes/. That has the same definition time problem, and breaks down for split packages. -- Sincerely, Johannes Löthberg :: SA0DEM pgpbM7CkIzG5t.pgp Description: PGP signature
Re: [pacman-dev] [PATCH] libmakepkg/source/git: Use --bare with a refspec instead of --mirror
Excerpts from Allan McRae's message of January 20, 2019 22:30: > On 21/1/19 2:30 am, Eli Schwartz wrote: >> On 1/20/19 9:13 AM, Johannes Löthberg wrote: >>> This pulls in all of the branches in the same way as --mirror, but won't >>> also pull in all of the non-branch references. >>> >>> For example the refs/pull/*/{head,merge} references that GitHub creates >>> for every PR that has ever been opened against the repo can pull in a >>> very large amount of objects that aren't useful, and which can massively >>> inflate a repository. >> It's entirely possible that people use this to cherry-pick a patch from >> a PR branch. That being said, I do consider it reasonable to not fetch >> this by default and pull in the patchfile via source=() if you do need >> it... but I wonder how often people might be relying on this behavior. > > I have done that in the past - I found it to be good documentation of > where the patch came from rather than using a local copy of the patch. > For that I much prefer just using GitHub .patch URLs in the sources array, which will get you a file that you can just throw at git-am, which not only tells you where it's from, you can just copy it and remove the .patch at the end to see the code review of it. Depending on non-branch or tag refs that by default aren't cloned feel rather icky to me overall, but maybe that's just me. > I'd like to see an example of what is meant by "massively inflate"? > What percentage are we talking? > I distinctly remember having cases where there were old PRs from before a rebase that ended up pulling in multiple gigabytes of data, but I cannot seem to figure out which repos they were anymore. Of the larger repos I've looked at quickly it seems the difference for most of them are roughly 100-500MB. For Linus' linux repo the difference is 446MB, 113MB for rust. Since I can't really find the really nasty cases anymore, I guess you can feel free to reject it, though I still think that the change is more morally correct, and even a 500MB difference can affect some users. -- Sincerely, Johannes Löthberg :: SA0DEM pgpK6SrfQm09s.pgp Description: PGP signature
[pacman-dev] [PATCH] libmakepkg/source/git: Use --bare with a refspec instead of --mirror
This pulls in all of the branches in the same way as --mirror, but won't also pull in all of the non-branch references. For example the refs/pull/*/{head,merge} references that GitHub creates for every PR that has ever been opened against the repo can pull in a very large amount of objects that aren't useful, and which can massively inflate a repository. Signed-off-by: Johannes Löthberg --- scripts/libmakepkg/source/git.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index 130c11e1..6a75c1c2 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -43,7 +43,7 @@ download_git() { if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" - if ! git clone --mirror "$url" "$dir"; then + if ! git clone --bare --config=remote.origin.fetch=+refs/heads/*:refs/heads/* "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 -- 2.20.1
Re: [pacman-dev] [Fwd: desc/.PKGINFO files: I need help to understand the values of some variables]
On 20/01, Eli Schwartz wrote: On 01/20/2017 05:04 PM, Anna Ivanova wrote: I have one question about pacman and I was in a hoping that I write to the right mailing list, but I didn't find in the archives similar posts. So that's why I write here... sorry if I mistook. Why is your actual message an attachment to this one??? Because they forwarded it rather than just re-sending it to this ML. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] building from git erroneous
On 25/10, Johannes Löthberg wrote: On 25/10, Johannes Löthberg wrote: On 25/10, Florian Weigelt wrote: Building from commit fa06951d90fee028ece95fc7caab39fc7d35d55f generates the scripts pacman-db-upgrade, pacman-key and pkgdelta in the form DIR="/path/to/builddir/src/pacman/scripts" LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/pacman-key "$@" so they hold a reference to the build directory. Building pacman with makepkg triggers the "reference to $srcdir" warning. However, I haven't bisected the latest commits yet. Can't reproduce, which configure flags are you using? Disregard that, can repro when building the package, hmm. So, since 1f8f0bd9ac4c11cdc1b9506f9f64d8192ecad4ee it for some reason installs the in-tree wrapper on install, d'oh. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] building from git erroneous
On 25/10, Johannes Löthberg wrote: On 25/10, Florian Weigelt wrote: Building from commit fa06951d90fee028ece95fc7caab39fc7d35d55f generates the scripts pacman-db-upgrade, pacman-key and pkgdelta in the form DIR="/path/to/builddir/src/pacman/scripts" LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/pacman-key "$@" so they hold a reference to the build directory. Building pacman with makepkg triggers the "reference to $srcdir" warning. However, I haven't bisected the latest commits yet. Can't reproduce, which configure flags are you using? Disregard that, can repro when building the package, hmm. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] building from git erroneous
On 25/10, Florian Weigelt wrote: Building from commit fa06951d90fee028ece95fc7caab39fc7d35d55f generates the scripts pacman-db-upgrade, pacman-key and pkgdelta in the form DIR="/path/to/builddir/src/pacman/scripts" LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/pacman-key "$@" so they hold a reference to the build directory. Building pacman with makepkg triggers the "reference to $srcdir" warning. However, I haven't bisected the latest commits yet. Can't reproduce, which configure flags are you using? -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] makepkg - separate build nodeps and runtime nodeps
On 21/10, Brendan Hide wrote: Instead, I would like to specify "--noruntimedeps" - or some similar flag, so I see potential build time dependencies immediately but also ignore run time dependencies that are going to be installed anyway. Build-time dependencies are only listed in makedepends if they're not needed at run-time, otherwise they're only listed in the depends array, so this wouldn't really be possible. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] Remove contrib
On 10/10, Pierre Neidhardt wrote: Anybody plan on maintaining those scripts somewhere else then? I use a few of them. I asked for a repo to be set up on git.archlinux.org, but nothing yet. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] Give a "success!" message on database check
On 29/09, Allan McRae wrote: On 29/09/16 05:29, Patrick Eigensatz wrote: Ps: Is it possible to tell git send-email to reply to the message with this ID? --in-reply-to= (although I am fairly sure no-one does that...) Lots of people use it, and quite a few patches recently sent to this ML has a proper reply-to header. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Versioned packages
On 12/09, Sergey Petrenko via pacman-dev wrote: Well, of course! I can also build kernel outside package management, or write a hook to backup kernels, but I'd like to see solution that would not require such dire and time consuming measures, and, ideally, would not require actions from me at all. Then maybe Arch is not for you. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Transifex - Was: [PATCH] Fix typo in german translation
On 27/06, Allan McRae wrote: On 27/06/16 02:32, Matthias Gorissen wrote: As an aside, I should also note that outscourcing translations to Transifex was one of the worst decisions ever made on this list. Transifex lacks a decent VCS, which means that I cannot easily see changes done by my collaborators. Things were way much easier when just used git. And we can get a seperate git-repo anywhere for free. You can use the transifex client to pull the changes then commit it to a local repo. A simple script could be run each day. I know its far from an ideal solution, and you still to go to transifex to look at the change history... This has simplified things a lot from the handling of translation files at the pacman end. There's not really anything that prevents the translation teams from doing their work in Git and then importing that into transifex either. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] pactree: Add support for getting optional dependencies
On 01/03, Andrew Gregory wrote: On 02/25/16 at 10:44pm, Johannes Löthberg wrote: +static alpm_list_t *get_pkg_optdep_names(alpm_pkg_t *pkg) +{ + alpm_list_t *i = NULL, *names = NULL; + for(i = alpm_pkg_get_optdepends(pkg); i; i = alpm_list_next(i)) { + alpm_depend_t *d = i->data; + if(searchsyncs) { + names = alpm_list_add(names, d->name); + } else { + alpm_db_t *localdb = alpm_get_localdb(handle); + if(alpm_find_satisfier(alpm_db_get_pkgcache(localdb), d->name)) { + names = alpm_list_add(names, d->name); + } Why does this hide uninstalled optdepends? We don't hide uninstalled dependencies and I don't see any reason to treat them differently. It felt cleaner since when you want to get the list of dependencies and optdeps from the local DB you probably don't care about uninstalled ones, but uninstalled dependencies shouldn't really be hidden since it shows that something is likely wrong. But I guess I could remove it and have people that want the more useful output remove those lines themselves... -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
[pacman-dev] [PATCH] pactree: Add support for getting optional dependencies
Signed-off-by: Johannes Löthberg <johan...@kyriasis.com> --- doc/pactree.8.txt | 3 +++ src/util/pactree.c | 41 - 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/doc/pactree.8.txt b/doc/pactree.8.txt index b177788..4c391c0 100644 --- a/doc/pactree.8.txt +++ b/doc/pactree.8.txt @@ -49,6 +49,9 @@ Options *-l, \--linear*:: Prints package names at the start of each line, one per line. +*-o, \--optdeps*:: + Show packages that are optionally depended upon by the named package. + *-r, \--reverse*:: Show packages that depend on the named package. diff --git a/src/util/pactree.c b/src/util/pactree.c index 67be9f9..fb91b39 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -118,6 +118,7 @@ struct graph_style *style = _utf8; int graphviz = 0; int max_depth = -1; int reverse = 0; +int optdeps = 0; int unique = 0; int searchsyncs = 0; const char *dbpath = DBPATH; @@ -182,6 +183,7 @@ static int parse_options(int argc, char *argv[]) {"help",no_argument, 0, 'h'}, {"linear", no_argument, 0, 'l'}, {"reverse", no_argument, 0, 'r'}, + {"optdeps", no_argument, 0, 'o'}, {"sync",no_argument, 0, 's'}, {"unique", no_argument, 0, 'u'}, @@ -198,7 +200,7 @@ static int parse_options(int argc, char *argv[]) style = _default; #endif - while((opt = getopt_long(argc, argv, "ab:cd:ghlrsu", opts, _index))) { + while((opt = getopt_long(argc, argv, "ab:cd:ghlorsu", opts, _index))) { if(opt < 0) { break; } @@ -236,6 +238,9 @@ static int parse_options(int argc, char *argv[]) case 's': searchsyncs = 1; break; + case 'o': + optdeps = 1; + break; case 'u': unique = 1; style = _linear; @@ -266,6 +271,7 @@ static void usage(void) " -g, --graph generate output for graphviz's dot\n" " -h, --help display this help message\n" " -l, --linear enable linear output\n" + " -o, --optdepslist packages that are optionally depended upon by the named package\n" " -r, --reverselist packages that depend on the named package\n" " -s, --sync search sync databases instead of local\n" " -u, --unique show dependencies with no duplicates (implies -l)\n" @@ -381,12 +387,29 @@ static alpm_list_t *get_pkg_dep_names(alpm_pkg_t *pkg) return names; } +static alpm_list_t *get_pkg_optdep_names(alpm_pkg_t *pkg) +{ + alpm_list_t *i = NULL, *names = NULL; + for(i = alpm_pkg_get_optdepends(pkg); i; i = alpm_list_next(i)) { + alpm_depend_t *d = i->data; + if(searchsyncs) { + names = alpm_list_add(names, d->name); + } else { + alpm_db_t *localdb = alpm_get_localdb(handle); + if(alpm_find_satisfier(alpm_db_get_pkgcache(localdb), d->name)) { + names = alpm_list_add(names, d->name); + } + } + } + return names; +} + /** * walk dependencies, showing dependencies of the target */ -static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int rev) +static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int rev, int optdeps) { - alpm_list_t *deps, *i; + alpm_list_t *deps = NULL, *i = NULL; if(!pkg || ((max_depth >= 0) && (depth->level > max_depth))) { return; @@ -396,8 +419,16 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int r if(rev) { deps = alpm_pkg_compute_requiredby(pkg); + if(optdeps) { + alpm_list_t *odeps = alpm_pkg_compute_optionalfor(pkg); + deps = alpm_list_join(deps, odeps); + } } else { deps = get_pkg_dep_names(pkg); + if(optdeps) { + alpm_list_t *odeps = get_pkg_optdep_names(pkg); + deps = alpm_list_join(deps, odeps); + } } for(i = deps; i;
Re: [pacman-dev] pacman-5.0:Should pkgver() and prepare() run when repackage?
On 21/01, Zuyi Hu wrote: I am using the pacman's latest master branch, when I run 'makepkg -R' to repackage packages, it will run pkgver() and prepare(), if there are some patch command in prepare(), it will fail. should pkgver() and prepare() run when repackage? It does seem weird for the prepare function to be run. Though --noprepare should work as a workaround in the interim. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
[pacman-dev] [PATCH] doc: alpm-hooks.5: Fix missing space before Description
Signed-off-by: Johannes Löthberg <johan...@kyriasis.com> --- doc/alpm-hooks.5.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/alpm-hooks.5.txt b/doc/alpm-hooks.5.txt index f33ff8c..aee2ff8 100644 --- a/doc/alpm-hooks.5.txt +++ b/doc/alpm-hooks.5.txt @@ -64,7 +64,7 @@ defined the hook will run if the transaction matches *any* of the triggers. ACTIONS --- -* Description =* ...:: +*Description =* ...:: An optional description that describes the action being taken by the hook for use in front-end output. -- 2.6.4
Re: [pacman-dev] [PATCH] doc: alpm-hooks.5: Fix missing space before Description
On 04/01, Johannes Löthberg wrote: -* Description =* ...:: +*Description =* ...:: An optional description that describes the action being taken by the hook for use in front-end output. I'm dumb and sleep-deprived, this patch is clearly not adding a missing space. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Updating bash and zsh completion
On 01/01, Allan McRae wrote: Does anyone want to look at updating our bash adn zsh completion to include the new options for -D and -F (and anything else that is missing)? There is a patch for zsh here: https://bugs.archlinux.org/index.php?do=details_id=47559 And an issue for bash completion here: https://bugs.archlinux.org/index.php?do=details_id=47333 Should also note that there are a few other missing ones, and some flags that are in there are available where they shouldn't be. Like --print under -Q. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] Use a bashism instead of mktemp's --tmpdir option.
On 31/12, Alastair Hughes wrote: bacman and updpkgsums used GNU mktemp's --tmpdir option, which is not supported by some other implementations (including busybox). Replace that with a bashism, as used in the other scripts. It's not a bashism actually, it's a POSIX sh-ism. Signed-off-by: Alastair Hughes <hobbitalast...@gmail.com> --- contrib/bacman.sh.in | 2 +- contrib/updpkgsums.sh.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in index fcee6a0..b4b 100644 --- a/contrib/bacman.sh.in +++ b/contrib/bacman.sh.in @@ -147,7 +147,7 @@ fi # Begin # msg "Package: ${pkg_namver}" -work_dir=$(mktemp -d --tmpdir bacman.XX) +work_dir=$(mktemp -d "${TMPDIR:-/tmp}/bacman.XX") cd "$work_dir" || exit 1 # diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index 7b92efe..aaed700 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -79,8 +79,8 @@ if [[ ! -w . ]]; then fi # Generate the new sums -export BUILDDIR=$(mktemp -d --tmpdir updpkgsums.XX) -newbuildfile=$(mktemp --tmpdir updpkgsums.XX) +export BUILDDIR=$(mktemp -d "${TMPDIR:-/tmp}/updpkgsums.XX") +newbuildfile=$(mktemp "${TMPDIR:-/tmp}/updpkgsums.XX") trap "rm -rf '$BUILDDIR' '$newbuildfile'" EXIT newsums=$(makepkg -g -p "$buildfile") || die 'Failed to generate new checksums' -- 2.6.4 -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] contrib/PKGBUILD.vim: handle arch suffixes with keywords
On 23/12, genml+pacman-...@thequod.de wrote: From: Daniel Hahler <g...@thequod.de> --- contrib/PKGBUILD.vim | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index 35ca6bd..8a9f411 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -93,37 +93,37 @@ syn match pbValidGroups /\([[:alnum:]]\|+\|-\|_\)*/ contained syn region pbGroupsGroup start=/^groups=(/ end=/)/ contains=pb_k_groups,pbValidGroups,shDoubleQuote,shSingleQuote " depends -syn keyword pb_k_depends depends contained +syn keyword pb_k_depends depends depends_i686 depends_x86_64 contained syn match pbValidDepends /\([[:alnum:]]\|+\|-\|_\)*/ contained syn region pbDependsGroup start=/^depends=(/ end=/)/ contains=pb_k_depends,pbValidDepends,shDoubleQuote,shSingleQuote Issue is that pacman is distro agnostic, and other distributions support eg ARM. Is there any way to make it match all possible ones without hardcoding them? -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Broken pacman output when resizing
On 29/11, Florian Pritz wrote: but a user is never going to see both at once I've actually wanted to see both on quite a few occasions when I've had either big updates or a very slow connection. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Signing the database again
On 04/11, Remi Gacogne wrote: - requiring TU and devs to sign the database when publishing a package is not easy and ; It shouldn't be particularly hard, someone just has to do the work on devtools to support it. - we don't want to have a package-signing key online if we can prevent it, No need to do any signing at all on the server. so ideally the key used to sign the database should not be able to sign packages ; - in addition to that, it would be nice if package-signing keys would not be able to sign the database. Doesn't really matter much in practice. [snip] As I am not a TU nor a developer, I am not familiar with the exact process used to publish packages. I have discussed this a bit with Levente, but this is clearly the fuzziest part for me, so please let me know if this is non-sense. Basically, 1) packages are built locally (preferably in a clean chroot, but there currently aren't technically any rules about it.) 2) commitpkg signs the built package (if necessary), does a svn commit of the current PKGBUILd and misc versions, runs archrelease which copies the current package's trunk to the repos branch, then commitpkg rsyncs the built package and the signature to nymeria. 3) Dev or TU SSH's to nymeria and does a /community/db-update or /packages/db-update which locks the DBs, moves the built packages to the correct location, adds them to the DBs, and then unlocks them again. IMO the simplest way to add DB signing would be to modify the 3rd step to have a local wrapper that first SSHs to the server and runs a script to lock the DBs, moves the built packages in place, adds them to the DB and then exits. Then the local wrapper script would download the DB, and sign the DB locally before uploading the DB and the new signature, then runs a second remote script that puts the DB and signature in the right place and then unlocks the DB. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Source Package Versioning
On 06/09, David Manouchehri wrote: Regarding size, hopefully people aren't tracking binaries to begin with. Compressed text files shouldn't be huge. What private information would be in .git/? Clearing the cache should prevent that if it's a concern. I agree that there's better ways to share Git projects, but I've never been in a situation where I wish I *didn't* have a package's version history. Then just always use git bundles instead of source tarballs when you want them. It's silly for makepkg to reimplement features of your VCS for you. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] Patch-proposal for makepkg: be able to use su for installations even if sudo is installed
On 26/07, Jonas Große Sundrup wrote: Hi, at the moment makepkg will use sudo to obtain root privileges if it is installed, otherwise it will use su. This means that if sudo is configured to only allow special commands (and none of those is pacman), makepkg -i will fail to install the built package. Same goes for installing dependencies with makepkg -s. The patch appended introduces a new variable into makepkg.conf named SUPER_USER_BINARY, which is set to sudo by default. With it being sudo makepkg will behave as it does currently, so there should be no breakages with updates. If not set to sudo, makepkg will ignore an installed sudo and use su right away. If the user has access to the root password, why is their sudo commands so limited in the first place? -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
[pacman-dev] [PATCH v3 2/2] repo-add: Reject armored signatures
Pacman cannot handle armored signatures, so make repo-add error out if one is detected. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- Error message changed as per IRC discussion with Allan scripts/repo-add.sh.in | 4 1 file changed, 4 insertions(+) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 7e242ce..69993a9 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -364,6 +364,10 @@ db_write_entry() { # compute base64'd PGP signature if [[ -f $pkgfile.sig ]]; then + if grep -q 'BEGIN PGP SIGNATURE' $pkgfile.sig; then + error $(gettext Cannot use armored signatures for packages: %s) $pkgfile.sig + return 1 + fi pgpsigsize=$(@SIZECMD@ -L $pkgfile.sig) if (( pgpsigsize 16384 )); then error $(gettext Invalid package signature file '%s'.) $pkgfile.sig -- 2.4.2
[pacman-dev] [PATCH v3 1/2] repo-add: Generate unarmored DB signature
Pacman cannot handle armored signatures, so use gpg's --no-armor flag to force an unarmored signature. --- scripts/repo-add.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 3ece8d5..7e242ce 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -264,7 +264,7 @@ create_signature() { if [[ -n $GPGKEY ]]; then SIGNWITHKEY=-u ${GPGKEY} fi - gpg --detach-sign --use-agent ${SIGNWITHKEY} $dbfile /dev/null || ret=$? + gpg --detach-sign --use-agent --no-armor ${SIGNWITHKEY} $dbfile /dev/null || ret=$? if (( ! ret )); then msg2 $(gettext Created signature file '%s') ${dbfile##*/.tmp.}.sig -- 2.4.2
[pacman-dev] [PATCH] util.c: table_display: Fix incorrect docstring
Commit 7b8f8753 removed the title parameter but forgot to remove it from the docstring. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- src/pacman/util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pacman/util.c b/src/pacman/util.c index 5d68360..7c6a8c0 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -612,7 +612,6 @@ static size_t table_calc_widths(const alpm_list_t *header, /** Displays the list in table format * - * @param title the tables title * @param header the column headers. column count is determined by the nr * of headers * @param rows the rows to display as a list of lists of strings. the outer -- 2.4.2
[pacman-dev] [PATCH 1/2] repo-add: Generate unarmored DB signature
Pacman cannot handle armored signatures, so use gpg's --no-armor flag to force an unarmored signature. --- scripts/repo-add.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 3ece8d5..7e242ce 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -264,7 +264,7 @@ create_signature() { if [[ -n $GPGKEY ]]; then SIGNWITHKEY=-u ${GPGKEY} fi - gpg --detach-sign --use-agent ${SIGNWITHKEY} $dbfile /dev/null || ret=$? + gpg --detach-sign --use-agent --no-armor ${SIGNWITHKEY} $dbfile /dev/null || ret=$? if (( ! ret )); then msg2 $(gettext Created signature file '%s') ${dbfile##*/.tmp.}.sig -- 2.4.1
Re: [pacman-dev] [PATCH 2/2] repo-add: Reject armored signatures
On 26/05, Allan McRae wrote: On 26/05/15 19:46, Johannes Löthberg wrote: Pacman cannot handle armored signatures, so make repo-add error out if one is detected. --- scripts/repo-add.sh.in | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 7e242ce..4f9f7c3 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -364,6 +364,11 @@ db_write_entry() { # compute base64'd PGP signature if [[ -f $pkgfile.sig ]]; then + if head -1 $pkgfile.sig | grep -q 'BEGIN PGP SIGNATURE'; then Why is head being used here? I think I originally used it in case the file had some other content, but there's really no need for it. Will remove it. + error $(gettext Armored package signature '%s' found, \ +unarmored signatures required.) $pkgfile.sig + return 1 + fi pgpsigsize=$(@SIZECMD@ -L $pkgfile.sig) if (( pgpsigsize 16384 )); then error $(gettext Invalid package signature file '%s'.) $pkgfile.sig -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
[pacman-dev] [PATCH v2] repo-add: Reject armored signatures
Pacman cannot handle armored signatures, so make repo-add error out if one is detected. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- Now beheaded. scripts/repo-add.sh.in | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 7e242ce..076e987 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -364,6 +364,11 @@ db_write_entry() { # compute base64'd PGP signature if [[ -f $pkgfile.sig ]]; then + if grep -q 'BEGIN PGP SIGNATURE' $pkgfile.sig; then + error $(gettext Armored package signature '%s' found, \ +unarmored signatures required.) $pkgfile.sig + return 1 + fi pgpsigsize=$(@SIZECMD@ -L $pkgfile.sig) if (( pgpsigsize 16384 )); then error $(gettext Invalid package signature file '%s'.) $pkgfile.sig -- 2.4.1
[pacman-dev] [PATCH v2] makepkg: Add flag for printing SRCINFO to stdout
This commit adds a makepkg option to generate and print the SRCINFO file for a PKGBUILD, required by the new AUR, to stdout. AUR 4.0 will use Git instead of source tarballs for uploading packages, so making makepkg capable of printing the SRCINFO would simplify package management, instead of having to extract it from a source tarball. It is also useful for scripting other things, so that instead of having to parse PKGBUILDs, one can make makepkg generate the SRCINFO and then you can parse that instead, which is much simpler and less error-prone. --- Now with documentation and justification! doc/makepkg.8.txt | 3 +++ scripts/makepkg.sh.in | 9 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index 41df30e..4323fd3 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -207,6 +207,9 @@ Options List the packages that would be produced without building. Listed package names do not include PKGEXT. +*\--printsrcinfo*:: + Generate and print the SRCINFO file to stdout. + Additional Features --- makepkg supports building development versions of packages without having to diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c74e84a..2613b31 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1723,6 +1723,7 @@ usage() { printf -- $(gettext --nosign Do not create a signature for the package)\n printf -- $(gettext --packagelistOnly list packages that would be produced, without PKGEXT)\n printf -- $(gettext --pkg list Only build listed packages from a split package)\n + printf -- $(gettext --printsrcinfo Print the generated SRCINFO and exit)\n printf -- $(gettext --sign Sign the resulting package with %s)\n gpg printf -- $(gettext --skipchecksums Do not verify checksums of the source files)\n printf -- $(gettext --skipinteg Do not perform any verification checks on source files)\n @@ -1768,7 +1769,7 @@ OPT_SHORT=AcCdefFghiLmop:rRsSV OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild' 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist' - 'pkg:' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' + 'pkg:' 'printsrcinfo' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps' 'verifysource' 'version') # Pacman Options @@ -1813,6 +1814,7 @@ while true; do -p) shift; BUILDFILE=$1 ;; --pkg)shift; IFS=, read -ra p $1; PKGLIST+=(${p[@]}); unset p ;; --packagelist)PACKAGELIST=1 IGNOREARCH=1;; + --printsrcinfo) PRINTSRCINFO=1 ;; -r|--rmdeps) RMDEPS=1 ;; -R|--repackage) REPKG=1 ;; --sign) SIGNPKG='y' ;; @@ -2099,6 +2101,11 @@ if (( PACKAGELIST )); then exit 0 fi +if (( PRINTSRCINFO )); then + write_srcinfo + exit 0 +fi + if (( ! PKGVERFUNC )); then check_build_status fi -- 2.4.1
[pacman-dev] [PATCH] makepkg: Add flag for printing SRCINFO to stdout
--- scripts/makepkg.sh.in | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c74e84a..2613b31 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1723,6 +1723,7 @@ usage() { printf -- $(gettext --nosign Do not create a signature for the package)\n printf -- $(gettext --packagelistOnly list packages that would be produced, without PKGEXT)\n printf -- $(gettext --pkg list Only build listed packages from a split package)\n + printf -- $(gettext --printsrcinfo Print the generated SRCINFO and exit)\n printf -- $(gettext --sign Sign the resulting package with %s)\n gpg printf -- $(gettext --skipchecksums Do not verify checksums of the source files)\n printf -- $(gettext --skipinteg Do not perform any verification checks on source files)\n @@ -1768,7 +1769,7 @@ OPT_SHORT=AcCdefFghiLmop:rRsSV OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild' 'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'packagelist' - 'pkg:' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' + 'pkg:' 'printsrcinfo' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps' 'verifysource' 'version') # Pacman Options @@ -1813,6 +1814,7 @@ while true; do -p) shift; BUILDFILE=$1 ;; --pkg)shift; IFS=, read -ra p $1; PKGLIST+=(${p[@]}); unset p ;; --packagelist)PACKAGELIST=1 IGNOREARCH=1;; + --printsrcinfo) PRINTSRCINFO=1 ;; -r|--rmdeps) RMDEPS=1 ;; -R|--repackage) REPKG=1 ;; --sign) SIGNPKG='y' ;; @@ -2099,6 +2101,11 @@ if (( PACKAGELIST )); then exit 0 fi +if (( PRINTSRCINFO )); then + write_srcinfo + exit 0 +fi + if (( ! PKGVERFUNC )); then check_build_status fi -- 2.4.1
Re: [pacman-dev] [PATCH] makepkg: Add flag for printing SRCINFO to stdout
On 24/05, Allan McRae wrote: It would be great if there was a use case described in the commit message... I am not adding more options without justification (or documentation). Sorry, was planning on adding some more info, I should stop computering when tired. (But basically it's useful for scripting, for it will help many that want to more easily script updates with AUR4, but I also want it to not have to parse PKGBUILDs myself, just having to parse the SRCINFO instead) -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH] Return 17 if a package/group has been built.
On 22/05, Jack L. Frost wrote: Why 17? An arbitrary choice If it's an arbitrary choice, why not 2 to follow 1? -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
Re: [pacman-dev] [PATCH v2] Add makepkg option --packagelist; fix bug #42150
On 20/03, joyfulg...@archlinux.us wrote: Also fixed get_pkg_arch to treat arch as an array when querying pkgbuild_get_attribute. That is an unrelated change that doesn’t really belong in the same commit. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ signature.asc Description: PGP signature
[pacman-dev] [PATCH v3 2/2] PKGBUILD.5.txt: Clarify note about variables available
Reported-by: Florian Pritz bluew...@xinu.at Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- doc/PKGBUILD.5.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index b02a06e..b6d21fd 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -368,8 +368,8 @@ the `build()` function. `checkdepends` array. All of the above variables such as `$pkgname` and `$pkgver` are available for -use in the `build()` function. In addition, makepkg defines the following -variables for use during the build and install process: +use in the packaging functions. In addition, makepkg defines the following +variables: *srcdir*:: This contains the directory where makepkg extracts, or copies, all source -- 2.3.1
[pacman-dev] [PATCH v3 1/2] PKGBUILD.5.txt: Add note about functions starting in $srcdir
Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- doc/PKGBUILD.5.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 10980ab..b02a06e 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -374,6 +374,8 @@ variables for use during the build and install process: *srcdir*:: This contains the directory where makepkg extracts, or copies, all source files. ++ +All of the packaging functions defined above are run starting inside `$srcdir` *pkgdir*:: This contains the directory where makepkg bundles the installed package. -- 2.3.1
[pacman-dev] [PATCH 2/2] PKGBUILD.5.txt: Clarify note about variables available
From: Johannes Löthberg johan...@kyriasis.com Reported-by: Florian Pritz bluew...@xinu.at Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- doc/PKGBUILD.5.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 2dba100..58bb008 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -367,9 +367,9 @@ the `build()` function. `package()` functions. Be sure any exotic commands used are covered by the `checkdepends` array. -All of the above variables such as `$pkgname` and `$pkgver` are available for -use in the `build()` function. In addition, makepkg defines the following -variables for use during the build and install process: +All of the above variables such as `$pkgname` and `$pkgver`, in addition to the +following ones, are avilable for use in all of the above defined packaging +functions. *srcdir*:: This contains the directory where makepkg extracts, or copies, all source -- 2.3.0
[pacman-dev] [PATCH 1/2] PKGBUILD.5.txt: Add note about functions starting in $srcdir
From: Johannes Löthberg johan...@kyriasis.com Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- doc/PKGBUILD.5.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 10980ab..2dba100 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -374,6 +374,9 @@ variables for use during the build and install process: *srcdir*:: This contains the directory where makepkg extracts, or copies, all source files. ++ +All of the above defined packaging functions in PKGBUILDs are run from inside +the `$srcdir` *pkgdir*:: This contains the directory where makepkg bundles the installed package. -- 2.3.0
[pacman-dev] [PATCH v2] PKGBUILD.5.txt: Clarify note about variables available
Reported-by: Florian Pritz bluew...@xinu.at Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- Fix 'available' typo. (Gah, that's embarassing.) doc/PKGBUILD.5.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 86bf63a..fed49b9 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -367,9 +367,9 @@ the `build()` function. `package()` functions. Be sure any exotic commands used are covered by the `checkdepends` array. -All of the above variables such as `$pkgname` and `$pkgver` are available for -use in the `build()` function. In addition, makepkg defines the following -variables for use during the build and install process: +All of the above variables such as `$pkgname` and `$pkgver`, in addition to the +following ones, are available for use in all of the above defined packaging +functions. *srcdir*:: This contains the directory where makepkg extracts, or copies, all source -- 2.3.0
Re: [pacman-dev] [PATCH 2/2] libalpm: Add accessors for the base field
On 22/12, Allan McRae wrote: On 21/12/14 02:25, Johannes Löthberg wrote: This commit adds the necessary accessor functions to get the PKGBASE of a package, forcing the desc file to be parsed. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/alpm.h | 6 ++ lib/libalpm/be_local.c | 7 +++ lib/libalpm/package.c | 9 + lib/libalpm/package.h | 1 + 4 files changed, 23 insertions(+) Are we expecting a third patch to actually do something with this? Maybe something like: $ pacman -Si gcc-libs Repository : core Name : gcc-libs (gcc) Version: 4.9.2-1 Not right now, but that would be useful sometimes too, either in parens or as a separate line in -Sii maybe. diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index e6ef3ae..91b9461 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1101,6 +1101,12 @@ int alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg); */ const char *alpm_pkg_get_filename(alpm_pkg_t *pkg); +/** Returns the package base name. + * @param pkg a pointer to package + * @return a reference to an internal string + */ +const char *alpm_pkg_get_base(alpm_pkg_t *pkg); + OK - see my new rule about adding this change to README. Give that was posted after you submitted this, I can handle it. Should I add another header from 4.2→4.3 in that case? -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ pgp1gr0iwUpiR.pgp Description: PGP signature
Re: [pacman-dev] [PATCH 1/2] libalpm: Parse and write PKGBASEs
On 22/12, Allan McRae wrote: On 21/12/14 02:25, Johannes Löthberg wrote: This commit adds support to libalpm to parse the pkgbase present in packages .PKGINFO files, writing the PKGBASE to the %BASE% section of the local DBs desc files and for parsing it again when loading the local DB Signed-off-by: Johannes Löthberg johan...@kyriasis.com You need to free the pkg-base memory in _alpm_pkg_free and copy it in _alpm_pkg_dup. Otherwise fine. Crap, that completely slipped my mind. Thanks. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ pgpLZozkezBHJ.pgp Description: PGP signature
Re: [pacman-dev] [PATCH 2/2] libalpm: Add accessors for the base field
On 22/12, Johannes Löthberg wrote: On 22/12, Allan McRae wrote: On 21/12/14 02:25, Johannes Löthberg wrote: This commit adds the necessary accessor functions to get the PKGBASE of a package, forcing the desc file to be parsed. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/alpm.h | 6 ++ lib/libalpm/be_local.c | 7 +++ lib/libalpm/package.c | 9 + lib/libalpm/package.h | 1 + 4 files changed, 23 insertions(+) Are we expecting a third patch to actually do something with this? Maybe something like: $ pacman -Si gcc-libs Repository : core Name : gcc-libs (gcc) Version: 4.9.2-1 Not right now, but that would be useful sometimes too, either in parens or as a separate line in -Sii maybe. Oh right, forgot to say that I firstly wanted to implement it to be able to show it in expac for scripting. (Not for myself though.) -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/ pgpIA4OYnrE6j.pgp Description: PGP signature
[pacman-dev] [PATCH v2 1/2] libalpm: Parse and write PKGBASEs
This commit adds support to libalpm to parse the pkgbase present in packages .PKGINFO files, writing the PKGBASE to the %BASE% section of the local DBs desc files and for parsing it again when loading the local DB Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/be_local.c | 6 ++ lib/libalpm/be_package.c | 2 +- lib/libalpm/be_sync.c| 2 ++ lib/libalpm/package.c| 2 ++ lib/libalpm/package.h| 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 9376396..54d3099 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -701,6 +701,8 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) _alpm_log(db-handle, ALPM_LOG_ERROR, _(%s database is inconsistent: version mismatch on package %s\n), db-treename, info-name); } + } else if(strcmp(line, %BASE%) == 0) { + READ_AND_STORE(info-base); } else if(strcmp(line, %DESC%) == 0) { READ_AND_STORE(info-desc); } else if(strcmp(line, %GROUPS%) == 0) { @@ -904,6 +906,10 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq free(path); fprintf(fp, %%NAME%%\n%s\n\n %%VERSION%%\n%s\n\n, info-name, info-version); + if(info-base) { + fprintf(fp, %%BASE%%\n + %s\n\n, info-base); + } if(info-desc) { fprintf(fp, %%DESC%%\n %s\n\n, info-desc); diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 5617f4f..2d42465 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -193,7 +193,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * STRDUP(newpkg-name, ptr, return -1); newpkg-name_hash = _alpm_hash_sdbm(newpkg-name); } else if(strcmp(key, pkgbase) == 0) { - /* not used atm */ + STRDUP(newpkg-base, ptr, return -1); } else if(strcmp(key, pkgver) == 0) { STRDUP(newpkg-version, ptr, return -1); } else if(strcmp(key, basever) == 0) { diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 5245948..6e89ad9 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -614,6 +614,8 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive, if(_alpm_validate_filename(db, pkg-name, pkg-filename) 0) { return -1; } + } else if(strcmp(line, %BASE%) == 0) { + READ_AND_STORE(pkg-base); } else if(strcmp(line, %DESC%) == 0) { READ_AND_STORE(pkg-desc); } else if(strcmp(line, %GROUPS%) == 0) { diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index e2997f6..3be5e74 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -566,6 +566,7 @@ int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr) newpkg-name_hash = pkg-name_hash; STRDUP(newpkg-filename, pkg-filename, goto cleanup); + STRDUP(newpkg-base, pkg-base, goto cleanup); STRDUP(newpkg-name, pkg-name, goto cleanup); STRDUP(newpkg-version, pkg-version, goto cleanup); STRDUP(newpkg-desc, pkg-desc, goto cleanup); @@ -641,6 +642,7 @@ void _alpm_pkg_free(alpm_pkg_t *pkg) } FREE(pkg-filename); + FREE(pkg-base); FREE(pkg-name); FREE(pkg-version); FREE(pkg-desc); diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 357c20e..98c1e6d 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -85,6 +85,7 @@ extern struct pkg_operations default_pkg_ops; struct __alpm_pkg_t { unsigned long name_hash; char *filename; + char *base; char *name; char *version; char *desc; -- 2.2.0
[pacman-dev] [PATCH v2 2/2] libalpm: Add accessors for the base field
This commit adds the necessary accessor functions to get the PKGBASE of a package, forcing the desc file to be parsed. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/alpm.h | 6 ++ lib/libalpm/be_local.c | 7 +++ lib/libalpm/package.c | 9 + lib/libalpm/package.h | 1 + 4 files changed, 23 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index e6ef3ae..91b9461 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1101,6 +1101,12 @@ int alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg); */ const char *alpm_pkg_get_filename(alpm_pkg_t *pkg); +/** Returns the package base name. + * @param pkg a pointer to package + * @return a reference to an internal string + */ +const char *alpm_pkg_get_base(alpm_pkg_t *pkg); + /** Returns the package name. * @param pkg a pointer to package * @return a reference to an internal string diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 54d3099..dbdfc99 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -63,6 +63,12 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq); * initialized. */ +static const char *_cache_get_base(alpm_pkg_t *pkg) +{ + LAZY_LOAD(INFRQ_DESC, NULL); + return pkg-base; +} + static const char *_cache_get_desc(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); @@ -297,6 +303,7 @@ static int _cache_force_load(alpm_pkg_t *pkg) * logic. */ static struct pkg_operations local_pkg_ops = { + .get_base= _cache_get_base, .get_desc= _cache_get_desc, .get_url = _cache_get_url, .get_builddate = _cache_get_builddate, diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 3be5e74..ce6b0a2 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -83,6 +83,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg) * backend logic that needs lazy access, such as the local database through * a lazy-load cache. However, the defaults will work just fine for fully- * populated package structures. */ +static const char *_pkg_get_base(alpm_pkg_t *pkg){ return pkg-base; } static const char *_pkg_get_desc(alpm_pkg_t *pkg){ return pkg-desc; } static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg-url; } static alpm_time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg-builddate; } @@ -144,6 +145,7 @@ static int _pkg_force_load(alpm_pkg_t UNUSED *pkg) { return 0; } * struct itself with no abstraction layer or any type of lazy loading. */ struct pkg_operations default_pkg_ops = { + .get_base= _pkg_get_base, .get_desc= _pkg_get_desc, .get_url = _pkg_get_url, .get_builddate = _pkg_get_builddate, @@ -186,6 +188,13 @@ const char SYMEXPORT *alpm_pkg_get_filename(alpm_pkg_t *pkg) return pkg-filename; } +const char SYMEXPORT *alpm_pkg_get_base(alpm_pkg_t *pkg) +{ + ASSERT(pkg != NULL, return NULL); + pkg-handle-pm_errno = 0; + return pkg-ops-get_base(pkg); +} + const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 98c1e6d..5ab9b20 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -43,6 +43,7 @@ * defined default_pkg_ops struct to work just fine for their needs. */ struct pkg_operations { + const char *(*get_base) (alpm_pkg_t *); const char *(*get_desc) (alpm_pkg_t *); const char *(*get_url) (alpm_pkg_t *); alpm_time_t (*get_builddate) (alpm_pkg_t *); -- 2.2.0
[pacman-dev] [PATCH 1/2] libalpm: Parse and write PKGBASEs
This commit adds support to libalpm to parse the pkgbase present in packages .PKGINFO files, writing the PKGBASE to the %BASE% section of the local DBs desc files and for parsing it again when loading the local DB Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/be_local.c | 6 ++ lib/libalpm/be_package.c | 2 +- lib/libalpm/be_sync.c| 2 ++ lib/libalpm/package.h| 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 9376396..54d3099 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -701,6 +701,8 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) _alpm_log(db-handle, ALPM_LOG_ERROR, _(%s database is inconsistent: version mismatch on package %s\n), db-treename, info-name); } + } else if(strcmp(line, %BASE%) == 0) { + READ_AND_STORE(info-base); } else if(strcmp(line, %DESC%) == 0) { READ_AND_STORE(info-desc); } else if(strcmp(line, %GROUPS%) == 0) { @@ -904,6 +906,10 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq free(path); fprintf(fp, %%NAME%%\n%s\n\n %%VERSION%%\n%s\n\n, info-name, info-version); + if(info-base) { + fprintf(fp, %%BASE%%\n + %s\n\n, info-base); + } if(info-desc) { fprintf(fp, %%DESC%%\n %s\n\n, info-desc); diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 5617f4f..2d42465 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -193,7 +193,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * STRDUP(newpkg-name, ptr, return -1); newpkg-name_hash = _alpm_hash_sdbm(newpkg-name); } else if(strcmp(key, pkgbase) == 0) { - /* not used atm */ + STRDUP(newpkg-base, ptr, return -1); } else if(strcmp(key, pkgver) == 0) { STRDUP(newpkg-version, ptr, return -1); } else if(strcmp(key, basever) == 0) { diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 5245948..6e89ad9 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -614,6 +614,8 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive, if(_alpm_validate_filename(db, pkg-name, pkg-filename) 0) { return -1; } + } else if(strcmp(line, %BASE%) == 0) { + READ_AND_STORE(pkg-base); } else if(strcmp(line, %DESC%) == 0) { READ_AND_STORE(pkg-desc); } else if(strcmp(line, %GROUPS%) == 0) { diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 357c20e..98c1e6d 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -85,6 +85,7 @@ extern struct pkg_operations default_pkg_ops; struct __alpm_pkg_t { unsigned long name_hash; char *filename; + char *base; char *name; char *version; char *desc; -- 2.2.0
[pacman-dev] [PATCH 2/2] libalpm: Add accessors for the base field
This commit adds the necessary accessor functions to get the PKGBASE of a package, forcing the desc file to be parsed. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- lib/libalpm/alpm.h | 6 ++ lib/libalpm/be_local.c | 7 +++ lib/libalpm/package.c | 9 + lib/libalpm/package.h | 1 + 4 files changed, 23 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index e6ef3ae..91b9461 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1101,6 +1101,12 @@ int alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg); */ const char *alpm_pkg_get_filename(alpm_pkg_t *pkg); +/** Returns the package base name. + * @param pkg a pointer to package + * @return a reference to an internal string + */ +const char *alpm_pkg_get_base(alpm_pkg_t *pkg); + /** Returns the package name. * @param pkg a pointer to package * @return a reference to an internal string diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 54d3099..dbdfc99 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -63,6 +63,12 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq); * initialized. */ +static const char *_cache_get_base(alpm_pkg_t *pkg) +{ + LAZY_LOAD(INFRQ_DESC, NULL); + return pkg-base; +} + static const char *_cache_get_desc(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); @@ -297,6 +303,7 @@ static int _cache_force_load(alpm_pkg_t *pkg) * logic. */ static struct pkg_operations local_pkg_ops = { + .get_base= _cache_get_base, .get_desc= _cache_get_desc, .get_url = _cache_get_url, .get_builddate = _cache_get_builddate, diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index e2997f6..92fcb2a 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -83,6 +83,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg) * backend logic that needs lazy access, such as the local database through * a lazy-load cache. However, the defaults will work just fine for fully- * populated package structures. */ +static const char *_pkg_get_base(alpm_pkg_t *pkg){ return pkg-base; } static const char *_pkg_get_desc(alpm_pkg_t *pkg){ return pkg-desc; } static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg-url; } static alpm_time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg-builddate; } @@ -144,6 +145,7 @@ static int _pkg_force_load(alpm_pkg_t UNUSED *pkg) { return 0; } * struct itself with no abstraction layer or any type of lazy loading. */ struct pkg_operations default_pkg_ops = { + .get_base= _pkg_get_base, .get_desc= _pkg_get_desc, .get_url = _pkg_get_url, .get_builddate = _pkg_get_builddate, @@ -186,6 +188,13 @@ const char SYMEXPORT *alpm_pkg_get_filename(alpm_pkg_t *pkg) return pkg-filename; } +const char SYMEXPORT *alpm_pkg_get_base(alpm_pkg_t *pkg) +{ + ASSERT(pkg != NULL, return NULL); + pkg-handle-pm_errno = 0; + return pkg-ops-get_base(pkg); +} + const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 98c1e6d..5ab9b20 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -43,6 +43,7 @@ * defined default_pkg_ops struct to work just fine for their needs. */ struct pkg_operations { + const char *(*get_base) (alpm_pkg_t *); const char *(*get_desc) (alpm_pkg_t *); const char *(*get_url) (alpm_pkg_t *); alpm_time_t (*get_builddate) (alpm_pkg_t *); -- 2.2.0
Re: [pacman-dev] [PATCH] doc/translation-help.txt: Fix link to tutorial on sarovar.org
On 30/09, Andrew Gregory wrote: It looks like that tutorial is actually part of gettext.[1] Is there nothing more official than an archived copy that we can direct people to? Only one I can find is another third-party one[1]. Might be a good idea to either ask the GNU people to host a version or for Arch to host our own copy. [1]: http://multivac.fatburen.org/localdoc/gettext/tutorial.html -- Sincerely, Johannes Löthberg PGP Key ID: 3A9D0BB5 pgp6AB3B_WSRc.pgp Description: PGP signature
Re: [pacman-dev] [PATCH] pacman.c: Add -gg, -ii, and -yy to help summary
On 14/08, Johannes Löthberg wrote: The sync help summaries was missing the information about: * -gg: View all groups and members * -ii: View extended information * -yy: Force refresh even if DBs are up to date Original-work-by: Earnestly zib...@gmail.com Signed-off-by: Johannes Löthberg johan...@kyriasis.com Whops, forgot to mention that it fixes FS#41388 -- Sincerely, Johannes Löthberg PGP Key ID: 3A9D0BB5 pgpH9xUlVjgad.pgp Description: PGP signature
[pacman-dev] [PATCH v2] makepkg: Respect XDG_CONFIG_HOME
Add support for following the XDG Base Directory Specification when reading the user-specific configuration file. If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to sourcing $HOME/.makepkg.conf Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- Was unsure if you wanted me to remove the variable or not, but it looked quite messy when I removed it so kept it in. Can re-send if you do want me to remove it. doc/makepkg.conf.5.txt | 4 ++-- scripts/makepkg.sh.in | 9 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b15f026..dade39a 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -11,7 +11,7 @@ makepkg.conf - makepkg configuration file Synopsis -{sysconfdir}/makepkg.conf, ~/.makepkg.conf +{sysconfdir}/makepkg.conf, $XDG_CONFIG_HOME/pacman/makepkg.conf, ~/.makepkg.conf Description @@ -27,7 +27,7 @@ variables. Some of them are non-standard. The system-wide configuration file is found in {sysconfdir}/makepkg.conf. Individual options can be overridden (or added to) on a per-user basis in -~/.makepkg.conf. +$XDG_CONFIG_HOME/pacman/makepkg.conf or ~/.makepkg.conf. The default file is fairly well commented, so it may be easiest to simply follow directions given there for customization. diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index e20b707..089e92d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2788,8 +2788,13 @@ fi # Source user-specific makepkg.conf overrides, but only if no override config # file was specified -if [[ $MAKEPKG_CONF = $confdir/makepkg.conf -r ~/.makepkg.conf ]]; then - source_safe ~/.makepkg.conf +XDG_PACMAN_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/pacman +if [[ $MAKEPKG_CONF = $confdir/makepkg.conf ]]; then + if [[ -r $XDG_PACMAN_DIR/makepkg.conf ]]; then + source_safe $XDG_PACMAN_DIR/makepkg.conf + elif [[ -r $HOME/.makepkg.conf ]]; then + source_safe $HOME/.makepkg.conf + fi fi # set pacman command if not already defined -- 2.0.1
Re: [pacman-dev] [PATCH] makepkg: Respect XDG_CONFIG_HOME
On 02/07, Allan McRae wrote: Can we nest this? Done in v2. if [[ $MAKEPKG_CONF = $confdir/makepkg.conf]]; then if [[ -r ${XDG_CONFIG_HOME:-$HOME/.config}/pacman/.makepkg.conf Not sure if you meant for the variable to be removed too, tried it but looked messy so leaving it in unless you say otherwise. -- Sincerely, Johannes Löthberg PGP Key ID: 3A9D0BB5 pgpyEimp0bIl_.pgp Description: PGP signature
[pacman-dev] [PATCH] makepkg: Respect XDG_CONFIG_HOME
Add support for following the XDG Base Directory Specification when reading the user-specific configuration file. If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to sourcing $HOME/.makepkg.conf Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- doc/makepkg.conf.5.txt | 4 ++-- scripts/makepkg.sh.in | 7 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index b15f026..dade39a 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -11,7 +11,7 @@ makepkg.conf - makepkg configuration file Synopsis -{sysconfdir}/makepkg.conf, ~/.makepkg.conf +{sysconfdir}/makepkg.conf, $XDG_CONFIG_HOME/pacman/makepkg.conf, ~/.makepkg.conf Description @@ -27,7 +27,7 @@ variables. Some of them are non-standard. The system-wide configuration file is found in {sysconfdir}/makepkg.conf. Individual options can be overridden (or added to) on a per-user basis in -~/.makepkg.conf. +$XDG_CONFIG_HOME/pacman/makepkg.conf or ~/.makepkg.conf. The default file is fairly well commented, so it may be easiest to simply follow directions given there for customization. diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index e20b707..f06cd6d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2788,8 +2788,11 @@ fi # Source user-specific makepkg.conf overrides, but only if no override config # file was specified -if [[ $MAKEPKG_CONF = $confdir/makepkg.conf -r ~/.makepkg.conf ]]; then - source_safe ~/.makepkg.conf +XDG_PACMAN_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/pacman +if [[ $MAKEPKG_CONF = $confdir/makepkg.conf -r $XDG_PACMAN_DIR/makepkg.conf ]] + source_safe $XDG_PACMAN_DIR/makepkg.conf +elif [[ $MAKEPKG_CONF = $confdir/makepkg.conf -r $HOME/.makepkg.conf ]]; then + source_safe $HOME/.makepkg.conf fi # set pacman command if not already defined -- 2.0.1
[pacman-dev] [PATCH] makepkg: Change comment to reflect non-armored sig
The comment above the signature generation line says that it will make a ASCII armored signature, which it no longer will and which pacman doesn't like. Signed-off-by: Johannes Löthberg johan...@kyriasis.com --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 96e5349..4c1d1b3 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2081,7 +2081,7 @@ create_signature() { if [[ -n $GPGKEY ]]; then SIGNWITHKEY=-u ${GPGKEY} fi - # The signature will be generated directly in ascii-friendly format + # The signature will be generated in the binary OpenPGP format gpg --detach-sign --use-agent ${SIGNWITHKEY} --no-armor $filename /dev/null || ret=$? -- 2.0.0
Re: [pacman-dev] [PATCH] makepkg: Change comment to reflect non-armored sig
On 02/06, Allan McRae wrote: Any objection to just removing that comment? Not at all, it is rather redundant. -- Sincerely, Johannes Löthberg PGP Key ID: 3A9D0BB5 pgpPEG4LDVXwV.pgp Description: PGP signature
[pacman-dev] [PATCH] makepkg: Remove redundant sig generation comment
Remove the comment above the signature generation command as the command is self explanatory and no longer does what the comment says. --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 96e5349..a1d9f45 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2081,7 +2081,7 @@ create_signature() { if [[ -n $GPGKEY ]]; then SIGNWITHKEY=-u ${GPGKEY} fi - # The signature will be generated directly in ascii-friendly format + gpg --detach-sign --use-agent ${SIGNWITHKEY} --no-armor $filename /dev/null || ret=$? -- 2.0.0