aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-12-11 17:11:51 +0000
committerNed Ludd <solar@gentoo.org>2006-12-11 17:11:51 +0000
commit74347bfe723a7eccab90719f39baf3903919011e (patch)
treef2d895b66a3efacdafbf90936fc172791f333786
parent- style fixups (diff)
downloadportage-utils-74347bfe723a7eccab90719f39baf3903919011e.tar.gz
portage-utils-74347bfe723a7eccab90719f39baf3903919011e.tar.bz2
portage-utils-74347bfe723a7eccab90719f39baf3903919011e.zip
- update qcheck -u to take mtimes into account. bug 157624 Gerte Hoogewerf <g.hoogewerf@gmail.com>v0.1.22
-rw-r--r--qcheck.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/qcheck.c b/qcheck.c
index 9f51c00..811cc23 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.28 2006/11/09 00:18:05 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qcheck.c,v 1.29 2006/12/11 17:11:51 solar Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -20,7 +20,7 @@ static const char *qcheck_opts_help[] = {
"Update chksum and mtimes for packages",
COMMON_OPTS_HELP
};
-static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.28 2006/11/09 00:18:05 vapier Exp $";
+static const char qcheck_rcsid[] = "$Id: qcheck.c,v 1.29 2006/12/11 17:11:51 solar Exp $";
#define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, lookup_applet_idx("qcheck"))
@@ -163,22 +163,36 @@ int qcheck_main(int argc, char **argv)
free_and_more_hash:
free(hashed_file);
continue;
+ } else if (e->mtime && e->mtime != st.st_mtime) {
+ printf(" %sMTIME%s: %s", RED, NORM, e->name);
+ if (verbose)
+ printf(" (recorded '%lu' != actual '%lu')", e->mtime, (unsigned long)st.st_mtime);
+ printf("\n");
+
+ /* This can only be an obj, dir and sym have no digest */
+ if (qc_update)
+ fprintf(fpx, "obj %s %s %lu\n", e->name, e->digest, st.st_mtime);
+
+ continue;
} else {
if (qc_update)
fputs(buffer, fpx);
free(hashed_file);
}
- } else {
- if (qc_update)
- fputs(buffer, fpx);
- }
- if (e->mtime && e->mtime != st.st_mtime) {
- /* validate last modification time */
+ } else if (e->mtime && e->mtime != st.st_mtime) {
printf(" %sMTIME%s: %s", RED, NORM, e->name);
if (verbose)
- printf(" (recorded '%lu' != actual '%lu')", (unsigned long)st.st_mtime, e->mtime);
+ printf(" (recorded '%lu' != actual '%lu')", e->mtime, (unsigned long)st.st_mtime);
printf("\n");
+
+ /* This can only be a sym */
+ if (qc_update)
+ fprintf(fpx, "sym %s -> %s %lu\n", e->name, e->sym_target, st.st_mtime);
+
continue;
+ } else {
+ if (qc_update)
+ fputs(buffer, fpx);
}
++num_files_ok;
}