154 Commits

Author SHA1 Message Date
Xu Cheng
91fb49d270
various: proper escape in regex 2016-07-13 19:11:46 +08:00
Martin Afanasjew
eba437e153 bottle: revert overeager rename in method call 2016-07-09 16:50:35 +02:00
Mike McQuaid
f1c4141885 keg_relocate: port to generic OS. (#453) 2016-07-09 13:52:05 +01:00
Xu Cheng
d4e8d3df0a
bottle: add --skip-relocation flag to skip keg relocate
This flag is indented to be used in `homebrew/portable` to build vendor
ruby/git/curl.
2016-06-30 15:26:04 +08:00
Martin Afanasjew
e2e35def35 bottle: avoid raising exception in ensure block
The `ensure` block can be reached before the tab is modified (and thus
before `original_tab` gets populated). Avoid raising an exception when
attempting to restore a tab that hasn't been modified yet, e.g. because
relocating some of the Mach-O binaries failed.
2016-06-24 06:40:52 +02:00
Martin Afanasjew
656c713d6c bottle: use short formula name in bottle commit 2016-06-03 17:04:07 +02:00
ilovezfs
6f37394e53 bintray "package" should be name not full_name
Based on how it's used to construct URLs, the bintray "package" should
be the formula name not the formula full_name. For core formulae, there
is no difference, but that's not the case in other taps.

See https://github.com/Homebrew/homebrew-gui/pull/10

Closes #301.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-05-30 02:26:31 -07:00
Mike McQuaid
7829af7508 bottle/test-bot: deep merge bottle JSON hashes. 2016-05-28 20:11:07 +01:00
Mike McQuaid
9edb1a7a87 bottle: JSON-related tweaks/fixes. 2016-05-28 16:46:34 +01:00
Mike McQuaid
6ba466f5d8 Use JSON files for bottle upload data. (#166)
This means that we do not need to read formulae or evaluate Ruby at
upload time.
2016-05-28 15:54:05 +01:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00
Xu Cheng
e5b6f79b22 bottle: do not follow symlink when setting mtime
Also set atime to mtime, which seems to be a more common practice.

Fixes Homebrew/homebrew#49007

Closes Homebrew/homebrew#49027.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-10 21:01:12 +08:00
Xu Cheng
9d216a53f8 bottle: clear tab cache
We cached the tab file content during formula loading.
Let's discard them, so we can read tab content after relocation
2016-01-26 15:52:45 +08:00
Xu Cheng
1f2ca73ac1 bottle: ensure to restore relocation on text files 2016-01-26 15:50:17 +08:00
Xu Cheng
7958343f16 bottle: read source modified time from tabfile
* Avoid unnecessary stage overhead
* Support different download strategy, e.g. `git`.
2016-01-15 16:26:04 +08:00
bigbes
5e25b08fe4 bottle: merging problem when head conatins commas
If `head` sections contains commas (e.g. `url "https://github.com/tarantool/tarantool.git", :branch => "1.6", :shallow => false`)
then re thinks that it reached the end and inserts `bottle do <-> end`
block before it, that leads to problems in ` brew audit --devel tarantool --strict --online`:

```
==> audit problems
tarantool:
 * `head` (line 11) should be put before `bottle block` (line 7)
```

It blocks Homebrew/homebrew#47495

Closes Homebrew/homebrew#47931.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-14 03:48:03 +00:00
Baptiste Fontaine
169b8fc039 Revert "minor perf improvements"
This reverts commit 16a2a8274a7808e63a6c78475e12a7c0ef5812ef.
2015-12-26 23:00:38 +01:00
Baptiste Fontaine
48681c3f3a minor perf improvements
Closes Homebrew/homebrew#47224.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-26 22:58:26 +01:00
Xu Cheng
f37f8b5c7a bottle: prevent bottling formula outside core or taps
Closes Homebrew/homebrew#47233.
2015-12-26 18:08:44 +08:00
Øyvind Ingebrigtsen Øvergaard
cf2bf08ec9 bottle: don't read mtime from nonexistant files
If the source contains a broken symlink, `brew bottle` would fail for no
good reason when trying to determine the most recently modified
file. To avoid this, we ignore any files for which stat(2) fails.

Closes Homebrew/homebrew#47111.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-21 07:54:30 +00:00
Martin Afanasjew
02cd2c899a bottle: fix Ruby 1.8 breakage
`OpenStruct` (of which `Tab` is a subclass) doesn't support subscripting
with square brackets. Use normal dot notation to restore compatibility.
2015-12-16 02:12:50 +01:00
Mike McQuaid
b0e39203fe bottle: don't use empty tab. 2015-12-15 17:05:24 +00:00
Mike McQuaid
214c865167 bottle: make bottle checksums reproducible.
I've set all the variable data to versions that are dependent on the
latest source file date and various modification dates also to the
latest source file date. With this if you rerun `brew bottle`
multiple times in a row you will see the same checksum even if you have
`brew reinstall`ed (as long as upstream does not hardcode e.g. the
build date).

I debugged this with diffoscope and worked on this as part of the
Athens 2015 reproducible builds workshop:
https://reproducible-builds.org/events/athens2015/

Closes Homebrew/homebrew#46587.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15 14:24:18 +00:00
Martin Afanasjew
4d772042f7 keg_relocate: remove options from Keg#dylib_id_for
No longer used since commit 3b0cbe6a56d9133941482a9e2d033ad86cdb5e79.

Closes Homebrew/homebrew#45835.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-11 14:23:59 +08:00
Xu Cheng
d20d08b5fe bottle: fail if bottle is disabled 2015-10-19 21:41:36 +08:00
Xu Cheng
1da0583634 bottle: allow --merge --write without commit 2015-10-15 09:05:51 +01:00
Mike McQuaid
f154f4898a bottle: output maximum number of strings matches.
`brew bottle --verbose` outputs all the matches for a string found
in the files inside the Cellar. Instead of outputting all of these just
output the first 100.

Closes Homebrew/homebrew#44266.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-23 15:17:35 +01:00
Xu Cheng
635340e32e bottle: allow updating :any to :any_skip_relocation when keep old
Closes Homebrew/homebrew#43849.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-12 18:26:16 +08:00
Xu Cheng
ed87972e2d bottle: only set prefix if un-relocatable
Closes Homebrew/homebrew#43819.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-12 01:39:00 +08:00
Xu Cheng
e23cca8d84 bottle: auto detect any_skip_relocation 2015-09-12 01:39:00 +08:00
Xu Cheng
d911b5689a keg_relocate: split relocate_install_names and relocate_text_files
For bottle with `:any_skip_relocation`, relocating text files is
required.
2015-09-12 01:38:59 +08:00
Xu Cheng
55616a4d01 bottle: improve --keep-old error message for merge as well 2015-09-11 18:36:40 +08:00
Xu Cheng
fe204fdf4b bottle: fix output for absolute symlinks
Closes Homebrew/homebrew#43816.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-11 18:32:35 +08:00
Mike McQuaid
6d6daae050 bottle: improve --keep-old error message. 2015-09-11 11:16:15 +01:00
Xu Cheng
70f2b6f195 bottle: allow to keep old bottle specification
Closes Homebrew/homebrew#43766.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-11 14:17:28 +08:00
Xu Cheng
fb1789ad3d bottle: use if-else branch instead of exit 2015-09-11 14:17:28 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
609af678fd bottle: improve relocation
* skip document for relocatable check
* relocate INSTALL_RECEIPT.json file

Fixes Homebrew/homebrew#41545.

Closes Homebrew/homebrew#41568.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-10 23:28:41 +08:00
Xu Cheng
4443a87524 stop setting root_url for offical taps' bottles 2015-07-06 18:04:59 +08:00
Xu Cheng
3c418cfb4e bottle: add homepage and desc into regex
Some formulae put `desc` field behind `url` which can make bottle block go to strange place.
So let's add `homepage` and `desc` into bottle regex.

Closes Homebrew/homebrew#40469.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-07 20:33:25 +08:00
Xu Cheng
be18a816af bottle: remove bottle_filename_formula_name 2015-06-02 16:45:44 +08:00
Xu Cheng
fbf1af24d7 bottle: use Formula#full_name 2015-05-29 17:02:22 +08:00
Jack Nagel
5cb392d9d7 Revert "Check empty? to avoid introducing nils"
This reverts commit 580cd173cbf92aa9851e68d635af518a668a6cdc.
2015-05-28 23:57:02 -04:00
Xu Cheng
8a4dcdd5a1 bottle: use ARGV.resolved_formulae 2015-05-27 13:53:41 +08:00
Jack Nagel
be0a1e7635 Check empty? to avoid introducing nils
[].last => nil
[].max => nil
2015-05-26 19:51:30 -04:00
Mike McQuaid
d8f9552cab bottle: handle nil bottle revision case. 2015-05-26 15:49:39 +01:00
Ian Lancaster
c327fdafa9 bottle: discard bottle revision from prior pkg_version
Closes Homebrew/homebrew#38628.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-26 19:21:15 +08:00
Xu Cheng
a972565739 bottle: matching url with options
Closes Homebrew/homebrew-versions#791.

Closes Homebrew/homebrew#39137.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-28 18:59:40 +08:00
Mike McQuaid
3d71826e6d bottle: remove unused variable. 2015-03-08 09:39:14 +00:00
Dominyk Tiller
12861686b8 checksums: switch to sha256 for bottles and new formulae
Closes Homebrew/homebrew#37164.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-03-05 14:45:39 +00:00