2

The official guide says:

git pull octopress master # Get the latest Octopress
bundle install # Keep gems updated
rake update_source # update the template's source
rake update_style # update the template's style

I am stuck at rake update_source:

Welcome to Git (version 1.8.5.2-preview20131230)

MrD@MRSD /c/Dropbox/Udun/octopress (source) # source, where I write the blog
$ git checkout master
Branch master set up to track remote branch master from octopress.
Switched to a new branch 'master'
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ git pull octopress master
From git://github.com/imathis/octopress
 * branch            master     -> FETCH_HEAD
Already up-to-date.
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (0.9.2.2)
# ...
Using bundler (1.3.5)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
MrD@MRSD /c/Dropbox/Udun/octopress (master)
$ rake update_source
## Set the codepage to 65001 for Windows machines
mkdir source.old
cp -r source/. source.old
## Copied source into source.old/
cp -r --remove-destination .themes/classic/source/. source
cp -r --remove-destination source.old/_includes/custom/. source/_includes/custom
/
rake aborted!
No such file or directory - source.old/_includes/custom/.
c:/Dropbox/Udun/octopress/Rakefile:206:in `block in <top (required)>'
Tasks: TOP => update_source
(See full trace by running task with --trace)

So how do I proceed ?

EDIT: I opened an issue on Jul 16, 2014: https://github.com/imathis/octopress/issues/1604

I have since rebased source on master (need I say I do not care about the source history nor my typos are meant to be shared) and the blog functions but I'd like some feedback on this - namely:

do I need to rebase my source branch on master to properly update ?

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361

2 Answers2

1

Well the real answer is I should never have checked out master. The process went smoothly when I did it from source...

MrD@MRSD /c/Dropbox/Udun/octopress (source)
$ rake update_source
## Removed existing source.old directory
rm -r source.old
mkdir source.old
cp -r source/. source.old
## Copied source into source.old/
cp -r --remove-destination .themes/classic/source/. source
cp -r --remove-destination source.old/_includes/custom/. source/_includes/custom
/
cp source.old/favicon.png source
## Updated source ##

MrD@MRSD /c/Dropbox/Udun/octopress (source)
$ rake update_style
mv sass sass.old
## Moved styles into sass.old/
cp -r .themes/classic/sass/ sass
cp -r sass/custom/. sass.old/custom
## Updated Sass ##

Still it overwrote:

source/_includes/navigation.html
source/_layouts/post.html

on rake update_source and:

sass/custom/_styles.scss

on rake update_style.

Also I wonder - should I rebase on master ?

EDIT: to the best of my belief one should issue git rebase master and closing this

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
  • For Octopress, you have to forget about traditional branch, fetch, pull, rebase, etc. Octopress for Github treats the two branches as two completely different repos. NEVER merge, never pull from master, never rebase from origin/master - EVER EVER EVER. They are different repos, that just happen to be two branches of the same actual repo. I have pulled from master a few times and screwed up my local repo. Either revert, or I usually just blow out the directly and clone the repo all over again. – eduncan911 Jul 15 '14 at 20:07
  • No not really - the master I talk about is not the one on the deploy folder - I talk about the master source - see:https://www.dropbox.com/s/c9lihuqt5e6i5ji/octo%20master.jpg - notice the "fix typo in update_style copy command" - must be what I need ;) – Mr_and_Mrs_D Jul 15 '14 at 21:40
  • Oh, you merged the master from Octopress' latest... Yeah, I haven't been brave enough for that yet. I've highly modified mine to no end. – eduncan911 Jul 16 '14 at 01:01
  • @eduncan911: will try to rebase on that at some point ;) Meanwhile do you know where I should override `source/_includes/navigation.html` and `source/_layouts/post.html` ? – Mr_and_Mrs_D Jul 16 '14 at 01:03
  • 1
    I think it is in `source/_includes/custom`. Personally, I just created my own theme from scratch. Octopress' default theme's "layout" is way overly complex and broken up until far too many tiny files. You can see my http://eduncan911.com/blog source at: https://github.com/eduncan911/eduncan911.github.io/tree/source – eduncan911 Jul 16 '14 at 01:10
0

I've noticed a few 'issues' with Octopress' Rakefile for this kind of stuff, usually syntax errors.

Your error is there in the log output:

No such file or directory - source.old/_includes/custom/.

This rings a bell to me... The author of Octopress only recently added that _includes/custom/ set of templates late last year, or early this year or something. So, older installs may not have it. Odd how that blows up the entire script - it should just ignore it.

Can you look into your original files/directory to see if you have that _includes/custom/? I'm willing to bet you don't, hence why you are trying to update.

Looking at my Rakefile as of April 4th or so (the first time I downloaded Octopress to convert, and last time), the code is:

desc "Move source to source.old, install source theme updates, replace source/_includes/navigation.html with source.old's navigation"
task :update_source, :theme do |t, args|
  theme = args.theme || 'classic'
  if File.directory?("#{source_dir}.old")
    puts "## Removed existing #{source_dir}.old directory"
    rm_r "#{source_dir}.old", :secure=>true
  end
  mkdir "#{source_dir}.old"
  cp_r "#{source_dir}/.", "#{source_dir}.old"
  puts "## Copied #{source_dir} into #{source_dir}.old/"
  cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true
  cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true
  cp "#{source_dir}.old/favicon.png", source_dir
  mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
  cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
  puts "## Updated #{source_dir} ##"
end

So, open your Rakefile and find that line above:

cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true

And comment it out:

#cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true

The rest looks like it should be there.

Also note the update_style method of that Rakefile:

desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
task :update_style, :theme do |t, args|
  theme = args.theme || 'classic'
  if File.directory?("sass.old")
    puts "removed existing sass.old directory"
    rm_r "sass.old", :secure=>true
  end
  mv "sass", "sass.old"
  puts "## Moved styles into sass.old/"
  cp_r "#{themes_dir}/"+theme+"/sass/", "sass"
  cp_r "sass/custom/.", "sass.old/custom"
  puts "## Updated Sass ##"
end

That may error as well depending on how hold your install is.

All in all, you'll just need to hack your Rakefile (and Gemfile, argh) to meet your install/requirements. That's why you chose to run a Hacker's Blogging framework: to hack away at it. Else you'd be on Wordpress, right?

eduncan911
  • 17,165
  • 13
  • 68
  • 104