All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Choong, Yin Thong" <yin.thong.choong@intel.com>
To: "Burton, Ross" <ross.burton@intel.com>,
	"Kukkonen, Jussi" <jussi.kukkonen@intel.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 4/8] logrotate: replace fedorahosted.org SRC_URI with yoctoproject.org source
Date: Mon, 3 Apr 2017 11:00:37 +0000	[thread overview]
Message-ID: <CF0C948DE8E2634BB64BF489FF9EF7E7CB120C@PGSMSX105.gar.corp.intel.com> (raw)
In-Reply-To: <CAJTo0Lb6o=fFerSorzQqJpRtMNB6z1L5ZDqE5AzTE6gCpWNmSA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3695 bytes --]

Hi,
Once I change to github.com below error pop out. Seem like it miss align with the patch compare with github.com logrotate source. Both package seem got miss align on the version. When I compare yoctoproject logrotate.c and github logrotate.c it has big different (as attached), there even got different parameter count on some API function. Let’s stick with yoctoproject.org/mirror 1st ? Or I check back the github to get for suitable version? Then I may need to rename bbrecipe filename base on the github version? Suggestion?

https://downloads.yoctoproject.org/mirror/sources/logrotate-3.9.1.tar.gz
https://github.com/logrotate/logrotate/archive/r3-9-1.tar.gz

ERROR: logrotate-3.9.1-r0 do_patch: Command Error: 'quilt --quiltrc /home/yinthong/rebeccapoky/build/tmp/work/i586-poky-linux/logrotate/3.9.1-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch act-as-mv-when-rotate.patch
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 68f29ab490cf987aa34b5f4caf1784b58a021308 Mon Sep 17 00:00:00 2001
|From: Robert Yang <liezhi.yang@windriver.com>
|Date: Tue, 17 Feb 2015 21:08:07 -0800
|Subject: [PATCH] Act as the "mv" command when rotate log
|
|Act as the "mv" command when rotate log, first rename, if failed, then
|read and write.
|
|Upstream-Status: Pending
|
|Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
|---
| logrotate.c |   71 +++++++++++++++++++++++++++++++++++++++++++++++++----------
| 1 file changed, 59 insertions(+), 12 deletions(-)
|
|diff --git a/logrotate.c b/logrotate.c
|index d3deb6a..cf8bf2c 100644
|--- a/logrotate.c
|+++ b/logrotate.c
--------------------------
No file to patch.  Skipping patch.
6 out of 6 hunks ignored
Patch act-as-mv-when-rotate.patch does not apply (enforce with -f)
ERROR: logrotate-3.9.1-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/yinthong/rebeccapoky/build/tmp/work/i586-poky-linux/logrotate/3.9.1-r0/temp/log.do_patch.130676
ERROR: Task (/home/yinthong/rebeccapoky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb:do_patch) failed with exit code '1'

Thanks and Regards
Choong YinThong

From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: Monday, April 3, 2017 5:17 PM
To: Kukkonen, Jussi <jussi.kukkonen@intel.com>
Cc: Choong, Yin Thong <yin.thong.choong@intel.com>; Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH 4/8] logrotate: replace fedorahosted.org SRC_URI with yoctoproject.org source


On 3 April 2017 at 09:30, Jussi Kukkonen <jussi.kukkonen@intel.com<mailto:jussi.kukkonen@intel.com>> wrote:
This is true, there's not that much in the repo itself to create trust. The major show of trust is here though: http://pkgs.fedoraproject.org/cgit/rpms/logrotate.git/commit/?id=9cb55142e51b82085d6c3136448c1f441454e351
Fedora/Red Hat themselves changed to use this repo when the fedorahosted repos were EOL'd (see also Red Hat folks working on the github issues in January).

