local repo fully working now
This commit is contained in:
parent
b6c5f54741
commit
7d59dee469
10
Makefile
10
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
|
||||
|
||||
clean:
|
||||
rm -rf dist Setup tags propellor privdata/local
|
||||
|
|
|
@ -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
|
||||
package.
|
||||
~/.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
|
||||
|
|
|
@ -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
|
|
@ -25,7 +25,6 @@ Extra-Source-Files:
|
|||
debian/control
|
||||
debian/copyright
|
||||
debian/rules
|
||||
debian/lintian-overrides
|
||||
Synopsis: property-based host configuration management in haskell
|
||||
Description:
|
||||
Propellor enures that the system it's run in satisfies a list of
|
||||
|
|
|
@ -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"])
|
||||
|
|
Loading…
Reference in New Issue