From c9d53ca8ba8583a5012da4618af9994a2c7daa6c Mon Sep 17 00:00:00 2001 From: Kevin Cantu Date: Fri, 20 Jan 2012 04:17:32 -0800 Subject: [PATCH 1/2] Add support for DESTDIR to "make install" per the Debian New Maintainers' Guide: http://www.debian.org/doc/manuals/maint-guide/modify.en.html#id459110 --- Makefile.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.in b/Makefile.in index 2b9cf9c958a..05b5c722106 100644 --- a/Makefile.in +++ b/Makefile.in @@ -493,6 +493,12 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),) endif ifneq ($(findstring install,$(MAKECMDGOALS)),) + ifdef DESTDIR + CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR)) + CFG_PREFIX:=$(DESTDIR) + export CFG_PREFIX + endif + CFG_INFO := $(info cfg: including install rules) include $(CFG_SRC_DIR)/mk/install.mk endif From 62bef762a3d999e1d9f3b551320e22619d83b7ca Mon Sep 17 00:00:00 2001 From: Kevin Cantu Date: Fri, 20 Jan 2012 04:23:07 -0800 Subject: [PATCH 2/2] Add a Python script which downloads only the latest Linux snapshots (derived from other scripts here) --- src/etc/latest-unix-snaps.py | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 src/etc/latest-unix-snaps.py diff --git a/src/etc/latest-unix-snaps.py b/src/etc/latest-unix-snaps.py new file mode 100755 index 00000000000..3cdbc889235 --- /dev/null +++ b/src/etc/latest-unix-snaps.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +import os, tarfile, hashlib, re, shutil, sys +from snapshot import * + +f = open(snapshotfile) +date = None +rev = None +platform = None +snap = None +i = 0 + +newestSet = {} + + +for line in f.readlines(): + i += 1 + parsed = parse_line(i, line) + if (not parsed): continue + + if parsed["type"] == "snapshot": + if (len(newestSet) == 0 or parsed["date"] > newestSet["date"]): + newestSet["date"] = parsed["date"] + newestSet["rev"] = parsed["rev"] + newestSet["files"] = [] + addingMode = True + else: + addingMode = False + + elif addingMode == True and parsed["type"] == "file": + tux = re.compile("linux", re.IGNORECASE) + if (tux.match(parsed["platform"]) != None): + ff = {} + ff["platform"] = parsed["platform"] + ff["hash"] = parsed["hash"] + newestSet["files"] += [ff] + + +def download_new_file (date, rev, platform, hsh): + snap = full_snapshot_name(date, rev, platform, hsh) + dl = os.path.join(download_dir_base, snap) + url = download_url_base + "/" + snap + if (not os.path.exists(dl)): + print("downloading " + url) + get_url_to_file(url, dl) + if (snap_filename_hash_part(snap) == hash_file(dl)): + print("got download with ok hash") + else: + raise Exception("bad hash on download") + +for ff in newestSet["files"]: + download_new_file (newestSet["date"], newestSet["rev"], ff["platform"], ff["hash"]) + +