So logrotate was originally hosted on Fedora infrastructure that is then shut down, a github repository appears and Fedora fetch from that github repository.  Also the commit in the github repository to change the README from fedorahosted to github (https://github.com/logrotate/logrotate/commit/09c4fa8bc6cf2c01bad24d33c3ea69371030c014) was committed by a Red Hat employee (https://github.com/kdudka).

Whilst there are many official-looking forks on github that are just Some Guy, this is clearly the new canonical home.

Ross

[-- Attachment #1.2: Type: text/html, Size: 14167 bytes --]

[-- Attachment #2: 1styocto_2ndgithub_logrotate.diff --]
[-- Type: application/octet-stream, Size: 3102 bytes --]

1159a1160,1206
> /* Act as the "mv" command, if rename failed, then read the old file and
>  * write to new file. The function which invokes the mvFile will use
>  * the strerror(errorno) to handle the error message, so we don't have
>  * to print the error message here */
> 
> int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
> {
>     struct stat sbprev;
>     int fd_old, fd_new, n;
>     char buf[BUFSIZ];
> 
>     /* Do the rename first */
>     if (!rename(oldName, newName))
>         return 0;
> 
>     /* If the errno is EXDEV, then read old file, write newfile and
>      * remove the oldfile */
>     if (errno == EXDEV) {
>         /* Open the old file to read */
>         if ((fd_old = open(oldName, O_RDONLY)) < 0)
>             return 1;
> 
>         /* Create the file to write, keep the same attribute as the old file */
>         if (stat(oldName, &sbprev))
>             return 1;
>         else {
>             if ((fd_new = createOutputFile(newName,
>                 O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
>                 return 1;
>         }
> 
>         /* Read and write */
>         while ((n = read(fd_old, buf, BUFSIZ)) > 0)
>             if (write(fd_new, buf, n) != n)
>                 return 1;
> 
>         if ((close(fd_old) < 0) ||
>             removeLogFile(oldName, log) ||
>             (close(fd_new) < 0))
>             return 1;
> 
>         return 0;
>     }
> 
>     return 1;
> }
> 
1526c1573
< 		    "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
---
> 		    "moving %s to %s (rotatecount %d, logstart %d, i %d), \n",
1529c1576
< 	    if (!debug && rename(oldName, newName)) {
---
> 	    if (!debug && mvFile(oldName, newName, log, prev_acl)) {
1534c1581
< 		    message(MESS_ERROR, "error renaming %s to %s: %s\n",
---
> 		    message(MESS_ERROR, "error moving %s to %s: %s\n",
1672c1719
< 			message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
---
> 			message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
1674,1675c1721,1722
< 			if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) {
< 			message(MESS_ERROR, "failed to rename %s to %s: %s\n",
---
> 			if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
> 			message(MESS_ERROR, "failed to move %s to %s: %s\n",
1682c1729
< 			message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
---
> 			message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
1685,1686c1732,1733
< 			rename(log->files[logNum], rotNames->finalName)) {
< 				message(MESS_ERROR, "failed to rename %s to %s: %s\n",
---
> 			mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
> 				message(MESS_ERROR, "failed to move %s to %s: %s\n",
2066c2113
< static int writeState(char *stateFilename)
---
> static int writeState(struct logInfo *log, char *stateFilename)
2230c2277
< 		if (rename(tmpFilename, stateFilename)) {
---
> 		if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
2528c2575
< 		rc |= writeState(stateFile);
---
> 		rc |= writeState(log, stateFile);

  reply	other threads:[~2017-04-03 11:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  2:51 [PATCH 0/8] Remove all use of fedorahosted SRC_URI [YOCTO #11226] yin.thong.choong
2017-04-03  2:51 ` [PATCH 1/8] selftest/recipetool: replace fedorahosted.org SRC_URI with yoctoproject.org source yin.thong.choong
2017-04-03  2:51 ` [PATCH 2/8] xmlto: replace fedorahosted.org SRC_URI with pagure.io source yin.thong.choong
2017-04-03  2:51 ` [PATCH 3/8] libuser: " yin.thong.choong
2017-04-03  2:51 ` [PATCH 4/8] logrotate: replace fedorahosted.org SRC_URI with yoctoproject.org source yin.thong.choong
2017-04-03  7:46   ` Jussi Kukkonen
2017-04-03  7:53     ` Choong, Yin Thong
2017-04-03  8:30       ` Jussi Kukkonen
2017-04-03  9:09         ` Alexander Kanavin
2017-04-03  9:17         ` Burton, Ross
2017-04-03 11:00           ` Choong, Yin Thong [this message]
2017-04-03 11:13             ` Burton, Ross
2017-04-03 11:46             ` Jussi Kukkonen
2017-04-03  2:51 ` [PATCH 5/8] libnewt: replace fedorahosted.org SRC_URI with pagure.io source yin.thong.choong
2017-04-03  2:51 ` [PATCH 6/8] liberation-fonts: " yin.thong.choong
2017-04-03  2:51 ` [PATCH 7/8] chkconfig: replace fedorahosted.org SRC_URI with github.com source yin.thong.choong
2017-04-03  9:11   ` Alexander Kanavin
2017-04-03  9:12   ` Burton, Ross
2017-04-03  9:18     ` Choong, Yin Thong
2017-04-03  2:51 ` [PATCH 8/8] cronie: " yin.thong.choong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CF0C948DE8E2634BB64BF489FF9EF7E7CB120C@PGSMSX105.gar.corp.intel.com \
    --to=yin.thong.choong@intel.com \
    --cc=jussi.kukkonen@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.