diff options
authorJoey Hess2014-08-19 15:02:12 -0400
committerJoey Hess2014-08-19 15:02:12 -0400
commit7d59dee4690297154f6924a04949413ddea8a17b (patch)
parentb6c5f547419ce95d20453f30403e1a5860720fe6 (diff)
local repo fully working now
5 files changed, 24 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 20087723..2321d021 100644
--- a/Makefile
+++ b/Makefile
@@ -23,9 +23,13 @@ install:
install -d $(DESTDIR)/usr/bin $(DESTDIR)/usr/src/propellor
install -s dist/build/propellor/propellor $(DESTDIR)/usr/bin/propellor
$(CABAL) sdist
- cat dist/propellor-*.tar.gz | \
- (cd $(DESTDIR)/usr/src/propellor && tar zx --strip-components=1)
- cd $(DESTDIR)/usr/src/propellor && git init && git add . && git commit -m "current version of propellor"
+ mkdir -p dist/gittmp
+ cat dist/propellor-*.tar.gz | (cd dist/gittmp && tar zx --strip-components=1)
+ cd dist/gittmp && git init && \
+ git add . \
+ && git commit -m "distributed version of propellor" \
+ && git bundle create $(DESTDIR)/usr/src/propellor/propellor.git master HEAD
+ rm -rf dist/gittmp
rm -rf dist Setup tags propellor privdata/local
diff --git a/debian/README.Debian b/debian/README.Debian
index 73fea47d..9fa53c7b 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -7,10 +7,16 @@ repository in ~/.propellor/, and run ~/.propellor/propellor if it exists.
Edit ~/.propellor/config.hs to configure it.
Note that upgrading the propellor package will not update your
-~/.propellor/ repository. You can `git pull upstream` in your repository to
-update to the current upstream source, as distributed in the Debian
+~/.propellor/ repository. This is because you may have local changes
+to the source, or may need to adapt your config.hs to work with the new
+version of propellor. Instead, if your ~/.propellor/ is from an older
+version of propellor, /usr/bin/propellor will warn that it's out of date.
-Older versions of propellor set the upstream remote to
-point to a repository on github, so if you used one of them, you may want
-to change it to point to the new location, /usr/src/propellor/
+You can `git pull upstream` in your repository to update to the
+current upstream source, as distributed in the Debian package.
+In older versions of propellor, the upstream remote was pointed at
+the repository on github, so you may want to change it to point
+to the repository included in the Debian package:
+ git config remote.upstream.url /usr/src/propellor/propellor.git
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
deleted file mode 100644
index a5ccccae..00000000
--- a/debian/lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-# These files are used in a git repository that propellor sets up.
-propellor: package-contains-vcs-control-file usr/src/propellor/.gitignore
diff --git a/propellor.cabal b/propellor.cabal
index 809636c2..5bca9326 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -25,7 +25,6 @@ Extra-Source-Files:
- debian/lintian-overrides
Synopsis: property-based host configuration management in haskell
Propellor enures that the system it's run in satisfies a list of
diff --git a/src/wrapper.hs b/src/wrapper.hs
index 694067df..4c3f8074 100644
--- a/src/wrapper.hs
+++ b/src/wrapper.hs
@@ -29,7 +29,7 @@ import System.Exit
import System.Posix.Directory
localrepo :: FilePath
-localrepo = "/usr/src/propellor"
+localrepo = "/usr/src/propellor/propellor.git"
-- Using the github mirror of the main propellor repo because
-- it is accessible over https for better security.
@@ -56,28 +56,13 @@ wrapper args propellordir propellorbin = do
makeRepo = do
putStrLn $ "Setting up your propellor repo in " ++ propellordir
putStrLn ""
- ifM (doesDirectoryExist localrepo)
- ( do
- void $ boolSystem "git" [Param "clone", File localrepo, File propellordir]
- setuprepo True localrepo
+ ifM (doesFileExist localrepo <||> doesDirectoryExist localrepo)
+ ( void $ boolSystem "git" [Param "clone", File localrepo, File propellordir]
, do
void $ boolSystem "git" [Param "clone", Param netrepo, File propellordir]
- setuprepo False netrepo
+ whenM (doesDirectoryExist (propellordir </> "privdata")) $
+ mapM_ nukeFile =<< dirContents (propellordir </> "privdata")
- setuprepo fromlocalrepo repolocation = do
- changeWorkingDirectory propellordir
- whenM (doesDirectoryExist "privdata") $
- mapM_ nukeFile =<< dirContents "privdata"
- void $ boolSystem "git" [Param "remote", Param "rm", Param "origin"]
- void $ boolSystem "git" [Param "remote", Param "add", Param "upstream", Param repolocation]
- -- Connect synthetic git repo with upstream history so
- -- merging with upstream will work going forward.
- -- Note -s ours is used to avoid getting any divergent
- -- changes from upstream.
- when (not fromlocalrepo) $ do
- void $ boolSystem "git" [Param "fetch", Param "upstream"]
- version <- readProcess "dpkg-query" ["--showformat", "${Version}", "--show", "propellor"]
- void $ boolSystem "git" [Param "merge", Param "-s", Param "ours", Param version]
buildruncfg = do
changeWorkingDirectory propellordir
ifM (boolSystem "make" [Param "build"])