[pacman-dev] [PATCH] links problem in bacman
I just discovered test -e tries to resolve the link before testing, so if the link is copied before the actual file, the script exits. Here's the simple fix to this bug: --- bacman 2008-06-16 17:42:45.000000000 +0200 +++ bacman.new 2008-06-16 17:52:17.000000000 +0200 @@ -136,7 +136,7 @@ bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf - # Workaround to bsdtar not reporting a missing file as an error - if [ ! -e "$work_dir"/"$i" ]; then + if [ ! -e "$work_dir"/"$i" ] && [ ! -L "$work_dir"/"$i" ]; then echo "" echo "ERROR: unable to add /$i to the package" echo " If your user does not have permssion to read this file then"
On Mon, Jun 16, 2008 at 11:05 AM, Carlo Bersani <carlocci@gmail.com> wrote:
I just discovered test -e tries to resolve the link before testing, so if the link is copied before the actual file, the script exits. Here's the simple fix to this bug: I'd really prefer a GIT patch...that makes it easier on my end to apply and gives you the chance to write a commit message that will be included in the log. Other than that the patch looks fine.
-Dan
--- bacman 2008-06-16 17:42:45.000000000 +0200 +++ bacman.new 2008-06-16 17:52:17.000000000 +0200 @@ -136,7 +136,7 @@ bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf -
# Workaround to bsdtar not reporting a missing file as an error - if [ ! -e "$work_dir"/"$i" ]; then + if [ ! -e "$work_dir"/"$i" ] && [ ! -L "$work_dir"/"$i" ]; then echo "" echo "ERROR: unable to add /$i to the package" echo " If your user does not have permssion to read this file then"
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Il Tuesday 17 June 2008 04:03:04 Dan McGee ha scritto:
On Mon, Jun 16, 2008 at 11:05 AM, Carlo Bersani <carlocci@gmail.com> wrote:
I just discovered test -e tries to resolve the link before testing, so if the link is copied before the actual file, the script exits. Here's the simple fix to this bug:
I'd really prefer a GIT patch...that makes it easier on my end to apply and gives you the chance to write a commit message that will be included in the log. Other than that the patch looks fine.
Sorry, I had to study how git works with coming exams Hope this is fine: --- contrib/bacman | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/bacman b/contrib/bacman index 410482f..bac5d67 100755 --- a/contrib/bacman +++ b/contrib/bacman @@ -136,7 +136,7 @@ while read i; do bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf - # Workaround to bsdtar not reporting a missing file as an error - if [ ! -e "$work_dir"/"$i" ]; then + if [ ! -e "$work_dir"/"$i" ] && [ -L "$work_dir"/"$i" ]; then echo "" echo "ERROR: unable to add /$i to the package" echo " If your user does not have permssion to read this file then" @@ -279,4 +279,4 @@ echo Done exit 0 -# vim: set ts=2 sw=2 noet: \ No newline at end of file +# vim: set ts=2 sw=2 noet: -- 1.5.5.3
On Sat, Jun 21, 2008 at 1:10 PM, Carlo Bersani <carlocci@gmail.com> wrote:
Il Tuesday 17 June 2008 04:03:04 Dan McGee ha scritto:
On Mon, Jun 16, 2008 at 11:05 AM, Carlo Bersani <carlocci@gmail.com> wrote:
I just discovered test -e tries to resolve the link before testing, so if the link is copied before the actual file, the script exits. Here's the simple fix to this bug:
I'd really prefer a GIT patch...that makes it easier on my end to apply and gives you the chance to write a commit message that will be included in the log. Other than that the patch looks fine.
Sorry, I had to study how git works with coming exams Hope this is fine:
--- contrib/bacman | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/bacman b/contrib/bacman index 410482f..bac5d67 100755 --- a/contrib/bacman +++ b/contrib/bacman @@ -136,7 +136,7 @@ while read i; do bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf -
# Workaround to bsdtar not reporting a missing file as an error - if [ ! -e "$work_dir"/"$i" ]; then + if [ ! -e "$work_dir"/"$i" ] && [ -L "$work_dir"/"$i" ]; then echo "" echo "ERROR: unable to add /$i to the package" echo " If your user does not have permssion to read this file then" @@ -279,4 +279,4 @@ echo Done
exit 0
-# vim: set ts=2 sw=2 noet: \ No newline at end of file +# vim: set ts=2 sw=2 noet:
Not quite what I was looking for, but I don't want to keep making you submit. Copying any pasting added spaces instead of tabs, so the patch was rejected. You also probably just copied/pasted git diff output rather than actually making a local commit and using git-format-patch, which is the preferred format. But there is plenty of time to learn. :) It is applied locally, so thanks! -Dan
Carlo Bersani wrote:
Sorry, I had to study how git works with coming exams Hope this is fine:
Here is the cheat-sheet I made when first starting pacman development. It should be all you need to know for everyday git usage with the pacman repo. # Clone git repo - only needed once git clone git://projects.archlinux.org/pacman.git pacman # Enable useful hooks chmod +x .git/hooks/{applypatch-msg,commit-msg,pre-commit,pre-rebase} # Create branch "<branch>" git branch <branch> # Work with branch "<branch>" git checkout <branch> # Commit changes on current branch and make patch to master branch git commit -a -s git format-patch master # Amend patch git commit -a --amend -s # Add file "<file>" git add <file> # Remove file "<file>" git rm <file> # Remove branch "<branch>" git branch -D <branch> # Update master branch git checkout master git pull # Megre changes on master with "<branch>" git-rebase master <branch> # Get maint branch git branch -r git checkout -b maint origin/maint
On Sun, Jun 22, 2008 at 10:46 PM, Allan McRae <allan@archlinux.org> wrote:
Carlo Bersani wrote:
Sorry, I had to study how git works with coming exams Hope this is fine:
Good work Allan. I've quickly thrown it into a wiki article along with some helpful links. Guys, *please* edit this as you see fit, as I have been around this code for way too long to really know what trips new people up. http://wiki.archlinux.org/index.php/Pacman_Development -Dan
Dan McGee wrote:
On Sun, Jun 22, 2008 at 10:46 PM, Allan McRae <allan@archlinux.org> wrote:
Carlo Bersani wrote:
Sorry, I had to study how git works with coming exams Hope this is fine:
Good work Allan. I've quickly thrown it into a wiki article along with some helpful links. Guys, *please* edit this as you see fit, as I have been around this code for way too long to really know what trips new people up.
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too... Also, the submitting patches page needs a bit of updating. It is currently a mash-up between the pre and post git eras. Allan
2008/6/23 Allan McRae <allan@archlinux.org>:
Dan McGee wrote:
On Sun, Jun 22, 2008 at 10:46 PM, Allan McRae <allan@archlinux.org> wrote:
Carlo Bersani wrote:
Sorry, I had to study how git works with coming exams Hope this is fine:
Good work Allan. I've quickly thrown it into a wiki article along with some helpful links. Guys, *please* edit this as you see fit, as I have been around this code for way too long to really know what trips new people up.
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too...
Also, the submitting patches page needs a bit of updating. It is currently a mash-up between the pre and post git eras.
Allan
The cheatsheet posted is similar to this one: http://wiki.archlinux.org/index.php/GIT and there's also http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide IMO it would be better to merge all git stuff into one page and link to it from Pacman Development page. -- Roman Kyrylych (Роман Кирилич)
On Mon, Jun 23, 2008 at 11:19 AM, Roman Kyrylych <roman.kyrylych@gmail.com> wrote:
and there's also http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide
Ah, I didn't know about this, and toofishes already updated this wikified version for amend and rebase -i, so that is perfect :) http://wiki.archlinux.org/index.php?title=Super_Quick_Git_Guide&diff=39867&oldid=39695
On Mon, Jun 23, 2008 at 9:29 AM, Allan McRae <allan@archlinux.org> wrote:
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too...
Also, the submitting patches page needs a bit of updating. It is currently a mash-up between the pre and post git eras.
Yes it looks a bit weird, so probably the reference to diff should be removed, asking to use git format-patch instead, and then giving a link to some git guide. Dan made one but it also needs to be updated : http://code.toofishes.net/git-guide.txt Especially the "Fixing your patch" section. It should be s/append/amend for editing last patch. And for a patch deeper in the tree, there is git rebase -i now, which is much nicer. One section which could be added is about the use of git-send-email, with maybe a link to archwiki msmtp page or something. There are some interesting articles on Dan's blog as well: http://toofishes.net/blog/git-workflow-pacman/ http://toofishes.net/blog/using-valgrind-c-programming/ http://toofishes.net/blog/using-gcov-code-coverage-testing/ http://toofishes.net/blog/valgrind-330-and-new-massif/ Maybe all this useful information and other hints like this could be put on the wiki, or otherwise just add a link to them, I don't know. There are also probably many others hints to share about git configuration, helpful git commands, and programming tools and helpers. As always, there are many things to do, and very little time and motivation.
On Mon, Jun 23, 2008 at 2:29 AM, Allan McRae <allan@archlinux.org> wrote:
Dan McGee wrote:
On Sun, Jun 22, 2008 at 10:46 PM, Allan McRae <allan@archlinux.org> wrote:
Carlo Bersani wrote:
Sorry, I had to study how git works with coming exams Hope this is fine:
Good work Allan. I've quickly thrown it into a wiki article along with some helpful links. Guys, *please* edit this as you see fit, as I have been around this code for way too long to really know what trips new people up.
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too...
Also, the submitting patches page needs a bit of updating. It is currently a mash-up between the pre and post git eras.
Patches welcome- that is just an asciidoc-ified version of the "submitting-patches" file which is in the pacman.git repository. -Dan
On Mon, Jun 23, 2008 at 9:29 AM, Allan McRae <allan@archlinux.org> wrote:
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too...
Please have a look at these two wiki pages : http://wiki.archlinux.org/index.php/Pacman_Development http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide
Also, the submitting patches page needs a bit of updating. It is currently a mash-up between the pre and post git eras.
I am not so good at this kind of stuff, but I didn't like the current state of that page either. So here is my attempt of a new version. === submitting-patches NEW FILE === Pacman - Submitting Patches =========================== This document is here mainly to make my job easier, and is more of a guideline, and not a strict set of rules. Please try to follow as much as you can. NOTE: Some of this is paraphrased from the kernel documentation's "SubmittingPatches" file. Creating your patch ------------------- Patches need to be submitted in GIT format. So for getting started, you will have to read some git guides first, to learn how to fetch pacman git repo, how to configure your name and email adress, how to create a branch, a commit, and finally your patch. -- * use git commit -s for creating a commit of your changes. The -s allows you to credit yourself by adding a "Signed Off By" line to indicate who has "signed" the patch - who has approved it. Signed-off-by: Aaron Griffin <aaron@archlinux.org> Please use your real name and email address. Feel free to "scramble" the address if you're afraid of spam. * Describe your patch. It helps if you describe the changes of the patch in the git commit log. This allows others to see what you intended so as to compare it to what was actually done, and allows better feedback. * Use git format-patch to create patches. Your commit message will be shown above the patch by default when you will use `git-format-patch`, including the signoff line. -- Submitting your patch --------------------- -- * Send the patch to the pacman-dev mailing list The mailing list is the primary queue for review and acceptance. Here you will get feedback, and let me know the details of your patch. * No MIME, no links, no compression, no attachments. Just plain text. Patches should be contained in the actual body of the email. There are many reasons for this. Firstly, it makes them easier to read with any mail reader, it allows easier review "at a glance", and most importantly, it allows people to comment on exact lines of the patch in reply emails. git send-email allows you to send git formatted patches in plain text easily. -- After you submit ---------------- -- * Don't get discouraged Any feedback you get, positive or negative, has nothing to do with you. If a patch is rejected, try taking the suggestions into account and re-submitting. We welcome most submissions here, and some may take a bit longer to get looked over than others. If you think your patch got lost in the shuffle, send another email to the list in reply to the original asking if anyone has looked at it yet. -- ///// vim: set ts=2 sw=2 syntax=asciidoc et: ///// ====== === PATCH ===
From a70ae43bd65be9b924c30bb1b3a399f9804f7d79 Mon Sep 17 00:00:00 2001 From: Xavier Chantry <shiningxc@gmail.com> Date: Sun, 27 Jul 2008 17:45:52 +0200 Subject: [PATCH] Update submitting-patches file.
The submitting patches page needed a bit of updating. It was currently a mash-up between the pre and post git eras. But the following page might be a better replacement of the whole file: http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide Signed-off-by: Xavier Chantry <shiningxc@gmail.com> --- submitting-patches | 61 ++++++++++++++++++--------------------------------- 1 files changed, 22 insertions(+), 39 deletions(-) diff --git a/submitting-patches b/submitting-patches index 02cde30..452a1b8 100644 --- a/submitting-patches +++ b/submitting-patches @@ -4,34 +4,38 @@ Pacman - Submitting Patches This document is here mainly to make my job easier, and is more of a guideline, and not a strict set of rules. Please try to follow as much as you can. -NOTE: Much of this is paraphrased from the kernel documentation's +NOTE: Some of this is paraphrased from the kernel documentation's "SubmittingPatches" file. Creating your patch ------------------- -Most of this was more relevant before we switched to GIT for version control. -However, much of it is still applicable and should be followed. Some notes -have been added to make this a bit more up-to-date with the GIT workflow. +Patches need to be submitted in GIT format. So for getting started, you will +have to read some git guides first, to learn how to fetch pacman git repo, how +to configure your name and email adress, how to create a branch, a commit, and +finally your patch. -- -* Use "diff -up" or "diff -uprN" to create patches. +* use git commit -s for creating a commit of your changes. -These options make the diff easier to read for those of us who try to review -submitted patches. If you are working on your own git branch, then GIT -formatted patches are perfectly acceptable. +The -s allows you to credit yourself by adding a "Signed Off By" line to +indicate who has "signed" the patch - who has approved it. + + Signed-off-by: Aaron Griffin <aaron@archlinux.org> -* Please try to make patches "p1 applicable" +Please use your real name and email address. Feel free to "scramble" the +address if you're afraid of spam. -This means that if you are patching file "lib/libalpm/alpm.h", I should be -able to apply your patch while passing the -p1 argument to 'patch'. The diff -header should look like so: +* Describe your patch. - --- ORIGINAL_DIR/lib/libalpm/alpm.h - +++ NEW_DIR/lib/libalpm/alpm.h +It helps if you describe the changes of the patch in the git commit log. +This allows others to see what you intended so as to compare it to +what was actually done, and allows better feedback. -With '-p1' the ORIGINAL_DIR and NEW_DIR arguments are stripped. GIT produces -p1 formatted patches by default. +* Use git format-patch to create patches. + +Your commit message will be shown above the patch by default when you will use +`git-format-patch`, including the signoff line. -- Submitting your patch @@ -41,8 +45,7 @@ Submitting your patch * Send the patch to the pacman-dev mailing list The mailing list is the primary queue for review and acceptance. Here you -will get feedback, and let me know the details of your patch. It also helps -if you add "[patch]" to the beginning of your Subject line. +will get feedback, and let me know the details of your patch. * No MIME, no links, no compression, no attachments. Just plain text. @@ -51,28 +54,8 @@ reasons for this. Firstly, it makes them easier to read with any mail reader, it allows easier review "at a glance", and most importantly, it allows people to comment on exact lines of the patch in reply emails. -It is important to know that the diff format ignores plain text before (and -after) the main diff itself. If you directly insert your patch into an email, -you can safely add lines above it describing your patch. - -* Describe your patch. - -Before the actual diff begins, it helps if you describe the changes in the -patch. This allows others to see what you intended so as to compare it to -what was actually done, and allows better feedback. If you use -`git-format-patch` to create your patch, then your commit message will -be shown above the patch by default. - -* Credit yourself - -Just like with the kernel, it helps if you add a "Signed Off By" line to -indicate who has "signed" the patch - who has approved it. - - Signed-off-by: Aaron Griffin <aaron@archlinux.org> - +git send-email allows you to send git formatted patches in plain text easily. -Please use your real name and email address. Feel free to "scramble" the -address if you're afraid of spam. `git commit -s` makes this easy. -- After you submit -- 1.5.6.4 ======
Xavier wrote:
On Mon, Jun 23, 2008 at 9:29 AM, Allan McRae <allan@archlinux.org> wrote:
You may want to add a line about checking out other peoples branches (e.g. the pgp branch). I would be interested in that too...
Please have a look at these two wiki pages : http://wiki.archlinux.org/index.php/Pacman_Development http://wiki.archlinux.org/index.php/Super_Quick_Git_Guide
I had figured that out a while ago. That is why it is in the first link you gave! :D
On Sun, Jul 27, 2008 at 6:12 PM, Allan McRae <allan@archlinux.org> wrote:
I had figured that out a while ago. That is why it is in the first link you gave! :D
What, where? I didn't see anything, so I added this : http://wiki.archlinux.org/index.php?title=Pacman_Development&diff=46534&oldid=46533
Xavier wrote:
On Sun, Jul 27, 2008 at 6:12 PM, Allan McRae <allan@archlinux.org> wrote:
I had figured that out a while ago. That is why it is in the first link you gave! :D
What, where? I didn't see anything, so I added this : http://wiki.archlinux.org/index.php?title=Pacman_Development&diff=46534&oldid=46533
Hmmm... I thought I had added it. Must have just been my local copy.
participants (5)
-
Allan McRae
-
Carlo Bersani
-
Dan McGee
-
Roman Kyrylych
-
Xavier