Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: ports/pkg/nacl.patch

Issue 1425273003: Always use bzip2 compression for pkg metadata (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff --git a/compat/Makefile.am b/compat/Makefile.am 1 diff --git a/compat/Makefile.am b/compat/Makefile.am
2 --- a/compat/Makefile.am 2 --- a/compat/Makefile.am
3 +++ b/compat/Makefile.am 3 +++ b/compat/Makefile.am
4 @@ -1,8 +1,7 @@ 4 @@ -1,8 +1,7 @@
5 -noinst_LTLIBRARIES= libbsd_compat.la 5 -noinst_LTLIBRARIES= libbsd_compat.la
6 noinst_HEADERS= bsd_compat.h endian_util.h \ 6 noinst_HEADERS= bsd_compat.h endian_util.h \
7 humanize_number.h 7 humanize_number.h
8 8
9 -libbsd_compat_la_SOURCES= basename.c \ 9 -libbsd_compat_la_SOURCES= basename.c \
10 +sources= basename.c \ 10 +sources= basename.c \
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 return (NULL); 1184 return (NULL);
1185 } 1185 }
1186 1186
1187 +#ifdef __native_client__ 1187 +#ifdef __native_client__
1188 + (void)unlink(tmp_file); 1188 + (void)unlink(tmp_file);
1189 + free(tmp_file); 1189 + free(tmp_file);
1190 +#endif 1190 +#endif
1191 *rc = EPKG_OK; 1191 *rc = EPKG_OK;
1192 return (res); 1192 return (res);
1193 } 1193 }
1194 @@ -890,9 +1052,21 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t) 1194 @@ -890,9 +1052,12 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
1195 1195
1196 dbdir = pkg_object_string(pkg_config_get("PKG_DBDIR")); 1196 dbdir = pkg_object_string(pkg_config_get("PKG_DBDIR"));
1197 1197
1198 +#ifdef __native_client__ 1198 +#ifdef __native_client__
1199 + char* tmp_file; 1199 + char* tmp_file;
1200 +» fd = pkg_repo_fetch_remote_tmp(repo, "meta", "txz", t, &rc, &tmp_file); 1200 +» fd = pkg_repo_fetch_remote_tmp(repo, "meta", "tbz", t, &rc, &tmp_file);
1201 +#else 1201 +#else
1202 fd = pkg_repo_fetch_remote_tmp(repo, "meta", "txz", t, &rc); 1202 fd = pkg_repo_fetch_remote_tmp(repo, "meta", "txz", t, &rc);
1203 - if (fd == -1) 1203 - if (fd == -1)
1204 - return (rc); 1204 - return (rc);
1205 +#endif 1205 +#endif
1206 + if (fd == -1) {
1207 +#ifdef __native_client__
1208 + fd = pkg_repo_fetch_remote_tmp(repo, "meta", "tbz", t, &rc, &tmp _file);
1209 +#else
1210 + fd = pkg_repo_fetch_remote_tmp(repo, "meta", "tbz", t, &rc);
1211 +#endif
1212 + if (fd == -1)
1213 + return (rc);
1214 + }
1215 1206
1216 snprintf(filepath, sizeof(filepath), "%s/%s.meta", dbdir, pkg_repo_name( repo)); 1207 snprintf(filepath, sizeof(filepath), "%s/%s.meta", dbdir, pkg_repo_name( repo));
1217 1208
1218 @@ -922,12 +1096,18 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t) 1209 @@ -922,12 +1087,18 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
1219 } 1210 }
1220 1211
1221 close(fd); 1212 close(fd);
1222 +#ifdef __native_client__ 1213 +#ifdef __native_client__
1223 + (void)unlink(tmp_file); 1214 + (void)unlink(tmp_file);
1224 + free(tmp_file); 1215 + free(tmp_file);
1225 +#endif 1216 +#endif
1226 1217
1227 if (repo->signature_type == SIG_FINGERPRINT && repo->trusted_fp == NULL) { 1218 if (repo->signature_type == SIG_FINGERPRINT && repo->trusted_fp == NULL) {
1228 if (pkg_repo_load_fingerprints(repo) != EPKG_OK) 1219 if (pkg_repo_load_fingerprints(repo) != EPKG_OK)
1229 return (EPKG_FATAL); 1220 return (EPKG_FATAL);
1230 } 1221 }
1231 1222
1232 + // No pubkey or fingerprint for nacl repo now. 1223 + // No pubkey or fingerprint for nacl repo now.
1233 +#ifndef __native_client__ 1224 +#ifndef __native_client__
1234 /* Map meta file for extracting pubkeys from it */ 1225 /* Map meta file for extracting pubkeys from it */
1235 if (stat(filepath, &st) == -1) { 1226 if (stat(filepath, &st) == -1) {
1236 pkg_emit_errno("pkg_repo_fetch_meta", "cannot stat meta fetched" ); 1227 pkg_emit_errno("pkg_repo_fetch_meta", "cannot stat meta fetched" );
1237 @@ -947,6 +1127,7 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t) 1228 @@ -947,6 +1118,7 @@ pkg_repo_fetch_meta(struct pkg_repo *repo, time_t *t)
1238 rc = EPKG_FATAL; 1229 rc = EPKG_FATAL;
1239 goto cleanup; 1230 goto cleanup;
1240 } 1231 }
1241 +#endif 1232 +#endif
1242 1233
1243 if (repo->signature_type == SIG_FINGERPRINT) { 1234 if (repo->signature_type == SIG_FINGERPRINT) {
1244 cbdata.len = st.st_size; 1235 cbdata.len = st.st_size;
1245 diff --git a/libpkg/pkg_repo_create.c b/libpkg/pkg_repo_create.c 1236 diff --git a/libpkg/pkg_repo_create.c b/libpkg/pkg_repo_create.c
1246 --- a/libpkg/pkg_repo_create.c 1237 --- a/libpkg/pkg_repo_create.c
1247 +++ b/libpkg/pkg_repo_create.c 1238 +++ b/libpkg/pkg_repo_create.c
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 2156
2166 +if DYNAMIC 2157 +if DYNAMIC
2167 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil 2158 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil
2168 +else 2159 +else
2169 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la 2160 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la
2170 +endif 2161 +endif
2171 + 2162 +
2172 if HAVE_ELF_ABI 2163 if HAVE_ELF_ABI
2173 if LIBELF_BUNDLED 2164 if LIBELF_BUNDLED
2174 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la 2165 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698